From b4f7eb3c77bd53a3411fbe4084d70c47538e3260 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Sat, 16 Dec 2023 11:17:40 +0100 Subject: [PATCH] fix ci for infinite recursion case --- .github/workflows/nix-github-actions.yml | 8 +++++++- pyproject.toml | 4 ++++ tests/test_eval.py | 2 ++ 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 pyproject.toml diff --git a/.github/workflows/nix-github-actions.yml b/.github/workflows/nix-github-actions.yml index 241dfa1..313274a 100644 --- a/.github/workflows/nix-github-actions.yml +++ b/.github/workflows/nix-github-actions.yml @@ -49,7 +49,13 @@ jobs: - name: Build run: nix develop -c bash -c 'meson setup -Db_sanitize=address,undefined build && ninja -C build' - name: Run tests - run: nix develop -c pytest ./tests + run: nix develop -c pytest ./tests -m 'not infiniterecursion' + + # address sanitizer will lead to out-of-memory in the infinite recursion case + - name: Build without sanitizer + run: nix develop -c bash -c 'rm -rf build && meson setup build && ninja -C build' + - name: Run tests + run: nix develop -c pytest ./tests -m 'infiniterecursion' collect: runs-on: ubuntu-latest diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..0b0d0d1 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,4 @@ +[tool.pytest.ini_options] +markers = [ + "infiniterecursion: mark test as infinite recursion", +] diff --git a/tests/test_eval.py b/tests/test_eval.py index 2bc60df..93a17ac 100644 --- a/tests/test_eval.py +++ b/tests/test_eval.py @@ -2,6 +2,7 @@ import json import subprocess +import pytest from pathlib import Path from tempfile import TemporaryDirectory from typing import Any, Dict, List @@ -94,6 +95,7 @@ def test_eval_error() -> None: assert "this is an evaluation error" in attrs["error"] +@pytest.mark.infiniterecursion def test_recursion_error() -> None: with TemporaryDirectory() as tempdir: cmd = [