Git Product home page Git Product logo

Comments (7)

singhsoldier13 avatar singhsoldier13 commented on May 26, 2024

+1

from meteor-mocha.

thebarty avatar thebarty commented on May 26, 2024

Yeah - plus one.

I get this error:
Load the app in a browser to run client tests, or set the TEST_BROWSER_DRIVER environment variable. See https://github.com/meteortesting/meteor-mocha/blob/master/README.md#run-app-tests

when calling via

SERVER_TEST_REPORTER=xunit XUNIT_FILE=$PWD/unit-integrationa-results.xml meteor test --once --driver-package meteortesting:mocha

from meteor-mocha.

SimonSimCity avatar SimonSimCity commented on May 26, 2024

This should be fixed in version 1.1.0. When you now set the MOCHA_REPORTER to xunit (or separately via SERVER_TEST_REPORTER and CLIENT_TEST_REPORTER) you'll see, that the output of both test-environments will be in the xunit format.

You then should also set SERVER_MOCHA_OUTPUT (which replaces XUNIT_FILE) and CLIENT_MOCHA_OUTPUT to the path you want to see the test reports in.

In case it doesn't work, please make sure that this and the package meteortesting:browser-tests are installed in the latest version and that you run the tests using a headless browser as described in https://github.com/meteortesting/meteor-browser-tests#dependencies (the documentation on this package regarding headless browsers is a bit outdated 😉 - that's why I linked directly to the package providing this feature).

from meteor-mocha.

Floriferous avatar Floriferous commented on May 26, 2024

Client-side tests don't seem to report properly for me. I can see the file on CircleCI being generated, and its content appears to be ok, but circleCI complains:

screenshot 2019-02-04 at 11 03 42

screenshot 2019-02-04 at 11 03 33

Would you have an idea what could be wrong with the file?

EDIT: It seems that the client test report is simply reading everything off the command line and dumping it into the xml file, so if there are any other logs than test results, the xml file will be invalid. Is there a way to filter for xml lines only maybe?

from meteor-mocha.

SimonSimCity avatar SimonSimCity commented on May 26, 2024

Well, the truth is, that all the test-results on the client are just written out to the console, which can be grabbed on the server-side.

If you want to dig into it, this is the repository used for getting in contact with the browsers in an abstract way: https://github.com/meteortesting/meteor-browser-tests

I see your problem here, but don't know how to fix it. Mainly because I can't differ between a result from a reporter and a usual console.log() call. I could only do so for console.error() and maybe console.warn(), console.info() or other methods as well listed here https://developer.mozilla.org/en-US/docs/Web/API/Console, but this highly depends on the implementation for each of the browsers.

from meteor-mocha.

Floriferous avatar Floriferous commented on May 26, 2024

Could we maybe clean up the xml file at the end? It's a bit hacky, but removing any "non-xml" content from the file could already be a coarse filter.

I think it might be safe to say very few people would ever console.log xml-valid content.

EDIT: xUnit xml seems to have a very simple syntax: https://xunit.github.io/docs/format-xml-v2
Removing any non-xml nodes might do the trick?

EDIT2: It looks like what you get from the console isn't even XML, it's formatted text. I'd be surprised if any xml parser can actually read it?

from meteor-mocha.

SimonSimCity avatar SimonSimCity commented on May 26, 2024

Could do that ... I'd prefer a separate issue for this, since the main purpose of this ticket is solved and this (to me) is a separate ticket.

If we would cut out some of the data returned by calling console.log() I'd at least put it out on stdout - not simply ignore it, but this is up for a discussion which I'd take in the new ticket. If you have time, I'd also welcome a PR. Otherwise you'd have to wait until someone else (e.g. me) finds time to pick it up.

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.