From b560bf4668520d038645c4c2d6bc00e1403b3e55 Mon Sep 17 00:00:00 2001 From: Younes Strittmatter Date: Wed, 5 Mar 2025 13:15:26 -0500 Subject: [PATCH] tests: fix headless in github actions --- tests/test_stimuli.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/test_stimuli.py b/tests/test_stimuli.py index 31102cf..0957b86 100644 --- a/tests/test_stimuli.py +++ b/tests/test_stimuli.py @@ -2,6 +2,7 @@ import importlib import os import pkgutil +import platform import sys import pytest @@ -111,12 +112,15 @@ def test_compile_stimulus(stimulus_class): assert os.path.exists(html_path), f"{stimulus_class.__name__} didn't create HTML!" # 2) Run the HTML in browser - if stimulus_class.__name__ not in SKIP: - asyncio.run(run_experiment_in_browser(html_path)) + if os.getenv("CI") and platform.system() == "Linux": + print("Skipping browser test on CI Ubuntu do to limited resources on GitHub.") else: - print( - f"Skipping {stimulus_class.__name__} due to: {SKIP[stimulus_class.__name__]}" - ) + if stimulus_class.__name__ not in SKIP: + asyncio.run(run_experiment_in_browser(html_path)) + else: + print( + f"Skipping {stimulus_class.__name__} due to: {SKIP[stimulus_class.__name__]}" + ) # 3) Cleanup os.remove(html_path)