Comments (14)
@thebarty Just published 0.3.0, which should let you do SERVER_TEST_REPORTER=xunit XUNIT_FILE=$PWD/unit.xml
without needing the forked core or any other workarounds.
from meteor-mocha.
Maybe this would work? https://www.npmjs.com/package/reporter-file
You can specify the "reporter-file" reporter for dispatch:mocha
as explained here: https://github.com/DispatchMe/meteor-mocha#run-with-a-different-reporter
from meteor-mocha.
thanks @aldeed for your reply
I added reporter file to my project devDependencies but when running tests with this command:
SERVER_TEST_REPORTER='xunit-file' meteor test --once --driver-package dispatch:mocha
I got this error Error: invalid reporter "xunit-file"
It seems that the mocha driver can not 'see' the new reporter
from meteor-mocha.
@ayhid I haven't tried, but the way I read the docs, the command should be:
MOCHA_REPORTER=XUnit SERVER_TEST_REPORTER=reporter-file meteor test --once --driver-package dispatch:mocha
And you can also add MOCHA_REPORTER_FILE=something.xml if you don't want the default filename of xunit.xml
in the current directory
I you just want xunit file, you could also use https://www.npmjs.com/package/xunit-file package and then SERVER_TEST_REPORTER='xunit-file'
would work.
from meteor-mocha.
@aldeed I tried the command you suggested but I still have Error: invalid reporter "reporter-file"
exception for some reason the "reporter-file" module is not "seen" by dispatch:mocha
.
from meteor-mocha.
OK, I wasn't sure. We can accept a PR for this or look into it when there's time.
from meteor-mocha.
added xunit-file
as a dependency for practicalmeteor:mocha-core and with this command
MOCHA_REPORTER=XUnit SERVER_TEST_REPORTER=xunit-file XUNIT_FILE=/home/optimus/cleanio/orders-microservice/output/xunit.xml meteor test --once --driver-package dispatch:mocha
I finally got my report on a file.
I would like to make a PR but I have to admit I don't know where to start, any help is much appreciated.
Thanks
from meteor-mocha.
@aldeed thanks for this package! It seems to work fine for standard console output which is a big step up for us as spacejam has been broken for us for quite a while.
We too are interested in using an xunit file reporter as we have xunit parsers in our CI environment. I've read through your discussion above and tried a number of things but cannot seem to get the underlying practicalmeteor:mocha-core to see the new reporter.
@ayhid would you mind describing further how you added xunit-file as a dependency for practicalmeteor:mocha-core? Did you actually clone the repo locally and add the dependency to the package.js file?
I am doing package testing and am pulling dispatch:mocha-phantomjs in as a test dependency in our project. I'm not sure how to add the said dependency outside cloning the repo and modifying it. Not an ideal solution but if thats what it takes...
from meteor-mocha.
hey @jeffryan , like you said I just added the package to my fork dependecies.
And I added it locally as a submodule, it's not the cleanest solution ever, but it does the job for now.
from meteor-mocha.
Hey thanks @ayhid - I'm just going to use your fork then ;)
from meteor-mocha.
Hello,
i am concerned about Continus Integration, and I also failed to get a xunit file. but I dont know how to apply your solution, I mean pratically. Is it possible that you add some explanations ? Thanks.
from meteor-mocha.
Hi guys,
can you please post an update on this? Any news?
I am trying to output a CircleCi compatible xml, but am getting a Error: invalid reporter "xunit-file"
error, if I run something like MOCHA_REPORTER=XUnit SERVER_TEST_REPORTER=xunit-file XUNIT_FILE=xunit.xml meteor test --once --driver-package dispatch:mocha
.
This is a more detailed description of my usecase https://forums.meteor.com/t/enhanced-but-simply-stupid-circleci-setup-that-first-runs-unit-integration-tests-and-then-chimp-acceptance-tests/35086
Thanks a lot for your help!
from meteor-mocha.
@jeffryan @ayhid : Can please share a step-by-step instruction on how to do this? This would be really awesome!!!
from meteor-mocha.
ok this is what worked out for me:
meteor add practicalmeteor:mocha # we'll use this package to generate CircleCi compatible xml-files
meteor remove practicalmeteor:mocha; # cleanup for `dispatch:mocha` (otherwise we'll get a version-constraint)
meteor add practicalmeteor:chai
cd packages; git clone https://github.com/ayhid/meteor-mocha-core.git
# finally create the xml file
targetXmlFilePath="$(pwd)/unit.xml"; MOCHA_REPORTER=XUnit SERVER_TEST_REPORTER=xunit-file XUNIT_FILE=$targetXmlFilePath meteor test --once --driver-package dispatch:mocha
@aldeed : How about getting a CircleCi-compatible reporter build right into this package to make it easy for future users?
from meteor-mocha.
Related Issues (20)
- browser-shim.js prevents nice console logs HOT 1
- Puppeteer app-test yields "TypeError: Cannot read property 'call' of undefined"
- texts from `describe` and `it` blocks are not printed when using browser `nightmare` HOT 3
- Tests are only re-run if I change a *.tests.* file, not if I change implementation files (e.g. server/...) HOT 3
- UnhandledPromiseRejectionWarning: Error: Protocol error (Runtime.callFunctionOn): Promise was collected HOT 1
- Running tests do not finish after the end inside CI HOT 3
- How to setup a global hook for database prefills (fixtures) HOT 2
- XML report output is missing for client tests
- Need upgrade to dependencies to work with Meteor 2.3 HOT 1
- Bump supported dependency versions of lmieulet:meteor-coverage to 4.0.0 HOT 2
- Error: Timeout of 2000ms exceeded
- CSS missing during client side tests due to brower-policy HOT 1
- No tests running in parallel HOT 1
- Allow running specific server tests or hooks after client tests in full app mode
- Run test for multiple specific filename
- Move tests from CI to GitHub actions HOT 3
- The meteor http package is deprecated HOT 3
- Client unit tests not working on Meteor3 with beta HOT 17
- Dependency on jquery? HOT 6
- Eager loading of tests does not work as described in the Meteor guide HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from meteor-mocha.