Skip to content

Commit a01a05d

Browse files
committed
AB-454: Setup coverage report and send to looker
1 parent 55f2b00 commit a01a05d

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

.github/workflows/integration.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,14 @@ jobs:
2020
- run: npm ci
2121
- run: npm run test-lint
2222
- run: npm run test-system
23-
- run: npm run test-unit
24-
23+
- run: npm run test-unit | tee coverage.txt && exit ${PIPESTATUS[0]}
24+
- name: Upload coverage-summary.json
25+
uses: actions/upload-artifact@v4
26+
with:
27+
name: coverage-summary-unit
28+
path: |
29+
.coverage/coverage-summary.json
30+
coverage.txt
2531
Regression:
2632
needs: Unit-Tests
2733
runs-on: ubuntu-latest
@@ -35,4 +41,11 @@ jobs:
3541
with:
3642
node-version: ${{ matrix.node-version }}
3743
- run: npm ci
38-
- run: npm run test-regression
44+
- run: npm run test-regression | tee coverage.txt && exit ${PIPESTATUS[0]}
45+
- name: Upload coverage-summary.json
46+
uses: actions/upload-artifact@v4
47+
with:
48+
name: coverage-summary-integration
49+
path: |
50+
.coverage/coverage-summary.json
51+
coverage.txt

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,10 @@
150150
},
151151
"scripts": {
152152
"test": "./scripts/test.sh",
153-
"test-unit": "nyc --reporter=text -x **/assets/** -x **/test/** ./node_modules/mocha/bin/mocha --timeout 90000 \"test/unit/**/**.test.js\"",
153+
"test-unit": "nyc --reporter=text --reporter=json-summary --report-dir=.coverage -x **/assets/** -x **/test/** ./node_modules/mocha/bin/mocha --timeout 90000 \"test/unit/**/**.test.js\"",
154154
"test-lint": "./scripts/test-lint.sh",
155155
"test-system": "./node_modules/mocha/bin/mocha -x **/assets/** -x **/test/** \"test/system/**.test.js\"",
156-
"test-regression": "./node_modules/mocha/bin/mocha test/integration/integration.test.js test/unit/sanity.test.js",
156+
"test-regression": "nyc --reporter=text --reporter=json-summary --report-dir=.coverage ./node_modules/mocha/bin/mocha test/integration/integration.test.js test/unit/sanity.test.js",
157157
"release": "./scripts/release.sh",
158158
"coverage": "nyc report --reporter=html --reporter=text mocha"
159159
}

0 commit comments

Comments
 (0)