From dd348391466f1d7606eb588862979d8f75014584 Mon Sep 17 00:00:00 2001 From: coderofstuff <114628839+coderofstuff@users.noreply.github.com> Date: Sat, 8 Apr 2023 22:32:24 -0600 Subject: [PATCH] Add dockerized testing --- Dockerfile.speculos | 7 +++++++ docker-compose.yaml | 21 +++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 Dockerfile.speculos diff --git a/Dockerfile.speculos b/Dockerfile.speculos new file mode 100644 index 0000000..126b711 --- /dev/null +++ b/Dockerfile.speculos @@ -0,0 +1,7 @@ +FROM speculos:latest + +COPY ./tests/requirements.txt /tmp/requirements.txt + +RUN apt update +RUN apt install build-essential -y +RUN pip install --extra-index-url https://test.pypi.org/simple/ -r /tmp/requirements.txt diff --git a/docker-compose.yaml b/docker-compose.yaml index 1beaaf0..3e3462b 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -18,3 +18,24 @@ services: - "41000:41000" - "1234:1234" - "5000:5000" + + # functional test + ftest: + container_name: ledger-functional-tests + build: + context: . + dockerfile: Dockerfile.speculos + volumes: + - ./bin:/speculos/app + - ./:/tmp/kaspa + entrypoint: bash + command: -c "cd /tmp/kaspa/tests && pytest --tb=short --device ${TEST_DEVICE}" + + # unit tests + utest: + container_name: ledger-unit-tests + image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest + entrypoint: bash + command: -c "cd /app/unit-tests && cmake -Bbuild -H. && make -C build && CTEST_OUTPUT_ON_FAILURE=1 make -C build test" + volumes: + - .:/app \ No newline at end of file