[DEV] Disable real runs in CI
This commit is contained in:
parent
88fa55c9dc
commit
a371c9cb12
11 changed files with 35 additions and 22 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import pytest
|
||||
from expected_download import assert_expected_downloads
|
||||
from expected_transaction_log import assert_transaction_log_matches
|
||||
from resources import E2E_DRY_RUN_FIXTURE_VALUE
|
||||
|
||||
from ytdl_sub.subscriptions.subscription import Subscription
|
||||
|
||||
|
|
@ -47,7 +48,7 @@ def youtube_release_preset_dict(output_directory):
|
|||
|
||||
|
||||
class TestAudioExtract:
|
||||
@pytest.mark.parametrize("dry_run", [False])
|
||||
@pytest.mark.parametrize("dry_run", E2E_DRY_RUN_FIXTURE_VALUE)
|
||||
def test_audio_extract_single_song(
|
||||
self,
|
||||
default_config,
|
||||
|
|
@ -73,7 +74,7 @@ class TestAudioExtract:
|
|||
expected_download_summary_file_name="plugins/test_audio_extract_single.json",
|
||||
)
|
||||
|
||||
@pytest.mark.parametrize("dry_run", [True, False])
|
||||
@pytest.mark.parametrize("dry_run", E2E_DRY_RUN_FIXTURE_VALUE)
|
||||
def test_audio_extract_single_song_best_format(
|
||||
self,
|
||||
default_config,
|
||||
|
|
@ -99,7 +100,7 @@ class TestAudioExtract:
|
|||
expected_download_summary_file_name=f"plugins/test_audio_extract_single_best{'_dry_run' if dry_run else ''}.json",
|
||||
)
|
||||
|
||||
@pytest.mark.parametrize("dry_run", [True, False])
|
||||
@pytest.mark.parametrize("dry_run", E2E_DRY_RUN_FIXTURE_VALUE)
|
||||
def test_audio_extract_multiple_songs(
|
||||
self,
|
||||
default_config,
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ from typing import Dict
|
|||
import pytest
|
||||
from expected_download import assert_expected_downloads
|
||||
from expected_transaction_log import assert_transaction_log_matches
|
||||
from resources import E2E_DRY_RUN_FIXTURE_VALUE
|
||||
|
||||
from ytdl_sub.subscriptions.subscription import Subscription
|
||||
|
||||
|
|
@ -54,7 +55,7 @@ def chapters_from_comments_preset_dict(sponsorblock_and_subs_preset_dict: Dict)
|
|||
|
||||
|
||||
class TestChapters:
|
||||
@pytest.mark.parametrize("dry_run", [True, False])
|
||||
@pytest.mark.parametrize("dry_run", E2E_DRY_RUN_FIXTURE_VALUE)
|
||||
def test_chapters_sponsorblock_and_removal_with_subs(
|
||||
self,
|
||||
default_config,
|
||||
|
|
@ -83,7 +84,7 @@ class TestChapters:
|
|||
],
|
||||
)
|
||||
|
||||
@pytest.mark.parametrize("dry_run", [True, False])
|
||||
@pytest.mark.parametrize("dry_run", E2E_DRY_RUN_FIXTURE_VALUE)
|
||||
def test_chapters_from_comments(
|
||||
self,
|
||||
default_config,
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import pytest
|
|||
from conftest import assert_logs
|
||||
from expected_download import assert_expected_downloads
|
||||
from expected_transaction_log import assert_transaction_log_matches
|
||||
from resources import E2E_DRY_RUN_FIXTURE_VALUE
|
||||
|
||||
from ytdl_sub.downloaders.ytdlp import YTDLP
|
||||
from ytdl_sub.subscriptions.subscription import Subscription
|
||||
|
|
@ -39,7 +40,7 @@ def rolling_recent_channel_preset_dict(recent_preset_dict):
|
|||
|
||||
|
||||
class TestDateRange:
|
||||
@pytest.mark.parametrize("dry_run", [True, False])
|
||||
@pytest.mark.parametrize("dry_run", E2E_DRY_RUN_FIXTURE_VALUE)
|
||||
@pytest.mark.parametrize("date_range_breaks", [True, False])
|
||||
def test_recent_channel_download(
|
||||
self,
|
||||
|
|
@ -93,7 +94,7 @@ class TestDateRange:
|
|||
expected_download_summary_file_name="plugins/date_range/test_channel_recent.json",
|
||||
)
|
||||
|
||||
@pytest.mark.parametrize("dry_run", [True, False])
|
||||
@pytest.mark.parametrize("dry_run", E2E_DRY_RUN_FIXTURE_VALUE)
|
||||
def test_recent_channel_download__no_vids_in_range(
|
||||
self,
|
||||
tv_show_config,
|
||||
|
|
@ -125,7 +126,7 @@ class TestDateRange:
|
|||
expected_download_summary_file_name="plugins/date_range/no_downloads.json",
|
||||
)
|
||||
|
||||
@pytest.mark.parametrize("dry_run", [True, False])
|
||||
@pytest.mark.parametrize("dry_run", E2E_DRY_RUN_FIXTURE_VALUE)
|
||||
def test_rolling_recent_channel_download(
|
||||
self,
|
||||
tv_show_config,
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import pytest
|
|||
from expected_download import assert_expected_downloads
|
||||
from expected_transaction_log import assert_transaction_log_matches
|
||||
from mergedeep import mergedeep
|
||||
from resources import E2E_DRY_RUN_FIXTURE_VALUE
|
||||
|
||||
from ytdl_sub.subscriptions.subscription import Subscription
|
||||
|
||||
|
|
@ -21,7 +22,7 @@ def preset_dict(output_directory):
|
|||
|
||||
|
||||
class TestFileConvert:
|
||||
@pytest.mark.parametrize("dry_run", [True, False])
|
||||
@pytest.mark.parametrize("dry_run", E2E_DRY_RUN_FIXTURE_VALUE)
|
||||
def test_file_convert(
|
||||
self,
|
||||
default_config,
|
||||
|
|
@ -47,7 +48,7 @@ class TestFileConvert:
|
|||
expected_download_summary_file_name="plugins/file_convert/output.json",
|
||||
)
|
||||
|
||||
@pytest.mark.parametrize("dry_run", [True, False])
|
||||
@pytest.mark.parametrize("dry_run", E2E_DRY_RUN_FIXTURE_VALUE)
|
||||
def test_file_convert_custom_ffmpeg(
|
||||
self,
|
||||
default_config,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import pytest
|
||||
from expected_download import assert_expected_downloads
|
||||
from expected_transaction_log import assert_transaction_log_matches
|
||||
from resources import E2E_DRY_RUN_FIXTURE_VALUE
|
||||
|
||||
from ytdl_sub.subscriptions.subscription import Subscription
|
||||
|
||||
|
|
@ -61,7 +62,7 @@ class TestFileConvert:
|
|||
transaction_log = subscription.download(dry_run=False)
|
||||
assert transaction_log.is_empty
|
||||
|
||||
@pytest.mark.parametrize("dry_run", [True, False])
|
||||
@pytest.mark.parametrize("dry_run", E2E_DRY_RUN_FIXTURE_VALUE)
|
||||
def test_match_filters_empty(
|
||||
self,
|
||||
default_config,
|
||||
|
|
@ -78,7 +79,7 @@ class TestFileConvert:
|
|||
transaction_log = subscription.download(dry_run=dry_run)
|
||||
assert transaction_log.is_empty
|
||||
|
||||
@pytest.mark.parametrize("dry_run", [True, False])
|
||||
@pytest.mark.parametrize("dry_run", E2E_DRY_RUN_FIXTURE_VALUE)
|
||||
def test_match_filters_partial(
|
||||
self,
|
||||
default_config,
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import mergedeep
|
|||
import pytest
|
||||
from expected_download import assert_expected_downloads
|
||||
from expected_transaction_log import assert_transaction_log_matches
|
||||
from resources import E2E_DRY_RUN_FIXTURE_VALUE
|
||||
|
||||
from ytdl_sub.subscriptions.subscription import Subscription
|
||||
from ytdl_sub.utils.exceptions import ValidationException
|
||||
|
|
@ -66,7 +67,7 @@ def yt_album_as_chapters_with_regex_preset_dict(yt_album_as_chapters_preset_dict
|
|||
|
||||
|
||||
class TestSplitByChapters:
|
||||
@pytest.mark.parametrize("dry_run", [True, False])
|
||||
@pytest.mark.parametrize("dry_run", E2E_DRY_RUN_FIXTURE_VALUE)
|
||||
def test_video_with_chapters(
|
||||
self,
|
||||
default_config,
|
||||
|
|
@ -96,7 +97,7 @@ class TestSplitByChapters:
|
|||
transaction_log = subscription.download()
|
||||
assert transaction_log.is_empty
|
||||
|
||||
@pytest.mark.parametrize("dry_run", [True, False])
|
||||
@pytest.mark.parametrize("dry_run", E2E_DRY_RUN_FIXTURE_VALUE)
|
||||
def test_video_with_chapters_and_regex(
|
||||
self,
|
||||
default_config,
|
||||
|
|
@ -122,7 +123,7 @@ class TestSplitByChapters:
|
|||
expected_download_summary_file_name="plugins/split_by_chapters_with_regex_video.json",
|
||||
)
|
||||
|
||||
@pytest.mark.parametrize("dry_run", [True, False])
|
||||
@pytest.mark.parametrize("dry_run", E2E_DRY_RUN_FIXTURE_VALUE)
|
||||
@pytest.mark.parametrize("when_no_chapters", ["pass", "drop", "error"])
|
||||
def test_video_with_no_chapters_and_regex(
|
||||
self,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import pytest
|
||||
from expected_download import assert_expected_downloads
|
||||
from expected_transaction_log import assert_transaction_log_matches
|
||||
from resources import E2E_DRY_RUN_FIXTURE_VALUE
|
||||
|
||||
from ytdl_sub.config.config_file import ConfigFile
|
||||
from ytdl_sub.subscriptions.subscription import Subscription
|
||||
|
|
@ -48,7 +49,7 @@ class TestSubtitles:
|
|||
|
||||
_ = ConfigFile.from_dict(default_config_dict)
|
||||
|
||||
@pytest.mark.parametrize("dry_run", [True, False])
|
||||
@pytest.mark.parametrize("dry_run", E2E_DRY_RUN_FIXTURE_VALUE)
|
||||
def test_subtitles_embedded(
|
||||
self,
|
||||
default_config,
|
||||
|
|
@ -74,7 +75,7 @@ class TestSubtitles:
|
|||
expected_download_summary_file_name="plugins/test_subtitles_embedded.json",
|
||||
)
|
||||
|
||||
@pytest.mark.parametrize("dry_run", [True, False])
|
||||
@pytest.mark.parametrize("dry_run", E2E_DRY_RUN_FIXTURE_VALUE)
|
||||
def test_subtitles_embedded_and_file(
|
||||
self,
|
||||
default_config,
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ from typing import Dict
|
|||
import pytest
|
||||
from expected_download import assert_expected_downloads
|
||||
from expected_transaction_log import assert_transaction_log_matches
|
||||
from resources import E2E_DRY_RUN_FIXTURE_VALUE
|
||||
|
||||
from ytdl_sub.config.config_file import ConfigFile
|
||||
from ytdl_sub.subscriptions.subscription import Subscription
|
||||
|
|
@ -48,7 +49,7 @@ class TestChannel:
|
|||
expected md5 file hashes.
|
||||
"""
|
||||
|
||||
@pytest.mark.parametrize("dry_run", [True, False])
|
||||
@pytest.mark.parametrize("dry_run", E2E_DRY_RUN_FIXTURE_VALUE)
|
||||
def test_full_channel_download(
|
||||
self,
|
||||
tv_show_config,
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ from e2e.conftest import mock_run_from_cli
|
|||
from expected_download import assert_expected_downloads
|
||||
from expected_transaction_log import assert_transaction_log_matches
|
||||
from mergedeep import mergedeep
|
||||
from resources import E2E_DRY_RUN_FIXTURE_VALUE
|
||||
|
||||
from ytdl_sub.config.config_file import ConfigFile
|
||||
from ytdl_sub.downloaders.ytdlp import YTDLP
|
||||
|
|
@ -144,7 +145,7 @@ class TestPlaylist:
|
|||
expected_download_summary_file_name="youtube/test_playlist_archive_migrated.json",
|
||||
)
|
||||
|
||||
@pytest.mark.parametrize("dry_run", [True, False])
|
||||
@pytest.mark.parametrize("dry_run", E2E_DRY_RUN_FIXTURE_VALUE)
|
||||
def test_playlist_download(
|
||||
self,
|
||||
default_config,
|
||||
|
|
@ -193,7 +194,7 @@ class TestPlaylist:
|
|||
output_directory=output_directory,
|
||||
)
|
||||
|
||||
@pytest.mark.parametrize("dry_run", [True, False])
|
||||
@pytest.mark.parametrize("dry_run", E2E_DRY_RUN_FIXTURE_VALUE)
|
||||
def test_playlist_download_from_cli_sub_no_provided_config(
|
||||
self,
|
||||
preset_dict_to_subscription_yaml_generator,
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ from conftest import preset_dict_to_dl_args
|
|||
from e2e.conftest import mock_run_from_cli
|
||||
from expected_download import assert_expected_downloads
|
||||
from expected_transaction_log import assert_transaction_log_matches
|
||||
from resources import E2E_DRY_RUN_FIXTURE_VALUE
|
||||
|
||||
from ytdl_sub.downloaders.ytdlp import YTDLP
|
||||
from ytdl_sub.entries.entry import Entry
|
||||
|
|
@ -78,7 +79,7 @@ def single_video_preset_dict_dl_args(single_video_preset_dict):
|
|||
|
||||
|
||||
class TestYoutubeVideo:
|
||||
@pytest.mark.parametrize("dry_run", [True, False])
|
||||
@pytest.mark.parametrize("dry_run", E2E_DRY_RUN_FIXTURE_VALUE)
|
||||
def test_single_video_download(
|
||||
self,
|
||||
default_config,
|
||||
|
|
@ -144,7 +145,7 @@ class TestYoutubeVideo:
|
|||
expected_download_summary_file_name="youtube/test_video_missing_thumb.json",
|
||||
)
|
||||
|
||||
@pytest.mark.parametrize("dry_run", [True, False])
|
||||
@pytest.mark.parametrize("dry_run", E2E_DRY_RUN_FIXTURE_VALUE)
|
||||
def test_single_video_download_from_cli_dl(
|
||||
self,
|
||||
default_config_path,
|
||||
|
|
|
|||
|
|
@ -3,10 +3,13 @@ import shutil
|
|||
from pathlib import Path
|
||||
|
||||
REGENERATE_FIXTURES: bool = False
|
||||
RUN_E2E_DOWNLOAD_TESTS: bool = False
|
||||
|
||||
RESOURCE_PATH: Path = Path("tests") / "resources"
|
||||
_FILE_FIXTURE_PATH: Path = RESOURCE_PATH / "file_fixtures"
|
||||
|
||||
E2E_DRY_RUN_FIXTURE_VALUE = [True, False] if RUN_E2E_DOWNLOAD_TESTS else [True]
|
||||
|
||||
|
||||
def file_fixture_path(fixture_name: str) -> Path:
|
||||
return _FILE_FIXTURE_PATH / fixture_name
|
||||
|
|
|
|||
Loading…
Reference in a new issue