Skip to content

Commit

Permalink
tests: fix headless in github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
younesStrittmatter committed Mar 5, 2025
1 parent 87b4466 commit b560bf4
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions tests/test_stimuli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import importlib
import os
import pkgutil
import platform
import sys

import pytest
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit b560bf4

Please sign in to comment.