Skip to content

Commit 59ca202

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

File tree

5 files changed

+92
-5
lines changed

5 files changed

+92
-5
lines changed

Diff for: .github/workflows/test-all-packages.yml

+45-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: coverage
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,9 @@ 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
152155

153156
test-quick2:
154157
# BEGIN-TEST-BOILERPLATE
@@ -216,6 +219,10 @@ jobs:
216219
if [ "$DATADOG_API_KEY" != "" ]; then
217220
./scripts/ci-collect-testruns.sh && npx @datadog/datadog-ci junit upload --service agoric-sdk ./packages/*/junit.xml
218221
fi
222+
- name: Upload coverage reports to Codecov
223+
if: success() || failure()
224+
uses: codecov/codecov-action@v3
225+
219226

220227
##############
221228
# Long-running tests are executed individually.
@@ -248,6 +255,9 @@ jobs:
248255
if [ "$DATADOG_API_KEY" != "" ]; then
249256
./scripts/ci-collect-testruns.sh && npx @datadog/datadog-ci junit upload --service agoric-sdk ./packages/*/junit.xml
250257
fi
258+
- name: Upload coverage reports to Codecov
259+
if: success() || failure()
260+
uses: codecov/codecov-action@v3
251261

252262
test-cosmic-swingset:
253263
# BEGIN-TEST-BOILERPLATE
@@ -280,6 +290,9 @@ jobs:
280290
if [ "$DATADOG_API_KEY" != "" ]; then
281291
./scripts/ci-collect-testruns.sh && npx @datadog/datadog-ci junit upload --service agoric-sdk ./packages/*/junit.xml
282292
fi
293+
- name: Upload coverage reports to Codecov
294+
if: success() || failure()
295+
uses: codecov/codecov-action@v3
283296

284297
# The test-swingset* tests are split by alphabetical test name.
285298
test-swingset:
@@ -310,6 +323,9 @@ jobs:
310323
if [ "$DATADOG_API_KEY" != "" ]; then
311324
./scripts/ci-collect-testruns.sh && npx @datadog/datadog-ci junit upload --service agoric-sdk ./packages/*/junit.xml
312325
fi
326+
- name: Upload coverage reports to Codecov
327+
if: success() || failure()
328+
uses: codecov/codecov-action@v3
313329

314330
test-swingset2:
315331
# BEGIN-TEST-BOILERPLATE
@@ -347,6 +363,9 @@ jobs:
347363
if [ "$DATADOG_API_KEY" != "" ]; then
348364
./scripts/ci-collect-testruns.sh && npx @datadog/datadog-ci junit upload --service agoric-sdk ./packages/*/junit.xml
349365
fi
366+
- name: Upload coverage reports to Codecov
367+
if: success() || failure()
368+
uses: codecov/codecov-action@v3
350369

351370
test-swingset3:
352371
# BEGIN-TEST-BOILERPLATE
@@ -375,6 +394,9 @@ jobs:
375394
if [ "$DATADOG_API_KEY" != "" ]; then
376395
./scripts/ci-collect-testruns.sh && npx @datadog/datadog-ci junit upload --service agoric-sdk ./packages/*/junit.xml
377396
fi
397+
- name: Upload coverage reports to Codecov
398+
if: success() || failure()
399+
uses: codecov/codecov-action@v3
378400

379401
test-swingset4:
380402
# BEGIN-TEST-BOILERPLATE
@@ -404,6 +426,9 @@ jobs:
404426
if [ "$DATADOG_API_KEY" != "" ]; then
405427
./scripts/ci-collect-testruns.sh && npx @datadog/datadog-ci junit upload --service agoric-sdk ./packages/*/junit.xml
406428
fi
429+
- name: Upload coverage reports to Codecov
430+
if: success() || failure()
431+
uses: codecov/codecov-action@v3
407432

408433
test-zoe-unit:
409434
# BEGIN-TEST-BOILERPLATE
@@ -435,6 +460,9 @@ jobs:
435460
if [ "$DATADOG_API_KEY" != "" ]; then
436461
./scripts/ci-collect-testruns.sh && npx @datadog/datadog-ci junit upload --service agoric-sdk ./packages/*/junit.xml
437462
fi
463+
- name: Upload coverage reports to Codecov
464+
if: success() || failure()
465+
uses: codecov/codecov-action@v3
438466

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

Diff for: 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

Diff for: packages/deployment/scripts/smoketest-binaries.sh

+14
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

Diff for: packages/deployment/scripts/test-docker-build.sh

+24
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}"

Diff for: 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)