Skip to content

Commit

Permalink
Enhance Travis-CI to optionally compare Wok output
Browse files Browse the repository at this point in the history
- 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 mythmon#144 and mythmon#145.
  • Loading branch information
matt-garman committed Dec 16, 2015
1 parent 594f80c commit 0cf1e56
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 12 additions & 2 deletions bin/site-tests
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 7 additions & 0 deletions test_site/wok_expected_output-test_site
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit 0cf1e56

Please sign in to comment.