From 0cf1e563dbe26b957efa67f7b8c6c26e2d4058ed Mon Sep 17 00:00:00 2001 From: matt-garman Date: Wed, 16 Dec 2015 09:51:40 -0600 Subject: [PATCH] Enhance Travis-CI to optionally compare Wok output - Add file "test_site/wok_expected_output-test_site" which is the output of "wok -v" when run with current upstream master. - Introduce new environment variable "CMP_OUTPUT" in .travis.yml. - Enhance bin/site-tests such that if CMP_OUTPUT==true, it will run cmp on the wok_expected_output-$TEST_SITE file versus the output of the "wok -v" run. - Goal of this enhancement is to support more robust testing of fixes for issues #144 and #145. --- .travis.yml | 8 ++++---- bin/site-tests | 14 ++++++++++++-- test_site/wok_expected_output-test_site | 7 +++++++ 3 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 test_site/wok_expected_output-test_site diff --git a/.travis.yml b/.travis.yml index 7351123..f079b71 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,10 +3,10 @@ python: ["2.7"] sudo: false env: - - PYTHON_TESTS=true TEST_SITE=false - - PYTHON_TESTS=false TEST_SITE=docs - - PYTHON_TESTS=false TEST_SITE=test_site - - PYTHON_TESTS=false TEST_SITE=OSULUG/OSULUG-website + - PYTHON_TESTS=true TEST_SITE=false CMP_OUTPUT=false + - PYTHON_TESTS=false TEST_SITE=docs CMP_OUTPUT=false + - PYTHON_TESTS=false TEST_SITE=test_site CMP_OUTPUT=true + - PYTHON_TESTS=false TEST_SITE=OSULUG/OSULUG-website CMP_OUTPUT=false script: - bin/python-tests diff --git a/bin/site-tests b/bin/site-tests index 903ed80..1277a93 100755 --- a/bin/site-tests +++ b/bin/site-tests @@ -26,5 +26,15 @@ fi echo "Testing site $TEST_SITE" cd $TEST_SITE -wok -v -exit $? +EXPECTED_FILE=wok_expected_output-${TEST_SITE} +OUTPUT_FILE=wok_output_travis-ci.${TEST_SITE}.`date +%Y%m%d-%H%M%S`.txt +wok -v > $OUTPUT_FILE 2>&1 +rc=$? + +if [ -n "$CMP_OUTPUT" -a "$CMP_OUTPUT" = "true" ]; then + echo "Comparing output $EXPECTED_FILE $OUTPUT_FILE" + cmp $EXPECTED_FILE $OUTPUT_FILE + rc=$? +fi + +exit $rc diff --git a/test_site/wok_expected_output-test_site b/test_site/wok_expected_output-test_site new file mode 100644 index 0000000..2c5a7a8 --- /dev/null +++ b/test_site/wok_expected_output-test_site @@ -0,0 +1,7 @@ +WARNING:root:Textile not enabled. +WARNING:root:HTML rendering relies on the BeautifulSoup library. +WARNING:root:To use compile_sass hook, you must install libsass-python package. +WARNING:root:No parser found for html_renderer.html. Using default renderer. +ERROR:root:It looks like the page "content/tests/dates1.mkd" is an orphan! This will probably cause problems. +ERROR:root:It looks like the page "content/tests/dates2.mkd" is an orphan! This will probably cause problems. +ERROR:root:It looks like the page "content/tests/dates3.mkd" is an orphan! This will probably cause problems.