Skip to content

Commit

Permalink
Tests: run the basic tests with pytest in the Makefile and the CI
Browse files Browse the repository at this point in the history
  • Loading branch information
spalmer25 committed Dec 22, 2023
1 parent 41af8de commit 4389ddc
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,27 @@ jobs:
./tests/integration/run_test_local.sh -F -m ${{ matrix.device }} \
./tests/integration/${{ matrix.device }}
else
./tests/integration/run_test_local.sh -F -m ${{ matrix.device }} \
./tests/integration/nano ./tests/integration/nano/${{ matrix.device }}
TMP_DIR=$(mktemp -d /tmp/foo-XXXXXX)
tar xfz app_${{ matrix.device }}_dbg.tgz -C $TMP_DIR
pytest -n 32 tests/integration/nano/ --tb=no \
--device ${{ matrix.device }} --app_path $TMP_DIR/app.elf \
--log-dir integration_tests_log
fi
- name: Upload results
- name: Upload Stax results
uses: actions/upload-artifact@v3
if: always()
if: always() && matrix.device == 'stax'
with:
name: integration_tests_${{ matrix.device }}.json
path: ./integration_tests.json

- name: Upload Nano results
uses: actions/upload-artifact@v3
if: always() && matrix.device != 'stax'
with:
name: integration_tests_log_${{ matrix.device }}
path: ./integration_tests_log

generate_samples_unit_tests:
needs: [build_docker_tezos_ocaml]
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
/app/src/glyphs.h
/app_*.tgz
/integration_tests.json
/integration_tests_log
/pattern_registry
/tests/samples

Expand Down
12 changes: 9 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,18 @@ integration_tests_basic_stax: app_stax.tgz \
tests/integration/stax/*
$(RUN_TEST_DOCKER) stax tests/integration/stax

integration_tests_basic_%: app_%.tgz \
app_%_dbg.tgz \
integration_tests_basic_%: app_%_dbg.tgz \
tests/integration/* \
tests/integration/nano/* \
tests/integration/nano/%/*
$(RUN_TEST_DOCKER) $* tests/integration/nano tests/integration/nano/$*
docker run --user "$$(id -u)":"$$(id -g)" --rm -i -v "$(realpath .):/app" \
--entrypoint=/bin/sh ledger-app-tezos-integration-tests -c " \
TMP_DIR=\$$(mktemp -d /tmp/foo-XXXXXX); \
cd /app; \
tar xfz app_$*_dbg.tgz -C \$$TMP_DIR; \
pytest -n 32 tests/integration/nano/ --tb=no \
--device $* --app_path \$$TMP_DIR/app.elf \
--log-dir integration_tests_log"

integration_tests_basic: integration_tests_basic_nanos \
integration_tests_basic_nanosp \
Expand Down

0 comments on commit 4389ddc

Please sign in to comment.