Git Product home page Git Product logo

Comments (14)

aldeed avatar aldeed commented on May 26, 2024 1

@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.

aldeed avatar aldeed commented on May 26, 2024

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.

ayhid avatar ayhid commented on May 26, 2024

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.

aldeed avatar aldeed commented on May 26, 2024

@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.

ayhid avatar ayhid commented on May 26, 2024

@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.

aldeed avatar aldeed commented on May 26, 2024

OK, I wasn't sure. We can accept a PR for this or look into it when there's time.

from meteor-mocha.

ayhid avatar ayhid commented on May 26, 2024

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.

jeffryan avatar jeffryan commented on May 26, 2024

@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.

ayhid avatar ayhid commented on May 26, 2024

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.

jeffryan avatar jeffryan commented on May 26, 2024

Hey thanks @ayhid - I'm just going to use your fork then ;)

from meteor-mocha.

jmblanc avatar jmblanc commented on May 26, 2024

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.

thebarty avatar thebarty commented on May 26, 2024

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.

thebarty avatar thebarty commented on May 26, 2024

@jeffryan @ayhid : Can please share a step-by-step instruction on how to do this? This would be really awesome!!!

from meteor-mocha.

thebarty avatar thebarty commented on May 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.