Skip to content

Commit

Permalink
Change test charts to end in .yaml for certain tools
Browse files Browse the repository at this point in the history
Closes #344
  • Loading branch information
elric1 committed May 10, 2022
1 parent 281b83c commit 29ad7c3
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions bin/helm-compare-versions
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
copy_vals() {

NEWLOC="$(mktemp "$MYDIR/valuesXXXXXX")"
cp $1 $NEWLOC
cp "test/charts/$1.in.yaml" $NEWLOC
echo $NEWLOC
}

Expand Down Expand Up @@ -56,8 +56,8 @@ if [ -z "$NEW_VALUES" ]; then
NEW_VALUES="$OLD_VALUES"
fi

[ ! -f "$NEW_VALUES" ] && NEW_VALUES="$(copy_vals test/charts/$NEW_VALUES.in)"
[ ! -f "$OLD_VALUES" ] && OLD_VALUES="$(copy_vals test/charts/$OLD_VALUES.in)"
[ ! -f "$NEW_VALUES" ] && NEW_VALUES="$(copy_vals $NEW_VALUES)"
[ ! -f "$OLD_VALUES" ] && OLD_VALUES="$(copy_vals $OLD_VALUES)"

CHART1=
CHART2=
Expand Down
20 changes: 10 additions & 10 deletions bin/test-charts
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@

#
# test-charts runs "helm template" with a list of values files which
# are found in test/charts/*.in. Corresponding to each file, there is
# a file called test/charts/*.expect. This is the expected output of
# are found in test/charts/*.in.yaml. Corresponding to each file, there is
# a file called test/charts/*.expect.yaml. This is the expected output of
# the template expansion.
#
# Running test-charts with no arguments will run all of the tests stopping
# on the first failure at which point it will emit a unified diff of the
# changes and exit nonzero.
#
# The -l flag will list all of the tests (without the .in suffix)
# The -l flag will list all of the tests (without the .in.yaml suffix)
#
# The -r flag will regenerate the expect file corresponding to one or
# more of the tests. These must be provided as arguments on the command
# line and said arguments do not include the .in suffix.
# line and said arguments do not include the .in.yaml suffix.

OUT=

Expand All @@ -26,7 +26,7 @@ trap cleanup EXIT INT PIPE
run_test() {
IN="$1"
OUT="$(mktemp /tmp/chartXXXXXX)"
EXPECT="${1%.in}.expect"
EXPECT="${1%.in.yaml}.expect.yaml"

echo "Testing $IN"

Expand All @@ -45,29 +45,29 @@ run_test() {
run_tests() {
if [ $# -gt 0 ]; then
for i; do
run_test "test/charts/$i.in"
run_test "test/charts/$i.in.yaml"
done
return
fi

for i in test/charts/*.in; do
for i in test/charts/*.in.yaml; do
run_test $i
done
}

list_tests() {
ls test/charts/*.in | sed 's,^test/charts/\(.*\).in,\1,'
ls test/charts/*.in.yaml | sed 's,^test/charts/\(.*\).in.yaml,\1,'
}

regen() {
for i; do
IN="test/charts/$i.in"
IN="test/charts/$i.in.yaml"
if ! [ -f "$IN" ]; then
echo Test $i doesn\'t exist.
exit 1
fi
echo "Regenerating $IN"
EXPECT="${IN%.in}.expect"
EXPECT="${IN%.in.yaml}.expect.yaml"
helm template --values "$IN" -n testing charts/tezos > $EXPECT
done
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 29ad7c3

Please sign in to comment.