-
Notifications
You must be signed in to change notification settings - Fork 317
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
[ci-app] Add JUnit XML Report Upload #1367
Changes from 6 commits
7f212b9
ae170db
ca30282
ebe1e74
231211e
4b133c6
3845671
d029adb
933bb91
d8bc53a
630d373
5d11223
dacbe4a
6aa483d
29b0460
15182c3
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 |
---|---|---|
|
@@ -22,15 +22,17 @@ | |
"tdd": "node scripts/tdd.js", | ||
"test": "SERVICES=* yarn services && mocha --exit --expose-gc 'packages/dd-trace/test/setup/node.js' 'packages/*/test/**/*.spec.js'", | ||
"test:core": "mocha --exit --expose-gc --file packages/dd-trace/test/setup/core.js \"packages/dd-trace/test/**/*.spec.js\"", | ||
"test:core:ci": "nyc --include \"packages/dd-trace/src/**/*.js\" -- npm run test:core", | ||
"test:core:ci": "nyc --include \"packages/dd-trace/src/**/*.js\" -- npm run test:core -- --reporter=mocha-junit-reporter", | ||
juan-fernandez marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"test:plugins": "mocha --exit --file \"packages/dd-trace/test/setup/core.js\" \"packages/datadog-plugin-@($(echo $PLUGINS))/test/**/*.spec.js\"", | ||
"test:plugins:ci": "yarn services && nyc --include \"packages/datadog-plugin-@($(echo $PLUGINS))/src/**/*.js\" -- npm run test:plugins", | ||
"test:integration": "mocha --timeout 30000 \"integration-tests/**/*.spec.js\"", | ||
"leak:core": "node ./scripts/install_plugin_modules && (cd packages/memwatch && yarn) && NODE_PATH=./packages/memwatch/node_modules node --no-warnings ./node_modules/.bin/tape 'packages/dd-trace/test/leak/**/*.js'", | ||
"leak:plugins": "yarn services && (cd packages/memwatch && yarn) && NODE_PATH=./packages/memwatch/node_modules node --no-warnings ./node_modules/.bin/tape \"packages/datadog-plugin-@($(echo $PLUGINS))/test/leak.js\"", | ||
"cover:merge": "nyc merge ./.nyc_output ./.nyc_merge/$CIRCLE_JOB.json", | ||
"cover:report": "nyc report -t ./.nyc_merge -n 'packages/**/*.js'", | ||
"codecov": "codecov" | ||
"codecov": "codecov", | ||
"junit:upload:ci": "node ./scripts/junit_report.js", | ||
"junit:upload": "datadog-ci junit upload --tags runtime.version:$CI_NODE_VERSION --service dd-trace-js-core-tests ./test-results.xml" | ||
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. Where does 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, what's the benefit of ever running this locally? Is there a way to differentiate between local and CI runs? 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. yeah I'll just remove this and run it on the |
||
}, | ||
"repository": { | ||
"type": "git", | ||
|
@@ -99,6 +101,7 @@ | |
"jszip": "^3.5.0", | ||
"mkdirp": "^0.5.1", | ||
"mocha": "^5.2.0", | ||
"mocha-junit-reporter": "^2.0.0", | ||
"msgpack-lite": "^0.1.26", | ||
"nock": "^11.3.3", | ||
"nyc": "^14.1.1", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* eslint-disable no-console */ | ||
|
||
const semver = require('semver') | ||
const { execSync } = require('child_process') | ||
|
||
function uploadJUnitXMLReport () { | ||
if (semver.lt(process.version, '10.24.1')) { | ||
console.log('Node version incompatible with @datadog/datadog-ci. Skipping step.') | ||
return | ||
} | ||
// we install @datadog/datadog-ci | ||
execSync('yarn add --dev @datadog/[email protected]', { stdio: 'inherit' }) | ||
// we execute the upload command | ||
execSync('yarn junit:upload', | ||
{ | ||
stdio: 'inherit', | ||
env: { ...process.env, CI_NODE_VERSION: process.version } | ||
} | ||
) | ||
} | ||
|
||
uploadJUnitXMLReport() |
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.
inspired by https://circleci.com/blog/managing-secrets-when-you-have-pull-requests-from-outside-contributors/#:~:text=To%20enable%20CircleCI%20for%20forked,builds%20from%20forked%20pull%20requests