Skip to content

Commit c8d97f9

Browse files
mergify[bot]arirubinstein
authored andcommitted
ci: coverage
2 parents ab2efa6 + 5ed983e commit c8d97f9

File tree

5 files changed

+89
-5
lines changed

5 files changed

+89
-5
lines changed

.github/workflows/test-all-packages.yml

+42-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ env:
1616
DATADOG_SITE: us3.datadoghq.com
1717
DATADOG_API_KEY: ${{ secrets.DATADOG_API_KEY }}
1818
TEST_COLLECT: 'tee -a _testoutput.txt'
19-
19+
NODE_V8_COVERAGE: codecov_reports
2020
# this is required, since explicitly setting bash as shell enables pipefail, which is not
2121
# on by default. This is required to fail correctly when teeing output to a file to collect
2222
# test instrumentation
@@ -149,6 +149,10 @@ jobs:
149149
if [ "$DATADOG_API_KEY" != "" ]; then
150150
./scripts/ci-collect-testruns.sh && npx @datadog/datadog-ci junit upload --service agoric-sdk ./packages/*/junit.xml
151151
fi
152+
- name: Upload coverage reports to Codecov
153+
if: success() || failure()
154+
uses: codecov/codecov-action@v3
155+
152156

153157
test-quick2:
154158
# BEGIN-TEST-BOILERPLATE
@@ -248,6 +252,9 @@ jobs:
248252
if [ "$DATADOG_API_KEY" != "" ]; then
249253
./scripts/ci-collect-testruns.sh && npx @datadog/datadog-ci junit upload --service agoric-sdk ./packages/*/junit.xml
250254
fi
255+
- name: Upload coverage reports to Codecov
256+
if: success() || failure()
257+
uses: codecov/codecov-action@v3
251258

252259
test-cosmic-swingset:
253260
# BEGIN-TEST-BOILERPLATE
@@ -280,6 +287,9 @@ jobs:
280287
if [ "$DATADOG_API_KEY" != "" ]; then
281288
./scripts/ci-collect-testruns.sh && npx @datadog/datadog-ci junit upload --service agoric-sdk ./packages/*/junit.xml
282289
fi
290+
- name: Upload coverage reports to Codecov
291+
if: success() || failure()
292+
uses: codecov/codecov-action@v3
283293

284294
# The test-swingset* tests are split by alphabetical test name.
285295
test-swingset:
@@ -310,6 +320,9 @@ jobs:
310320
if [ "$DATADOG_API_KEY" != "" ]; then
311321
./scripts/ci-collect-testruns.sh && npx @datadog/datadog-ci junit upload --service agoric-sdk ./packages/*/junit.xml
312322
fi
323+
- name: Upload coverage reports to Codecov
324+
if: success() || failure()
325+
uses: codecov/codecov-action@v3
313326

314327
test-swingset2:
315328
# BEGIN-TEST-BOILERPLATE
@@ -347,6 +360,9 @@ jobs:
347360
if [ "$DATADOG_API_KEY" != "" ]; then
348361
./scripts/ci-collect-testruns.sh && npx @datadog/datadog-ci junit upload --service agoric-sdk ./packages/*/junit.xml
349362
fi
363+
- name: Upload coverage reports to Codecov
364+
if: success() || failure()
365+
uses: codecov/codecov-action@v3
350366

351367
test-swingset3:
352368
# BEGIN-TEST-BOILERPLATE
@@ -375,6 +391,9 @@ jobs:
375391
if [ "$DATADOG_API_KEY" != "" ]; then
376392
./scripts/ci-collect-testruns.sh && npx @datadog/datadog-ci junit upload --service agoric-sdk ./packages/*/junit.xml
377393
fi
394+
- name: Upload coverage reports to Codecov
395+
if: success() || failure()
396+
uses: codecov/codecov-action@v3
378397

379398
test-swingset4:
380399
# BEGIN-TEST-BOILERPLATE
@@ -404,6 +423,9 @@ jobs:
404423
if [ "$DATADOG_API_KEY" != "" ]; then
405424
./scripts/ci-collect-testruns.sh && npx @datadog/datadog-ci junit upload --service agoric-sdk ./packages/*/junit.xml
406425
fi
426+
- name: Upload coverage reports to Codecov
427+
if: success() || failure()
428+
uses: codecov/codecov-action@v3
407429

408430
test-zoe-unit:
409431
# BEGIN-TEST-BOILERPLATE
@@ -435,6 +457,9 @@ jobs:
435457
if [ "$DATADOG_API_KEY" != "" ]; then
436458
./scripts/ci-collect-testruns.sh && npx @datadog/datadog-ci junit upload --service agoric-sdk ./packages/*/junit.xml
437459
fi
460+
- name: Upload coverage reports to Codecov
461+
if: success() || failure()
462+
uses: codecov/codecov-action@v3
438463

439464
test-zoe-swingset:
440465
# BEGIN-TEST-BOILERPLATE
@@ -466,3 +491,19 @@ jobs:
466491
if [ "$DATADOG_API_KEY" != "" ]; then
467492
./scripts/ci-collect-testruns.sh && npx @datadog/datadog-ci junit upload --service agoric-sdk ./packages/*/junit.xml
468493
fi
494+
- name: Upload coverage reports to Codecov
495+
if: success() || failure()
496+
uses: codecov/codecov-action@v3
497+
498+
test-docker-build:
499+
runs-on: ubuntu-latest
500+
steps:
501+
- uses: actions/checkout@v3
502+
- name: docker build (sdk)
503+
run: cd packages/deployment && ./scripts/test-docker-build.sh | $TEST_COLLECT
504+
- name: Report tests
505+
if: success() || failure()
506+
run: |
507+
if [ "$DATADOG_API_KEY" != "" ]; then
508+
./scripts/ci-collect-testruns.sh && npx @datadog/datadog-ci junit upload --service agoric-sdk ./packages/*/junit.xml
509+
fi

packages/deployment/Dockerfile.sdk

+2
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ RUN ln -s /data /agoric
9090
RUN ln -s /data/solo /usr/src/agoric-sdk/packages/cosmic-swingset/solo
9191
RUN ln -s /data/chains /usr/src/agoric-sdk/packages/cosmic-swingset/chains
9292

93+
RUN /usr/src/agoric-sdk/packages/deployment/scripts/smoketest-binaries.sh
94+
9395
# By default, run the daemon with specified arguments.
9496
WORKDIR /root
9597
EXPOSE 1317 9090 26657
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
# For use inside of an environment (e.g. docker) to validate path of expected binaries work, and the binaries exit cleanly as well
4+
5+
binaries=( "agd version" "agoric -V" "ag-chain-cosmos version" )
6+
for binary in "${binaries[@]}"; do
7+
echo "Checking $binary a"
8+
$binary
9+
ec=$?
10+
if [[ $ec -ne 0 ]]; then
11+
echo "Command: $binary failed with code $ec"
12+
exit 1
13+
fi
14+
done
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
3+
4+
5+
start=$((${EPOCHREALTIME/./} / 1000))
6+
output=$(docker build --progress=plain --output type=tar,dest=/dev/null -f ./Dockerfile.sdk ../../ 2>&1 )
7+
ec=$?
8+
sleep 1
9+
end=$((${EPOCHREALTIME/./} / 1000))
10+
dur=$((end-start))
11+
12+
echo "TAP version 13"
13+
echo "1..1"
14+
if [[ $ec -ne 0 ]]; then
15+
fail=1
16+
echo "not ok 1 - Docker Build %ava-dur=${dur}ms"
17+
echo "$output"
18+
else
19+
pass=1
20+
echo "ok 1 - Docker Build %ava-dur=${dur}ms"
21+
fi
22+
echo "# tests 1"
23+
echo "# pass ${pass:-0}"
24+
echo "# fail ${fail:-0}"

scripts/ci-collect-testruns.sh

+7-4
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ SCRIPT_DIR=$( cd ${0%/*} && pwd -P )
44

55
for pkg in ./packages/*/_testoutput.txt
66
do
7-
echo "processing $pkg"
8-
junit=$(dirname "$pkg")/junit.xml
9-
echo "dest $junit"
10-
$SCRIPT_DIR/ava-etap-to-junit.mjs $pkg > $junit
7+
# skip if unable to expand if there are no test files
8+
if [[ $pkg != "./packages/*/_testoutput.txt" ]]; then
9+
echo "processing $pkg"
10+
junit=$(dirname "$pkg")/junit.xml
11+
echo "dest $junit"
12+
$SCRIPT_DIR/ava-etap-to-junit.mjs $pkg > $junit
13+
fi
1114
done

0 commit comments

Comments
 (0)