Add logic to skip Youtube test on-demand

This commit is contained in:
benoit74 2024-09-26 09:31:39 +00:00
parent 5fe6539201
commit b056c6dc4f
No known key found for this signature in database
GPG Key ID: B89606434FC7B530
2 changed files with 7 additions and 3 deletions

View File

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

View File

@ -1,4 +1,5 @@
import logging
import os
import subprocess
from time import sleep
@ -15,6 +16,8 @@ KIWIX_SERVE_START_SLEEP = 1
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__)
@ -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"""