Skip to content

Commit ee9fcb3

Browse files
authored
#4605 Export test result to semaphoreci (#5045)
* (WIP) implement ava reporter * feat: added semaphoreci test result export feature * trigger failing test * fix: revert failing checking trigger * feat: export unit test result too
1 parent 29e2ac9 commit ee9fcb3

File tree

4 files changed

+181
-25
lines changed

4 files changed

+181
-25
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ npm-debug.log
2121
/rt.sh
2222
/grt.sh
2323
tooling/release.json
24+
report.xml

.semaphore/semaphore.yml

+15-1
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,10 @@ blocks:
4343
- name: enterprise mock - standard test group
4444
commands:
4545
- npm run-script test_ci_chrome_enterprise
46-
- cd ./build && zip -r ~/chrome-enterprise.zip ./chrome-enterprise/* && cd ~
4746
epilogue:
47+
always:
48+
commands:
49+
- '[[ -f report.xml ]] && test-results publish report.xml'
4850
on_fail:
4951
commands:
5052
- |
@@ -79,6 +81,9 @@ blocks:
7981
commands:
8082
- npm run-script test_ci_chrome_consumer_live_gmail
8183
epilogue:
84+
always:
85+
commands:
86+
- '[[ -f report.xml ]] && test-results publish report.xml'
8287
on_fail:
8388
commands:
8489
- |
@@ -122,6 +127,15 @@ blocks:
122127
- name: consumer mock - unit tests
123128
commands:
124129
- npm run-script test_local_unit_consumer
130+
- '[[ -f report.xml ]] && test-results publish report.xml'
125131
- name: enterprise mock - unit tests
126132
commands:
127133
- npm run-script test_local_unit_enterprise
134+
- '[[ -f report.xml ]] && test-results publish report.xml'
135+
136+
after_pipeline:
137+
task:
138+
jobs:
139+
- name: Publish Results
140+
commands:
141+
- test-results gen-pipeline-report

package-lock.json

+156-16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+9-8
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
"postcss-html": "^1.5.0",
5757
"squire-rte": "1.11.3",
5858
"sweetalert2": "11.7.3",
59+
"tap-xunit": "^2.4.1",
5960
"zxcvbn": "4.4.2"
6061
},
6162
"scripts": {
@@ -70,19 +71,19 @@
7071
"test_local_chrome_enterprise_mock": "npm run pretest && npm run test_ci_chrome_enterprise -- -- --pool-size=1 --debug",
7172
"test_local_chrome_consumer_live_gmail": "npm run pretest && npm run test_ci_chrome_consumer_live_gmail -- -- --pool-size=1 --debug",
7273
"test_local_chrome_consumer_mock_flaky": "npm run pretest && npm run test_ci_chrome_consumer_flaky -- -- --pool-size=1 --retry=false --debug",
73-
"test_local_unit_consumer": "npm run pretest && npx ava --timeout=20m --verbose --concurrency=10 build/test/test/source/test.js -- UNIT-TESTS --retry=false --debug CONSUMER-MOCK",
74-
"test_local_unit_enterprise": "npm run pretest && npx ava --timeout=20m --verbose --concurrency=10 build/test/test/source/test.js -- UNIT-TESTS --retry=false --pool-size=1 --debug ENTERPRISE-MOCK",
74+
"test_local_unit_consumer": "npm run pretest && npx ava --timeout=20m --verbose --tap --concurrency=10 build/test/test/source/test.js -- UNIT-TESTS --retry=false --debug CONSUMER-MOCK | npx tap-xunit > report.xml",
75+
"test_local_unit_enterprise": "npm run pretest && npx ava --timeout=20m --verbose --tap --concurrency=10 build/test/test/source/test.js -- UNIT-TESTS --retry=false --pool-size=1 --debug ENTERPRISE-MOCK | npx tap-xunit > report.xml",
7576
"test_local_chrome_consumer_mock_headless": "xvfb-run npm run test_local_chrome_consumer_mock",
7677
"test_stylelint": "stylelint extension/css/cryptup.css extension/css/settings.css extension/css/webmail.css && stylelint extension/**/*.htm --custom-syntax postcss-html",
7778
"test_eslint": "eslint --ext ts extension test tooling",
7879
"test_patterns": "node build/test/test/source/patterns.js",
7980
"test_async_stack": "node build/test/test/source/async-stack.js",
8081
"test_buf": "npx ava --timeout=3m --verbose --concurrency=10 build/test/test/source/buf.js",
81-
"test_ci_chrome_consumer_live_gmail": "npx ava --timeout=30m --verbose --concurrency=1 build/test/test/source/test.js -- CONSUMER-LIVE-GMAIL STANDARD-GROUP",
82-
"test_ci_chrome_consumer": "npx ava --timeout=30m --verbose --concurrency=10 build/test/test/source/test.js -- CONSUMER-MOCK STANDARD-GROUP",
83-
"test_ci_chrome_enterprise": "npx ava --timeout=30m --verbose --concurrency=10 build/test/test/source/test.js -- ENTERPRISE-MOCK STANDARD-GROUP",
84-
"test_ci_chrome_consumer_flaky": "npx ava --timeout=30m --verbose --concurrency=10 build/test/test/source/test.js -- CONSUMER-MOCK FLAKY-GROUP",
85-
"test_ci_chrome_content_scripts": "npx ava --timeout=3m --verbose build/test/test/source/test.js -- CONTENT-SCRIPT-TESTS",
82+
"test_ci_chrome_consumer_live_gmail": "npx ava --timeout=30m --verbose --tap --concurrency=1 build/test/test/source/test.js -- CONSUMER-LIVE-GMAIL STANDARD-GROUP | npx tap-xunit > report.xml",
83+
"test_ci_chrome_consumer": "npx ava --timeout=30m --verbose --tap --concurrency=10 build/test/test/source/test.js -- CONSUMER-MOCK STANDARD-GROUP | npx tap-xunit > report.xml",
84+
"test_ci_chrome_enterprise": "npx ava --timeout=30m --verbose --tap --concurrency=10 build/test/test/source/test.js -- ENTERPRISE-MOCK STANDARD-GROUP | npx tap-xunit > report.xml",
85+
"test_ci_chrome_consumer_flaky": "npx ava --timeout=30m --verbose --tap --concurrency=10 build/test/test/source/test.js -- CONSUMER-MOCK FLAKY-GROUP | npx tap-xunit > report.xml",
86+
"test_ci_chrome_content_scripts": "npx ava --timeout=3m --verbose --tap build/test/test/source/test.js -- CONTENT-SCRIPT-TESTS > report.xml",
8687
"dev_start_gmail_mock_api": "./scripts/build.sh && cd ./conf && node ../build/tooling/tsc-compiler --project tsconfig.test.json && cd .. && node ./build/test/test/source/mock.js",
8788
"run_firefox": "npm run build-incremental && npx web-ext run --source-dir ./build/firefox-consumer/ --firefox-profile ~/.mozilla/firefox/flowcrypt-dev --keep-profile-changes",
8889
"run_firefox_windows": "npm run build-incremental && npx web-ext run --source-dir ./build/firefox-consumer/ --firefox-profile %userprofile%/AppData/Local/Mozilla/Firefox/Profiles/flowcrypt-dev --keep-profile-changes",
@@ -111,4 +112,4 @@
111112
"npm run test_stylelint"
112113
]
113114
}
114-
}
115+
}

0 commit comments

Comments
 (0)