|
6 | 6 | import pytest
|
7 | 7 |
|
8 | 8 | from pipeline import (
|
9 |
| - calculate_images_to_build, |
| 9 | + get_included_images, |
10 | 10 | gather_all_supported_agent_versions,
|
11 | 11 | gather_latest_agent_versions,
|
12 | 12 | get_versions_to_rebuild,
|
@@ -64,58 +64,6 @@ def test_operator_build_configuration_defaults():
|
64 | 64 | assert config.namespace == "default"
|
65 | 65 |
|
66 | 66 |
|
67 |
| -@pytest.mark.parametrize( |
68 |
| - "test_case", |
69 |
| - [ |
70 |
| - (["a", "b", "c"], ["a"], ["b"], {"a", "c"}), |
71 |
| - (["a", "b", "c"], ["a", "b"], None, {"a", "b"}), |
72 |
| - (["a", "b", "c"], None, ["a"], {"b", "c"}), |
73 |
| - (["a", "b", "c"], [], [], {"a", "b", "c"}), |
74 |
| - (["a", "b", "c"], ["d"], None, ValueError), |
75 |
| - (["a", "b", "c"], None, ["d"], ValueError), |
76 |
| - ([], ["a"], ["b"], ValueError), |
77 |
| - (["a", "b", "c"], None, None, {"a", "b", "c"}), |
78 |
| - # Given an include, it should only return include images |
79 |
| - (["cli", "ops-manager", "appdb-daily", "init-appdb"], ["cli"], [], {"cli"}), |
80 |
| - # Given no include nor excludes it should return all images |
81 |
| - ( |
82 |
| - ["cli", "ops-manager", "appdb-daily", "init-appdb"], |
83 |
| - [], |
84 |
| - [], |
85 |
| - {"init-appdb", "appdb-daily", "ops-manager", "cli"}, |
86 |
| - ), |
87 |
| - # Given an exclude, it should return all images except the excluded ones |
88 |
| - ( |
89 |
| - ["cli", "ops-manager", "appdb-daily", "init-appdb"], |
90 |
| - [], |
91 |
| - ["init-appdb", "appdb-daily"], |
92 |
| - {"ops-manager", "cli"}, |
93 |
| - ), |
94 |
| - # Given an include and a different exclude, it should return all images except the exclusions |
95 |
| - ( |
96 |
| - ["cli", "ops-manager", "appdb-daily", "init-appdb"], |
97 |
| - ["appdb-daily"], |
98 |
| - ["init-appdb"], |
99 |
| - {"appdb-daily", "cli", "ops-manager"}, |
100 |
| - ), |
101 |
| - # Given multiple includes and a different exclude, it should return all images except the exclusions |
102 |
| - ( |
103 |
| - ["cli", "ops-manager", "appdb-daily", "init-appdb"], |
104 |
| - ["cli", "appdb-daily"], |
105 |
| - ["init-appdb"], |
106 |
| - {"appdb-daily", "cli", "ops-manager"}, |
107 |
| - ), |
108 |
| - ], |
109 |
| -) |
110 |
| -def test_calculate_images_to_build(test_case): |
111 |
| - images, include, exclude, expected = test_case |
112 |
| - if expected is ValueError: |
113 |
| - with pytest.raises(ValueError): |
114 |
| - calculate_images_to_build(images, include, exclude) |
115 |
| - else: |
116 |
| - assert calculate_images_to_build(images, include, exclude) == expected |
117 |
| - |
118 |
| - |
119 | 67 | @pytest.mark.parametrize(
|
120 | 68 | "version,min_version,max_version,expected",
|
121 | 69 | [
|
|
0 commit comments