-
Notifications
You must be signed in to change notification settings - Fork 67
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
feat(tests): Add individual evergreen test results with XUnit #2227
Merged
Merged
Changes from all commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
3c2be35
XUnit results experiment
gagik 84af035
Merge branch 'main' into gagik/report-individual-tests
gagik 48d8a31
add empty xml
gagik 165de46
make it valid xml
gagik 5c26e87
Use task name
gagik a24cba1
double check
gagik 883411c
remvoe env
gagik 1084668
Use setup-env
gagik f77126e
export attempt
gagik a1146f5
try export again
gagik 571f2e2
persist e2e_task_name
gagik ab21e10
manually pass task_name
gagik b9ff363
use some var
gagik 8d0b5c8
does manual work
gagik 3da9000
try more
gagik c084523
remove typo
gagik 8a48dbc
Test using the generator for task names
gagik 1dcd133
check if a different var helps?
gagik a81186d
use task_name again
gagik c299e68
fix syntax
gagik 9d7d320
Merge branch 'main' into gagik/report-individual-tests
gagik cc1f232
Get evergreen to rerun
gagik f06c3c7
Merge branch 'gagik/report-individual-tests' of github.com:mongodb-js…
gagik eb6df53
remove quotations
gagik a5099e2
Use correct quotes
gagik 2bfe4c8
pass without quotes
gagik eb33d01
Use reporter across all packages
gagik dbc3723
Pass task name again
gagik 928d5c4
Remove log and use files
gagik 5a46c46
Use file
gagik 554f2a7
Update evergreen.yml
gagik 8800a49
Add exception for empty.xml
gagik 35fb5af
check if passing task names is actually needed
gagik 65783f3
Update evergreen config
gagik 356538b
Merge branch 'main' into gagik/report-individual-tests
gagik d2b490f
Merge branch 'main' into gagik/report-individual-tests
gagik 8b8c292
Merge branch 'main' of github.com:mongodb-js/mongosh into gagik/repor…
gagik f06f9b4
Update to match main and readd task_name
gagik d9f8aa1
Use reporter
gagik f48bbe0
Merge branch 'main' into gagik/report-individual-tests
gagik 09c71d2
Merge branch 'gagik/report-individual-tests' of github.com:mongodb-js…
gagik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,3 +26,5 @@ mongocryptd.pid | |
.sbom | ||
.nvm | ||
snapshot.blob | ||
.logs/* | ||
!.logs/empty.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<!-- An empty test suite which is needed as not all tasks produce XUnit results and the current Evergreen setup always expects some file to be uploaded --> | ||
<testsuite name="empty" tests="0" failures="0" errors="0" skipped="0" timestamp="Fri, 18 Oct 2024 09:21:06 GMT" time="8.907"> | ||
</testsuite> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { reporters } from 'mocha'; | ||
import type { MochaOptions, Runner } from 'mocha'; | ||
import path from 'path'; | ||
|
||
// Import the built-in reporters | ||
const Spec = reporters.Spec; | ||
const XUnit = reporters.XUnit; | ||
|
||
export class MochaReporter extends reporters.Base { | ||
constructor(runner: Runner, options: MochaOptions) { | ||
super(runner, options); | ||
const suiteName = process.env.TASK_NAME ?? path.basename(process.cwd()); | ||
|
||
new Spec(runner); | ||
|
||
runner.on('suite', (suite) => { | ||
if (suite.parent?.root) { | ||
suite.title = `${suiteName}__${suite.title}`; | ||
} | ||
}); | ||
|
||
new XUnit(runner, { | ||
reporterOptions: { | ||
suiteName, | ||
output: path.join(__dirname, '..', '..', '.logs', `${suiteName}.xml`), | ||
}, | ||
}); | ||
} | ||
} | ||
|
||
module.exports = MochaReporter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 can't think of a better way to go about this... evergreen seems to fail the job completely when no files are found in the attach results step