Skip to content

Commit 0946c60

Browse files
authored
Add test cases for test_calculate_images_to_build with real examples (#129)
# Summary Add test cases for test_calculate_images_to_build with real examples ## Proof of Work Unit tests passing
1 parent 995e429 commit 0946c60

File tree

3 files changed

+31
-2
lines changed

3 files changed

+31
-2
lines changed

.githooks/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ run_shellcheck() {
163163

164164
start_shellcheck() {
165165
files_1=$(find scripts -type f -name "*.sh")
166-
files_2=$(find scripts/dev/contexts -type f)
166+
files_2=$(find scripts/dev/contexts -type f | grep -v private-context)
167167
files_3=$(find scripts/funcs -type f)
168168
files_4=$(find public/architectures -type f -name "*.sh")
169169
files=$(echo -e "$files_1\n$files_2\n$files_3\n$files_4")

pipeline_test.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,36 @@ def test_operator_build_configuration_defaults():
7575
(["a", "b", "c"], None, ["d"], ValueError),
7676
([], ["a"], ["b"], ValueError),
7777
(["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+
),
78108
],
79109
)
80110
def test_calculate_images_to_build(test_case):

scripts/dev/install.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ elif [ "$(uname)" = "Linux" ] ; then # Ubuntu only
1818

1919
kops_version="$(curl -s https://api.github.com/repos/kubernetes/kops/releases/latest | grep tag_name | cut -d '"' -f 4)"
2020
curl -Lo kops "https://github.com/kubernetes/kops/releases/download/${kops_version}/kops-linux-amd64"
21-
echo "hi"
2221
chmod +x kops
2322
mv kops "${GOBIN}" || true
2423

0 commit comments

Comments
 (0)