Skip to content

Commit

Permalink
Run CI unit tests in a docker container
Browse files Browse the repository at this point in the history
To keep all firmware unit tests consistent, we now only run
them inside the mware docker container in the CI workflow.

run-all.sh scripts, on the other side, do not make that assumption.
This keeps every test consistent so that we don't need to guess
which ones internally start a docker container and which ones just
run in the host machine.
  • Loading branch information
italo-sampaio committed Nov 25, 2024
1 parent 39b9a8b commit 560dd16
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,28 +24,28 @@ jobs:
run: firmware/test/test-all

- name: Firmware HAL's common unit tests
run: firmware/src/hal/common/test/run-all.sh
run: docker/mware/do-notty-nousb /hsm2 firmware/src/hal/common/test/run-all.sh

- name: Firmware HAL's x86 unit tests
run: firmware/src/hal/x86/test/run-all.sh
run: docker/mware/do-notty-nousb /hsm2 firmware/src/hal/x86/test/run-all.sh

- name: Firmware HAL's SGX unit tests
run: firmware/src/hal/sgx/test/run-all.sh
run: docker/mware/do-notty-nousb /hsm2 firmware/src/hal/sgx/test/run-all.sh

- name: Firmware common lib unit tests
run: firmware/src/common/test/run-all.sh
run: docker/mware/do-notty-nousb /hsm2 firmware/src/common/test/run-all.sh

- name: Firmware PowHSM's unit tests
run: firmware/src/powhsm/test/run-all.sh
run: docker/mware/do-notty-nousb /hsm2 firmware/src/powhsm/test/run-all.sh

- name: Firmware SGX's unit tests
run: firmware/src/sgx/test/run-all.sh
run: docker/mware/do-notty-nousb /hsm2 firmware/src/sgx/test/run-all.sh

- name: Ledger UI's unit tests
run: firmware/src/ledger/ui/test/run-all.sh
run: docker/mware/do-notty-nousb /hsm2 firmware/src/ledger/ui/test/run-all.sh

- name: Ledger Signer's unit tests
run: firmware/src/ledger/signer/test/run-all.sh
run: docker/mware/do-notty-nousb /hsm2 firmware/src/ledger/signer/test/run-all.sh

run-integration-tests-tcpsigner:
name: Integration tests for TCPSigner
Expand Down
7 changes: 4 additions & 3 deletions firmware/src/hal/sgx/test/run-all.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#!/bin/bash
ROOTDIR=$(dirname $0)/../../../../..
TESTDIR=$(realpath $(dirname $0) --relative-to $ROOTDIR)
BASEDIR=$(dirname $0)
TESTDIRS="nvmem secret_store seed"
TESTDIRS=${1:-"$TESTDIRS"}

for d in $TESTDIRS; do
echo "******************************"
echo "Testing $d..."
echo "******************************"
$ROOTDIR/docker/mware/do-notty-nousb /hsm2/$TESTDIR/$d "make clean test" || exit $?
cd "$BASEDIR/$d"
make clean test || exit $?
cd - > /dev/null
done
7 changes: 4 additions & 3 deletions firmware/src/hal/x86/test/run-all.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#!/bin/bash
ROOTDIR=$(dirname $0)/../../../../..
TESTDIR=$(realpath $(dirname $0) --relative-to $ROOTDIR)
BASEDIR=$(dirname $0)
TESTDIRS="bip32 endian hmac_sha256 hmac_sha512 keccak256"
TESTDIRS=${1:-"$TESTDIRS"}

for d in $TESTDIRS; do
echo "******************************"
echo "Testing $d..."
echo "******************************"
$ROOTDIR/docker/mware/do-notty-nousb /hsm2/$TESTDIR/$d "make clean test" || exit $?
cd "$BASEDIR/$d"
make clean test || exit $?
cd - > /dev/null
done

0 comments on commit 560dd16

Please sign in to comment.