fix ci for infinite recursion case

This commit is contained in:
Jörg Thalheim 2023-12-16 11:17:40 +01:00
parent 4d97e5a386
commit b4f7eb3c77
3 changed files with 13 additions and 1 deletions

View file

@ -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

4
pyproject.toml Normal file
View file

@ -0,0 +1,4 @@
[tool.pytest.ini_options]
markers = [
"infiniterecursion: mark test as infinite recursion",
]

View file

@ -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 = [