Skip to content

Commit

Permalink
test: crypto test
Browse files Browse the repository at this point in the history
  • Loading branch information
urish committed Jun 11, 2024
1 parent 6b2a255 commit 65d1a0a
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,27 @@ jobs:
run: pytest test_psram.py
env:
WOKWI_CLI_TOKEN: ${{ secrets.WOKWI_CLI_TOKEN }}

test-crypto:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
- run: pip install -r test/requirements.txt

- name: Run a Wokwi CI server
uses: wokwi/wokwi-ci-server-action@v1

- name: Install Wokwi CLI
run: curl -L https://wokwi.com/ci/install.sh | sh

- name: Test on Wokwi
working-directory: test
run: pytest test_crypto.py
env:
WOKWI_CLI_TOKEN: ${{ secrets.WOKWI_CLI_TOKEN }}
26 changes: 26 additions & 0 deletions test/test_crypto.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import subprocess

import pytest


# ESP32-P4 currently fails some of the tests, so we exclude it.
@pytest.mark.parametrize(
"chip", ["esp32", "esp32s2", "esp32s3", "esp32c3", "esp32c6", "esp32h2"]
)
def test_hello_world(chip: str):

# Run the Wokwi CLI
result = subprocess.run(
[
"wokwi-cli",
"--elf",
f"../bin/{chip}/idf/latest/components/hal/test_apps/crypto/firmware.uf2",
"--timeout",
"60000",
"--expect-text",
"Tests finished, rc=0",
"--diagram-file",
f"diagram.{chip}.json",
]
)
assert result.returncode == 0

0 comments on commit 65d1a0a

Please sign in to comment.