From: Vladimír Vondruš Date: Sat, 27 Jan 2018 16:41:00 +0000 (+0100) Subject: package/ci: JS testing on Travis. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=adcbc9aa1cb96fa6fa2b343e507dae3ec762de5e;p=blog.git package/ci: JS testing on Travis. --- diff --git a/doxygen/.gitignore b/doxygen/.gitignore index ccb3caeb..0f08147f 100644 --- a/doxygen/.gitignore +++ b/doxygen/.gitignore @@ -1,4 +1,4 @@ test/*/html/ test/*/xml/ -test/js-test-data/ +test/node_modules/ coverage/ diff --git a/doxygen/test/js-test-data/empty.bin b/doxygen/test/js-test-data/empty.bin new file mode 100644 index 00000000..053f032f Binary files /dev/null and b/doxygen/test/js-test-data/empty.bin differ diff --git a/doxygen/test/js-test-data/searchdata.b85 b/doxygen/test/js-test-data/searchdata.b85 new file mode 100644 index 00000000..b453a005 --- /dev/null +++ b/doxygen/test/js-test-data/searchdata.b85 @@ -0,0 +1 @@ +O+!-v7y$qP0s#O30s#R40{{d704W0i2mk;m0{{*H0B!>S6aWBe0s#X60{|cZ04W0iBme*?0{|)j0B!>SFaQ8)0{}Jv0Br*RJOBVX1OWm7LI40d0{}<>0CEEWPyhgL0{~V40CWQYTmS%L0{~(G0A&IJ1pos8ZU6u&0|0UW04M_hcmM!y0|0&i0BHjNga80-0|1Hu06GK#1OSi#06GHzmH+@{0|1@?0A~XLqyPYJ0|2T30AU9J8UO%oXaE3qumAvZ0|2%F06GK#006`Q06GHz$^Zap0|3$h0CWTc0RRI41pos8-T(k80|4d#04M_h>;M361pwFp0Aca~0BHvR_y7QHXaE3qumAvZ8~^|SGXMYpRR910dH?_bssI20%>V!Z`v3p{O<{Cs0B&JzWpi+0V`WWYbZ9PUbZu-+VRUFZI&EogC@BDLVQpn|aA9L*O<{CsE@*UZY$I)HZcSlyXgWGpWn*-2asXp&VRLg$VRUF;F<&uOWn*-2axQ3eZEQ_pbZ9y{R%K&!Z*n?1ZE0>ODF9<^VRLg$VRUF;F<&uOWn*-2axQ3eZEPcLX>LtnbZ9y{QekdqWdLJrVRLg$VRUF;F<&uKVQyz-E@*UZY)xTwXgWGlVQyz-Iy!A>ZYU`LV{Bn_b4_7%XkRg3F;Zb}XJsyEbZu-SZE0=* \ No newline at end of file diff --git a/doxygen/test/js-test-data/searchdata.bin b/doxygen/test/js-test-data/searchdata.bin new file mode 100644 index 00000000..916a900d Binary files /dev/null and b/doxygen/test/js-test-data/searchdata.bin differ diff --git a/doxygen/test/js-test-data/short.bin b/doxygen/test/js-test-data/short.bin new file mode 100644 index 00000000..e69de29b diff --git a/doxygen/test/js-test-data/wrong-magic.bin b/doxygen/test/js-test-data/wrong-magic.bin new file mode 100644 index 00000000..01881b37 Binary files /dev/null and b/doxygen/test/js-test-data/wrong-magic.bin differ diff --git a/doxygen/test/js-test-data/wrong-version.bin b/doxygen/test/js-test-data/wrong-version.bin new file mode 100644 index 00000000..478f0f2e --- /dev/null +++ b/doxygen/test/js-test-data/wrong-version.bin @@ -0,0 +1 @@ +MCS \ No newline at end of file diff --git a/package/ci/travis.yml b/package/ci/travis.yml index 8c81babc..76905887 100644 --- a/package/ci/travis.yml +++ b/package/ci/travis.yml @@ -1,43 +1,62 @@ # kate: indent-width 2; -language: python matrix: include: - - python: 3.4 + - language: python + python: 3.4 env: + - WITH_THEME=ON - WITH_DOXYGEN=OFF + - WITH_NODE=OFF - JOBID=py34 - - python: 3.5 + - language: python + python: 3.5 env: + - WITH_THEME=ON - WITH_DOXYGEN=OFF + - WITH_NODE=OFF - JOBID=py35 - - python: 3.6 + - language: python + python: 3.6 env: + - WITH_THEME=ON - WITH_DOXYGEN=ON + - WITH_NODE=OFF - JOBID=py36 + - language: node_js + node_js: 8 + env: + - WITH_THEME=OFF + - WITH_DOXYGEN=OFF + - WITH_NODE=ON + - JOBID=js install: - # 2.10 has some weird behavior, putting a lot of empty lines into the output - - pip install jinja2==2.9.6 - - pip install pelican Pyphen Pillow coverage codecov + # Jinja 2.10 has some weird behavior, putting a lot of empty lines into the + # output + - if [ "$WITH_THEME" == "ON" ]; then pip install jinja2==2.9.6 pelican Pyphen Pillow coverage codecov; fi + - if [ "$WITH_NODE" == "ON" ]; then npm install istanbul codecov; fi # Needed for doxygen binaries - - mkdir -p $HOME/bin && export PATH=$HOME/bin:$PATH + - if [ "$WITH_DOXYGEN" == "ON" ]; then mkdir -p $HOME/bin && export PATH=$HOME/bin:$PATH; fi # Download newer Doxygen, as I don't want to care for the old bugs - if [ "$WITH_DOXYGEN" == "ON" ] && [ ! -f $HOME/bin/doxygen ]; then wget "http://ftp.stack.nl/pub/users/dimitri/doxygen-1.8.13.linux.bin.tar.gz" && tar -xzf doxygen-1.8.13.linux.bin.tar.gz && cp doxygen-1.8.13/bin/doxygen $HOME/bin && doxygen -v; fi script: # Test the theme. No code coverage there. - - cd $TRAVIS_BUILD_DIR/pelican-theme && python -m unittest + - if [ "$WITH_THEME" == "ON" ]; then cd $TRAVIS_BUILD_DIR/pelican-theme && python -m unittest; fi # Test plugins. Math plugin is not tested as dvisvgm on 14.04 is unusable. - - cd $TRAVIS_BUILD_DIR/pelican-plugins && coverage run -m unittest && cp .coverage ../.coverage.plugins + - if [ "$WITH_THEME" == "ON" ]; then cd $TRAVIS_BUILD_DIR/pelican-plugins && coverage run -m unittest && cp .coverage ../.coverage.plugins; fi # Test doxygen theme. Math rendering is not tested as dvisvgm on 14.04 is # unusable. - if [ "$WITH_DOXYGEN" == "ON" ]; then cd $TRAVIS_BUILD_DIR/doxygen && coverage run -m unittest && cp .coverage ../.coverage.doxygen; fi + # Test client doxygen JS + - if [ "$WITH_NODE" == "ON" ]; then cd $TRAVIS_BUILD_DIR && istanbul cover doxygen/test/test-search.js; fi + # Cache the downloaded doxygen cache: directories: @@ -52,4 +71,5 @@ notifications: on_start: never after_success: - - cd $TRAVIS_BUILD_DIR && coverage combine && codecov + - if [ "$WITH_THEME" == "ON" ] || [ "$WITH_DOXYGEN" == "ON" ]; then cd $TRAVIS_BUILD_DIR && coverage combine && codecov; fi + - if [ "$WITH_NODE" == "ON" ]; then cd $TRAVIS_BUILD_DIR && codecov; fi