Skip to content

Commit c106b23

Browse files
committed
Track expected differences bewteen naked and normal test
1 parent 8482c19 commit c106b23

9 files changed

+1671
-9
lines changed

scripts/test.sh

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,28 +23,32 @@ if [ $rc -ne 0 ]; then
2323
echo "FAIL on helm template $target --name-template $name ${CHART_OPTS}"
2424
exit 1
2525
fi
26-
#cp ${OUTPUT} ${REFERENCE}
2726
if [ ! -e ${REFERENCE} ]; then
28-
touch ${REFERENCE}
27+
cp ${OUTPUT} ${REFERENCE}
2928
fi
3029
diff -u ${REFERENCE} ${OUTPUT}
3130
rc=$?
32-
if [ $rc = 0 ]; then
33-
rm -f ${OUTPUT}
34-
fi
3531

3632
if [ $TEST_VARIANT = normal -a $rc = 0 ]; then
3733
# Another method of finding variables missing from values.yaml, eg.
3834
# - name: -datacenter
3935
# + name: pattern-name-datacenter
40-
# Alas we can't make it fatal because there *should* be some differences
41-
diff -u ${TESTDIR}/${name}-naked.expected.yaml ${TESTDIR}/${name}-normal.expected.yaml
36+
diff -u ${TESTDIR}/${name}-naked.expected.yaml ${TESTDIR}/${name}-normal.expected.yaml | sed 's/20[0-9][0-9]-[09][0-9].*//' > ${OUTPUT}.variant
37+
38+
if [ ! -e ${REFERENCE}.variant ]; then
39+
cp ${OUTPUT}.variant ${REFERENCE}.variant
40+
fi
41+
42+
diff -u ${REFERENCE}.variant ${OUTPUT}.variant
43+
rc=$?
4244
fi
4345

4446
if [ $rc = 0 ]; then
45-
echo "PASS on $target $TEST_VARIANT with opts [$CHART_OPTS]"
47+
rm -f ${OUTPUT}
48+
rm -f ${OUTPUT}.variant
49+
echo "PASS on $target $TEST_VARIANT with opts [$CHART_OPTS]"
4650
else
47-
echo "FAIL on $target $TEST_VARIANT with opts [$CHART_OPTS]"
51+
echo "FAIL on $target $TEST_VARIANT with opts [$CHART_OPTS]"
4852
fi
4953

5054
exit $rc

0 commit comments

Comments
 (0)