From db12fefb9b3d0193325636f6677cbb2d46984816 Mon Sep 17 00:00:00 2001 From: Raoul Schaffranek Date: Tue, 27 May 2025 10:30:23 +0200 Subject: [PATCH 1/6] Added test workflow file --- .github/workflows/test.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..07c41dc --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,31 @@ +name: Run Pytest with uv + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.10' + + - name: Install uv + run: | + curl -LsSf https://astral.sh/uv/install.sh | sh + echo "$HOME/.cargo/bin" >> $GITHUB_PATH + + - name: Install dependencies with uv + run: uv pip install + + - name: Run tests with uv + run: uv run pytest From 6b63a863b5df914b61d5a1035717d2d9c6131aed Mon Sep 17 00:00:00 2001 From: Raoul Schaffranek Date: Thu, 29 May 2025 16:08:56 +0200 Subject: [PATCH 2/6] Change workflow trigger --- .github/workflows/test.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 07c41dc..7df56b6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,9 +2,10 @@ name: Run Pytest with uv on: push: - branches: [ main ] + branches: [ master ] pull_request: - branches: [ main ] + branches: [ master ] + workflow_dispatch: jobs: test: From 8d547eefcf93177a97fd34aaec9b868ea6bb2b5b Mon Sep 17 00:00:00 2001 From: Raoul Schaffranek Date: Thu, 29 May 2025 16:22:58 +0200 Subject: [PATCH 3/6] Use uv sync --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7df56b6..5e19405 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,7 +26,7 @@ jobs: echo "$HOME/.cargo/bin" >> $GITHUB_PATH - name: Install dependencies with uv - run: uv pip install + run: uv sync - name: Run tests with uv run: uv run pytest From d6536389a2f51aefde3259023adf97eb77e44f53 Mon Sep 17 00:00:00 2001 From: Raoul Schaffranek Date: Thu, 29 May 2025 16:26:26 +0200 Subject: [PATCH 4/6] Mark solc integration tests as expected to fail --- tests/test_solc.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_solc.py b/tests/test_solc.py index 7aca091..d2fa054 100644 --- a/tests/test_solc.py +++ b/tests/test_solc.py @@ -19,6 +19,7 @@ def get_nested(d, keys, default=None): break return d +@pytest.xfail(reason="This test is expected to fail because the solc output does not adhere to the ethdebug format.") @pytest.mark.parametrize("output_file", output_files) def test_info(output_file: Path): with open(output_file, 'r') as f: @@ -27,6 +28,7 @@ def test_info(output_file: Path): model = Info.model_validate(ethdebug_data) assert model is not None, "Model validation returned None" +@pytest.xfail(reason="This test is expected to fail because the solc output does not adhere to the ethdebug format.") @pytest.mark.parametrize("output_file", output_files) def test_program(output_file: Path): with open(output_file, 'r') as f: From ff00a91b402fc05f9cb3d7a3b2a746898ba10bc8 Mon Sep 17 00:00:00 2001 From: Raoul Schaffranek Date: Thu, 29 May 2025 16:55:19 +0200 Subject: [PATCH 5/6] Specify tests-folder --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5e19405..5de778f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,4 +29,4 @@ jobs: run: uv sync - name: Run tests with uv - run: uv run pytest + run: uv run pytest tests From 8890d0fb11e5ff868ab3d605a5e6d06f16707677 Mon Sep 17 00:00:00 2001 From: Raoul Schaffranek Date: Thu, 29 May 2025 16:58:31 +0200 Subject: [PATCH 6/6] Fix xfail syntax --- tests/test_solc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_solc.py b/tests/test_solc.py index d2fa054..837deb6 100644 --- a/tests/test_solc.py +++ b/tests/test_solc.py @@ -19,7 +19,7 @@ def get_nested(d, keys, default=None): break return d -@pytest.xfail(reason="This test is expected to fail because the solc output does not adhere to the ethdebug format.") +@pytest.mark.xfail(reason="This test is expected to fail because the solc output does not adhere to the ethdebug format.") @pytest.mark.parametrize("output_file", output_files) def test_info(output_file: Path): with open(output_file, 'r') as f: @@ -28,7 +28,7 @@ def test_info(output_file: Path): model = Info.model_validate(ethdebug_data) assert model is not None, "Model validation returned None" -@pytest.xfail(reason="This test is expected to fail because the solc output does not adhere to the ethdebug format.") +@pytest.mark.xfail(reason="This test is expected to fail because the solc output does not adhere to the ethdebug format.") @pytest.mark.parametrize("output_file", output_files) def test_program(output_file: Path): with open(output_file, 'r') as f: