Is there a way to run `drush test-run --xml=... SomeTestCase` and display the report information on the console?

StackOverflow https://stackoverflow.com/questions/21123143

  •  28-09-2022
  •  | 
  •  

Question

Basically, I want to avoid visiting a browser to get the detailed test results.

Was it helpful?

Solution

I had similar requirements, as I want to run "drush test-run" from within vim and get the results traversable in vim.

So I started a small and rough project https://github.com/DirkR/junitlog2vim. It takes the xml results file and generates line by line report. The script junitlog2vim.py requires python3.

As a convenience I created a Makefile. It takes the optional arguments "CASE" and "METHODS" to define the proper arguments for "drush test-run" and it has sensible defaults. You only have to provide an argument SITE_ALIAS or edit the Makefile.

if you run

make SITE_ALIAS=@mysite CASE=MyTestCase

then you get linewise error report with filename, line number and error message.

I hope it helps. Feel free to hack or adopt it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top