-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set up CircleCI test summary [npmcollaborators] #2526
Changes from all commits
71b0465
83ef124
93304b9
a76f105
7e6c327
a556263
964c45b
deb63be
3d6c588
85e0403
5e13553
00b556f
0d4a6bd
a727346
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--reporter mocha-env-reporter |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,11 +58,11 @@ | |
"xpath": "~0.0.27" | ||
}, | ||
"scripts": { | ||
"coverage:test:frontend": "BABEL_ENV=test nyc node_modules/mocha/bin/_mocha --require @babel/polyfill --require @babel/register --require mocha-yaml-loader \"frontend/**/*.spec.js\"", | ||
"coverage:test:server": "HANDLE_INTERNAL_ERRORS=false nyc node_modules/mocha/bin/_mocha \"*.spec.js\" \"lib/**/*.spec.js\" \"services/**/*.spec.js\"", | ||
"coverage:test:package": "nyc node_modules/mocha/bin/_mocha \"gh-badges/**/*.spec.js\"", | ||
"coverage:test:integration": "nyc node_modules/mocha/bin/_mocha \"lib/**/*.integration.js\" \"services/**/*.integration.js\"", | ||
"coverage:test:services": "nyc node_modules/mocha/bin/_mocha --delay lib/service-test-runner/cli.js", | ||
"coverage:test:frontend": "BABEL_ENV=test nyc node_modules/mocha/bin/_mocha --opts mocha.opts --require @babel/polyfill --require @babel/register --require mocha-yaml-loader \"frontend/**/*.spec.js\"", | ||
"coverage:test:server": "HANDLE_INTERNAL_ERRORS=false nyc node_modules/mocha/bin/_mocha --opts mocha.opts \"*.spec.js\" \"lib/**/*.spec.js\" \"services/**/*.spec.js\"", | ||
"coverage:test:package": "nyc node_modules/mocha/bin/_mocha --opts mocha.opts \"gh-badges/**/*.spec.js\"", | ||
"coverage:test:integration": "nyc node_modules/mocha/bin/_mocha --opts mocha.opts \"lib/**/*.integration.js\" \"services/**/*.integration.js\"", | ||
"coverage:test:services": "nyc node_modules/mocha/bin/_mocha --opts mocha.opts --delay lib/service-test-runner/cli.js", | ||
"coverage:test": "rimraf .nyc_output coverage; npm run coverage:test:server; npm run coverage:test:package; npm run coverage:test:frontend; npm run coverage:test:integration; npm run coverage:test:services", | ||
"coverage:report": "nyc report", | ||
"coverage:report:reopen": "opn coverage/lcov-report/index.html", | ||
|
@@ -71,14 +71,14 @@ | |
"prettier": "prettier --write \"**/*.js\"", | ||
"prettier-check": "prettier-check \"**/*.js\"", | ||
"danger": "danger", | ||
"test:js:frontend": "BABEL_ENV=test mocha --require @babel/polyfill --require @babel/register --require mocha-yaml-loader \"frontend/**/*.spec.js\"", | ||
"test:js:server": "HANDLE_INTERNAL_ERRORS=false mocha \"*.spec.js\" \"lib/**/*.spec.js\" \"services/**/*.spec.js\"", | ||
"test:js:package": "mocha \"gh-badges/**/*.spec.js\"", | ||
"test:integration": "mocha \"lib/**/*.integration.js\" \"services/**/*.integration.js\"", | ||
"test:services": "HANDLE_INTERNAL_ERRORS=false mocha --delay lib/service-test-runner/cli.js", | ||
"test:js:frontend": "BABEL_ENV=test mocha --opts mocha.opts --require @babel/polyfill --require @babel/register --require mocha-yaml-loader \"frontend/**/*.spec.js\"", | ||
"test:js:server": "HANDLE_INTERNAL_ERRORS=false mocha --opts mocha.opts \"*.spec.js\" \"lib/**/*.spec.js\" \"services/**/*.spec.js\"", | ||
"test:js:package": "mocha --opts mocha.opts \"gh-badges/**/*.spec.js\"", | ||
"test:integration": "mocha --opts mocha.opts \"lib/**/*.integration.js\" \"services/**/*.integration.js\"", | ||
"test:services": "HANDLE_INTERNAL_ERRORS=false mocha --opts mocha.opts --delay lib/service-test-runner/cli.js", | ||
"test:services:trace": "TRACE_SERVICES=true npm run test:services -- $*", | ||
"test:services:pr:prepare": "node lib/service-test-runner/pull-request-services-cli.js > pull-request-services.log", | ||
"test:services:pr:run": "HANDLE_INTERNAL_ERRORS=false mocha --delay lib/service-test-runner/cli.js --stdin < pull-request-services.log", | ||
"test:services:pr:run": "HANDLE_INTERNAL_ERRORS=false mocha --opts mocha.opts --delay lib/service-test-runner/cli.js --stdin < pull-request-services.log", | ||
"test:services:pr": "npm run test:services:pr:prepare && npm run test:services:pr:run", | ||
"test": "npm run defs && npm run lint && npm run test:js:frontend && npm run test:js:package && npm run test:js:server", | ||
"depcheck": "check-node-version --node \">= 8.0\"", | ||
|
@@ -157,6 +157,8 @@ | |
"minimist": "^1.2.0", | ||
"mkdirp": "^0.5.1", | ||
"mocha": "^5.0.0", | ||
"mocha-env-reporter": "^3.0.0", | ||
"mocha-junit-reporter": "^1.18.0", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also FWIW, Circle can parse the "xunit" format that is emitted by mocha's native/bundled xunit reporter which could save having to add another dev dependency There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, nice! I’ll give that a shot. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure how well the xunit reporter will play with mocha-env-reporter though. I always pass the file path for the xunit file via the reporter options There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes sense, not worth fighting xunit here IMO :) My guess is that they will point you to one of the community reporters (like xunit-file) that provide support for env var defined output file, at which point we're right back to what the junit reporter already gives us There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Heh, possibly. I have a soft spot for Mocha, especially after some recent unpleasant experiences with Jest doing unexpected things with setup. However I do find the way Mocha handles reporters and configuration to be frustrating, fiddly, and to require more effort than it should. I was happy with some upcoming improvements to the config which they mentioned in mochajs/mocha#3612. 🤞 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm a big fan of Mocha too. I've only worked with Jest in one project, but I do hear a lot of good things about it. What sort of setup issues have you seen with Jest? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I hit these issues:
|
||
"mocha-yaml-loader": "^1.0.3", | ||
"next": "^6.1.1", | ||
"nock": "^10.0.4", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about using one of the multi reporters, like mocha-multi-reporters or mocha-multi? That way we can still keep the terminal (spec) reporter as well for the benefit of local development and also get the results in the xml file that Circle needs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mocha-env-reporter
should use the default reporter outside of CI, though if there’s some other benefit to showing both I could change it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! I remember looking at that a while back but I see now where I may have gotten confused by the list of CI servers in the readme