Posted by fen on January 6, 2015 at 9:16pm
Does anyone have the junit formatter working with behat 3.x?
I suppose there is a related question: is anyone using Behat 3.x with D7 site builds or is 2.x still the way to go?
Does anyone have the junit formatter working with behat 3.x?
I suppose there is a related question: is anyone using Behat 3.x with D7 site builds or is 2.x still the way to go?
Comments
Ah, just found the PR
Looks like the PR is ready to go: https://github.com/Behat/Behat/pull/676
Can't wait ;)
Thanks for all the work!
How to configure the junit foormatter
I applied pull/676 to a fork of behat (yes, I know I'm jumping the gun) and I see the junit formatter is now available (via
behat -h) - yay! But when I try to run e.g../vendor/bin/behat -f pretty,progress,junit --out ,${PROGRESS_LOG},logs/xml -c tests/behat/smoke.ymlI get:
[Behat\Testwork\Output\Exception\FormatterNotFoundException]
pretty,progress,junitformatter is not found or has not been properly registered.If I choose only junit, ("-f junit -o logs/xml") I get output in
logs/xml/default.xmlI also tried this in my smoke.yml to no avail:
formatters:pretty:
progress: [logs/progress.log]
junit: [logs/xml]
I am also waiting the release
I am also waiting the release for the support of junit format in 3.x. I am using this with D7 and I am using DrupalExtension 3. Do you recommend downgrading to 2.x for now?
Perhaps not the best solution...
I applied the pull request to a local fork of Behat.
Now this works:
behat -f junit --out logs/xmlbut it will be the only formatter. That is, I can get 'pretty' or 'junit' but not both ('pretty,junit'). But it supports jenkins, so I'm happy.Note: I'm not sharing my fork as, once junit has been merged, I might do other experiments with the fork and I don't want to be responsible for breaking other's tests.
Same here
Same result here. I had to upgrade to the latest dev version of behat, and even then I only get access to one formatter at a time.
I copied this command verbatim from the behat docs:
behat -f pretty,progress,junit --out ,progress.out,xmlAnd received this error:
UPDATE: the format as of
UPDATE: the format as of behat 3.0-dev is:
bin/behat --format=pretty --out=std --format=junit --out=junitUPDATE: the format as of
UPDATE: the format as of behat 3.0-dev is:
bin/behat --format=pretty --out=std --format=junit --out=junit