Skip to content

Commit 65f1eb5

Browse files
author
Jakub Klimczak
committed
[#92945] tests: Test config overrides with includes
1 parent af874c7 commit 65f1eb5

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

tests/test-overrides.sh

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@ tests:
3939
001.tests.0.simple.device: "overridden"
4040
EOF
4141

42+
cat <<EOF > srv/protoplaster/tests/test-overrides-includes.yml
43+
includes: [test-no-overrides.yml]
44+
tests:
45+
000.1.simple.device: new_name
46+
000.0.simple.device: another_new_name
47+
tests.001.tests.0.simple.device: "overridden"
48+
EOF
49+
4250
protoplaster --test-dir srv/protoplaster/tests --reports-dir srv/protoplaster/reports --artifacts-dir srv/protoplaster/artifacts \
4351
-t test-no-overrides.yml --csv report.csv \
4452
--override={"tests.000.1.simple.device: new_name","tests.000.0.simple.device: another_new_name","tests.001.tests.0.simple.device: overridden"} > /dev/null
@@ -50,6 +58,12 @@ protoplaster --test-dir srv/protoplaster/tests --reports-dir srv/protoplaster/re
5058
-t test-with-overrides.yml --csv report.csv > /dev/null
5159
awk -F',' 'FNR>1 && $2 != "" {print $2}' $(ls -tr srv/protoplaster/reports/*.csv) | uniq > /tmp/actual-names-1
5260

61+
rm -f srv/protoplaster/reports/*.csv
62+
63+
protoplaster --test-dir srv/protoplaster/tests --reports-dir srv/protoplaster/reports --artifacts-dir srv/protoplaster/artifacts \
64+
-t test-overrides-includes.yml --csv report.csv > /dev/null
65+
awk -F',' 'FNR>1 && $2 != "" {print $2}' $(ls -tr srv/protoplaster/reports/*.csv) | uniq > /tmp/actual-names-2
66+
5367
exit_code=0
5468

5569
cat << EOF > /tmp/expected-names
@@ -64,7 +78,7 @@ while read -r r; do
6478
echo " - $r"
6579
done < /tmp/expected-names
6680

67-
for i in $(seq 0 1); do
81+
for i in $(seq 0 2); do
6882
if diff -q /tmp/expected-names /tmp/actual-names-$i > /dev/null; then
6983
echo "-> $i: Overrides applied successfully"
7084
else

0 commit comments

Comments
 (0)