Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimized some tests to reduce duration #2274

Merged
merged 3 commits into from Nov 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -2,11 +2,11 @@
"name": "SceneWithMultipleCallsWithNFlag",
"movie_metadata": {
"codec_name": "h264",
"width": 1920,
"height": 1080,
"avg_frame_rate": "60/1",
"width": 854,
"height": 480,
"avg_frame_rate": "15/1",
"duration": "4.000000",
"nb_frames": "240"
"nb_frames": "60"
},
"section_dir_layout": [],
"section_index": []
Expand Down
24 changes: 12 additions & 12 deletions tests/test_scene_rendering/opengl/test_cli_flags_opengl.py
Expand Up @@ -36,22 +36,21 @@ def test_basic_scene_with_default_values(tmp_path, manim_cfg_file, simple_scenes
assert exit_code == 0, err


@pytest.mark.slow()
@pytest.mark.slow
def test_resolution_flag(tmp_path, manim_cfg_file, simple_scenes_path):
scene_name = "NoAnimations"
# test different separators
resolutions = [
(720, 480),
(1280, 720),
(1920, 1080),
(2560, 1440),
(3840, 2160),
(640, 480),
(800, 600),
(720, 480, ";"),
(1280, 720, ","),
(1920, 1080, "-"),
(2560, 1440, ";"),
# (3840, 2160, ","),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these just left commented out to allow for local testing of these resolutions?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, I each one of these tests takes ages and do we really need that many different resolutions to be tested?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don’t think so, think we can just remove the commented out ones ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ups, I misunderstood your first comment. That's exactly why they're commented out and not deleted.
Sorry.

# (640, 480, "-"),
# (800, 600, ";"),
]

separators = [";", ",", "-"]

for (width, height), separator in itertools.product(resolutions, separators):
for (width, height, separator) in resolutions:
command = [
sys.executable,
"-m",
Expand Down Expand Up @@ -101,14 +100,15 @@ def test_basic_scene_l_flag(tmp_path, manim_cfg_file, simple_scenes_path):
@pytest.mark.slow
@video_comparison(
"SceneWithMultipleCallsWithNFlag.json",
"videos/simple_scenes/1080p60/SceneWithMultipleCalls.mp4",
"videos/simple_scenes/480p15/SceneWithMultipleCalls.mp4",
)
def test_n_flag(tmp_path, simple_scenes_path):
scene_name = "SceneWithMultipleCalls"
command = [
sys.executable,
"-m",
"manim",
"-ql",
"--renderer",
"opengl",
"--write_to_movie",
Expand Down
22 changes: 11 additions & 11 deletions tests/test_scene_rendering/test_cli_flags.py
Expand Up @@ -38,19 +38,18 @@ def test_basic_scene_with_default_values(tmp_path, manim_cfg_file, simple_scenes
@pytest.mark.slow
def test_resolution_flag(tmp_path, manim_cfg_file, simple_scenes_path):
scene_name = "NoAnimations"
# test different separators
resolutions = [
(720, 480),
(1280, 720),
(1920, 1080),
(2560, 1440),
(3840, 2160),
(640, 480),
(800, 600),
(720, 480, ";"),
(1280, 720, ","),
(1920, 1080, "-"),
(2560, 1440, ";"),
# (3840, 2160, ","),
# (640, 480, "-"),
# (800, 600, ";"),
]

separators = [";", ",", "-"]

for (width, height), separator in itertools.product(resolutions, separators):
for (width, height, separator) in resolutions:
command = [
sys.executable,
"-m",
Expand Down Expand Up @@ -97,14 +96,15 @@ def test_basic_scene_l_flag(tmp_path, manim_cfg_file, simple_scenes_path):
@pytest.mark.slow
@video_comparison(
"SceneWithMultipleCallsWithNFlag.json",
"videos/simple_scenes/1080p60/SceneWithMultipleCalls.mp4",
"videos/simple_scenes/480p15/SceneWithMultipleCalls.mp4",
)
def test_n_flag(tmp_path, simple_scenes_path):
scene_name = "SceneWithMultipleCalls"
command = [
sys.executable,
"-m",
"manim",
"-ql",
"-n 3,6",
"--media_dir",
str(tmp_path),
Expand Down