Skip to content

Commit

Permalink
update tests, result ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
brentru committed Dec 27, 2024
1 parent aa9a73f commit 8c073a3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ name: WipperSnapper Tests
on:
pull_request:

permissions:
checks: write
pull-requests: write

jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -25,7 +29,6 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: '3.13'
cache: 'pip'

- name: Install Python dependencies
run: |
Expand All @@ -39,7 +42,7 @@ jobs:
run: curl -L https://wokwi.com/ci/install.sh | sh

- name: Test on Wokwi
run: pytest ${{ matrix.test }}.py --junitxml=report.xml
run: pytest tests/${{ matrix.test }}.py --junitxml=report.xml -v
env:
WOKWI_CLI_TOKEN: ${{ secrets.WOKWI_CLI_TOKEN }}

Expand All @@ -48,4 +51,4 @@ jobs:
if: always()
with:
files: |
test-results/**/*.xml
/home/runner/work/Adafruit_Wippersnapper_Arduino/Adafruit_Wippersnapper_Arduino/report.xml
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,7 @@ tests/__pycache__/

# These sometimes contain credentials, don't commit them!
src/Wippersnapper_demo_wokwi.ino
data/
data/

# Test results
report.xml
8 changes: 4 additions & 4 deletions tests/test_offline.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ def run_wokwi_cli(binary, timeout, scenario, diagram):
return result

def test_invalid_json():
result = run_wokwi_cli(f"bin/offline/firmware.elf", "120000", f"scenarios/offline/test-invalid-json.scenario.yaml", f"diagrams/offline.json")
result = run_wokwi_cli(f"tests/bin/offline/firmware.elf", "120000", f"tests/scenarios/offline/test-invalid-json.scenario.yaml", f"tests/diagrams/offline.json")
assert result.returncode == 0


def test_analog_input():
result = run_wokwi_cli(f"bin/offline/firmware.elf", "120000", f"scenarios/offline/test-log-analogin.scenario.yaml", f"diagrams/offline.json")
result = run_wokwi_cli(f"tests/bin/offline/firmware.elf", "120000", f"tests/scenarios/offline/test-log-analogin.scenario.yaml", f"tests/diagrams/offline.json")
assert result.returncode == 0


def test_digital_input():
result = run_wokwi_cli(f"bin/offline/firmware.elf", "120000", f"scenarios/offline/test-log-digital-in.scenario.yaml", f"diagrams/offline.json")
result = run_wokwi_cli(f"tests/bin/offline/firmware.elf", "120000", f"tests/scenarios/offline/test-log-digital-in.scenario.yaml", f"tests/diagrams/offline.json")
assert result.returncode == 0

def test_ds18b20():
result = run_wokwi_cli(f"bin/offline/firmware.elf", "120000", f"scenarios/offline/test-log-ds18b20.scenario.yaml", f"diagrams/offline.json")
result = run_wokwi_cli(f"tests/bin/offline/firmware.elf", "120000", f"tests/scenarios/offline/test-log-ds18b20.scenario.yaml", f"tests/diagrams/offline.json")
assert result.returncode == 0

0 comments on commit 8c073a3

Please sign in to comment.