Skip to content

Commit

Permalink
Upload junit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ljmotta committed Nov 30, 2023
1 parent d8ddc66 commit 2cbe4cf
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 3 deletions.
26 changes: 25 additions & 1 deletion .github/workflows/ci_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ jobs:
NODE_OPTIONS: "--max_old_space_size=4096"
BUILDKITE_ANALYTICS_TOKEN: ${{ secrets.BUILDKITE_ANALYTICS_TOKEN }}
run: >-
pnpm -r -F boxed-expression-component... --workspace-concurrency=1 build:prod
pnpm -r -F online-editor... --workspace-concurrency=1 build:prod
- name: "PARTIAL → Bootstrap"
if: steps.setup_build_mode.outputs.mode == 'partial'
Expand Down Expand Up @@ -140,6 +140,30 @@ jobs:
run: |
pnpm -F "...[${{ steps.checkout_pr.outputs.base_sha }}]" --workspace-concurrency=1 build:prod
- name: "Upload JUNIT end-to-end tests results to Buildkite (`main` only)"
if: always() && !cancelled()
shell: bash
env:
BUILDKITE_ANALYTICS_TOKEN: ${{ secrets.BUILDKITE_TOKEN }}
BUILDKITE_BRANCH: ${{ github.ref_name }}
BUILDKITE_MESSAGE: ${{ github.event.commits[0].message }}
run: |
echo $BUILDKITE_BRANCH
eval "find -P * -type f ${{ steps.ci_patterns.outputs.end_to_end_tests_reports_patterns_for_find }}"
echo "---------------------------- starting upload -----------------------"
eval "find -P * -type f ${{ steps.ci_patterns.outputs.end_to_end_tests_reports_patterns_for_find }}" | xargs -I{} curl -X POST \
-H "Authorization: Token token=\"$BUILDKITE_ANALYTICS_TOKEN\"" \
-F "format=junit" \
-F "data=@{}" \
-F "run_env[CI]=github_actions" \
-F "run_env[key]=$GITHUB_ACTION-$GITHUB_RUN_NUMBER-$GITHUB_RUN_ATTEMPT" \
-F "run_env[number]=$GITHUB_RUN_NUMBER" \
-F "run_env[branch]=$BUILDKITE_BRANCH" \
-F "run_env[commit_sha]=$GITHUB_SHA" \
-F "run_env[message]=$BUILDKITE_MESSAGE" \
-F "run_env[url]=https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" \
https://analytics-api.buildkite.com/v1/uploads
- name: "Upload JSON end-to-end tests results to Buildkite (`main` only)"
if: always() && !cancelled()
shell: bash
Expand Down
6 changes: 5 additions & 1 deletion packages/cors-proxy/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ module.exports = {
tsconfig: "<rootDir>/tsconfig.json",
},
},
reporters: ["default", ["jest-junit", { outputFile: "./dist-tests/junit-report.xml" }]],
reporters: [
"default",
"buildkite-test-collector/jest/reporter",
["jest-junit", { outputFile: "./dist-tests/junit-report.xml" }],
],
moduleDirectories: ["node_modules"],
moduleFileExtensions: ["js", "jsx", "ts", "tsx"],
testRegex: "/tests/.*\\.test\\.(jsx?|tsx?)$",
Expand Down
6 changes: 5 additions & 1 deletion packages/online-editor/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ module.exports = {
tsconfig: "<rootDir>/tsconfig.json",
},
},
reporters: ["default", ["jest-junit", { outputFile: "./dist-tests/junit-report.xml" }]],
reporters: [
"default",
"buildkite-test-collector/jest/reporter",
["jest-junit", { outputFile: "./dist-tests/junit-report.xml" }],
],
moduleDirectories: ["node_modules", "src"],
moduleFileExtensions: ["js", "jsx", "ts", "tsx"],
setupFilesAfterEnv: ["./tests/unit/jest.setup.ts"],
Expand Down

0 comments on commit 2cbe4cf

Please sign in to comment.