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 - name: Build
run: nix develop -c bash -c 'meson setup -Db_sanitize=address,undefined build && ninja -C build' run: nix develop -c bash -c 'meson setup -Db_sanitize=address,undefined build && ninja -C build'
- name: Run tests - 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: collect:
runs-on: ubuntu-latest 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 json
import subprocess import subprocess
import pytest
from pathlib import Path from pathlib import Path
from tempfile import TemporaryDirectory from tempfile import TemporaryDirectory
from typing import Any, Dict, List from typing import Any, Dict, List
@ -94,6 +95,7 @@ def test_eval_error() -> None:
assert "this is an evaluation error" in attrs["error"] assert "this is an evaluation error" in attrs["error"]
@pytest.mark.infiniterecursion
def test_recursion_error() -> None: def test_recursion_error() -> None:
with TemporaryDirectory() as tempdir: with TemporaryDirectory() as tempdir:
cmd = [ cmd = [