-
Notifications
You must be signed in to change notification settings - Fork 76
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
circleci: publish test reports #570
Conversation
a473ec1
to
a55199c
Compare
I haven't looked deeply into this, but the idea of seeing test insights in CircleCI seems potentially useful! It sounds like it could help us identify intermittent test failures and slow tests. |
a55199c
to
da5085f
Compare
I've rebased this onto latest
@matthew-white would this be acceptable as-is? Is it worth trying to address points raised above? |
That seems OK to me. 🤷
I do think that that has the potential to make things harder to debug. With the current output, you can scroll up to a failed test to check whether there was any logging or an unhandled promise rejection before the test failure. But with the JUnit output, it looks like you just see the test failure and its associated stack trace. If there's a reasonable way to output both, that seems ideal. It's unfortunate though that Mocha doesn't support that out of the box. 😭 |
.circleci/config.yml
Outdated
- run: make test-full | ||
|
||
- run: mkdir ~/junit | ||
- run: MOCHA_FILE=~/junit/test-results.xml make test-ci |
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.
I am interesting in the recent feature of CircleCI "rerunning failed tests", for that we would need this step to be:
- run:
name: Run tests
command: |
mkdir test-results
TEST_FILES=$(circleci tests glob "test/**/*.js")
echo "$TEST_FILES" | circleci tests run --command="xargs npx mocha --exit --reporter mocha-junit-reporter --reporter-options mochaFile=./test-results/junit.xml"
- store_test_results:
path: test-results
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.
👍 that could be a good next step
How about using mocha-multi-reporters with mocha-junit-reporter? I am happy without text output as well |
I've implemented this directly - it turns out it's quite simple:
|
@matthew-white @sadiqkhoja this is ready for review again.
Example failure at:
|
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.
Looks great to me
No description provided.