diff options
author | Sascha Brendel <mail@lednerb.eu> | 2020-07-27 14:48:53 +0300 |
---|---|---|
committer | Sascha Brendel <mail@lednerb.eu> | 2020-07-27 14:48:53 +0300 |
commit | a8a8479eb71bb7735040bd8910c6a6f19cbdb547 (patch) | |
tree | 25f545aa2ddd3d1b412cdb2729d05b3d986a421c | |
parent | d3c1138c1e95f69a04a0dab6ab40b57293b362af (diff) |
Fixed tests and activated build stability test to prevent issues like #208 in the future.
-rwxr-xr-x | testing/testing-example-site/test-theme.sh | 54 |
1 files changed, 29 insertions, 25 deletions
diff --git a/testing/testing-example-site/test-theme.sh b/testing/testing-example-site/test-theme.sh index ea8c509..d0d2212 100755 --- a/testing/testing-example-site/test-theme.sh +++ b/testing/testing-example-site/test-theme.sh @@ -112,34 +112,38 @@ testContentAndContinue '<a href="/de/categories/t%C3%A4st++">Täst+& # quote/täst-quote [en] echo "## Testing quote/täst-quote [en]" -testContentAndContinue '<a href="/author/%c3%a4-%c3%9f+">ä ß+</a>' "$TARGET_DIR/quote/täst-quote/index.html" +testContentAndContinue '<a href="/author/%c3%a4-%c3%9f+"> + ä ß+ +</a>' "$TARGET_DIR/quote/täst-quote/index.html" # quote/täst-quote [de] echo "## Testing quote/täst-quote [de]" -testContentAndContinue '<a href="/de/author/%c3%a4-%c3%9f+">ä ß+</a>' "$TARGET_DIR/de/quote/täst-quote/index.html" - - -echo "# Build stability test [not working right now]" - -#BUILD_COUNT=5 -#for ((i=0; i<BUILD_COUNT; i++)) ; do -# echo "Building ($i)" -# cleanBuildHugo > /dev/null -# rm -rf "$TARGET_DIR$i" -# mv "$TARGET_DIR" "$TARGET_DIR$i" -#done -# -#DIFF_OUT="" -#set +e -#for ((i=1; i<BUILD_COUNT; i++)) ; do -# echo "Calculating differences between $i and $((i-1))" -# DIFF_OUT="$DIFF_OUT$(diff -rq "$TARGET_DIR$i" "$TARGET_DIR$((i-1))")" -#done -#set -e -# -#if [[ -z $DIFF_OUT ]]; then -# failButContinue "Build is instable! expected to receive no differences but was: $DIFF_OUT" -#fi +testContentAndContinue '<a href="/de/author/%c3%a4-%c3%9f+"> + ä ß+ +</a>' "$TARGET_DIR/de/quote/täst-quote/index.html" + + +echo "# Build stability test" + +BUILD_COUNT=100 +for ((i=0; i<BUILD_COUNT; i++)) ; do + echo "Building ($i)" + cleanBuildHugo > /dev/null + rm -rf "$TARGET_DIR$i" + mv "$TARGET_DIR" "$TARGET_DIR$i" +done + +DIFF_OUT="" +set +e +for ((i=1; i<BUILD_COUNT; i++)) ; do + echo "Calculating differences between $i and $((i-1))" + DIFF_OUT="$DIFF_OUT$(diff -rq "$TARGET_DIR$i" "$TARGET_DIR$((i-1))")" +done +set -e + +if [[ $DIFF_OUT != "" ]]; then + failButContinue "Build is instable! expected to receive no differences but was: $DIFF_OUT" +fi |