Skip to content

Commit

Permalink
Merge pull request #401 from openzim/skip_youtube_test
Browse files Browse the repository at this point in the history
Add logic to skip Youtube test on-demand
  • Loading branch information
benoit74 authored Sep 27, 2024
2 parents 5fe6539 + b056c6d commit f17e152
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/DailyTests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ jobs:
path: output/tests_eng_test-website.zim
retention-days: 30

- name: build selenium test image
run: docker build -t local-selenium tests-daily
- name: build tests-daily Docker image
run: docker build -t local-tests-daily tests-daily

- name: run integration test suite
run: docker run -v $PWD/tests-daily/daily.py:/app/daily.py -v $PWD/output:/output local-selenium bash -c "cd /app && pytest -h && pytest -v --log-level=INFO --log-format='%(levelname)s - %(message)s' daily.py"
run: docker run -e SKIP_YOUTUBE_TEST="True" -v $PWD/tests-daily/daily.py:/app/daily.py -v $PWD/output:/output local-tests-daily bash -c "cd /app && pytest -v --log-level=INFO --log-format='%(levelname)s - %(message)s' daily.py"
4 changes: 4 additions & 0 deletions tests-daily/daily.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import logging
import os
import subprocess
from time import sleep

Expand All @@ -15,6 +16,8 @@
ZIM_NAME = "tests_eng_test-website"
YOUTUBE_VIDEO_PATH = "youtube.fuzzy.replayweb.page/embed/g5skcrNXdDM"

SKIP_YOUTUBE_TEST = os.getenv("SKIP_YOUTUBE_TEST", "False").lower() == "true"

CHECK_VIDEO_IS_PLAYING_AFTER_SECS = 30

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -79,6 +82,7 @@ def kiwix_serve():
process.terminate()


@pytest.mark.skipif(SKIP_YOUTUBE_TEST, reason="Youtube test disabled by environment")
def test_youtube_video(chrome_driver, kiwix_serve): # noqa: ARG001
"""Test that youtube video loads, and still plays after a while"""

Expand Down

0 comments on commit f17e152

Please sign in to comment.