From 52807ca27e481748854200d5df3448bc5e722e77 Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Thu, 20 Nov 2014 03:35:35 +0800 Subject: [PATCH 1/5] fix travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index cdc85ab..cccc1d8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ before_install: - sudo pip install selenium sauceclient - export DISPLAY=:99.0 - test/start_xvfb.sh - - pushd test/browser_tests + - pushd / - python -m SimpleHTTPServer 8000 & - popd - sleep 5 From 3df6a8a893e3bd97ca3a83ef92f105a15d611806 Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Thu, 20 Nov 2014 12:19:45 +0800 Subject: [PATCH 2/5] imporving tests[ci skip] --- test/README.md | 13 ++++++++++--- test/browser_tests.py | 9 +++++++++ test/browser_tests/test_fail.pdf | Bin 0 -> 20583 bytes test/browser_tests/test_fail.tex | 9 +++++++++ .../test_fail/THIS_FOLDER_SHOULD_BE_EMPTY | 0 test/test.py | 6 +++--- test/test_output.py | 3 +-- test/test_remote_browser.py | 2 +- 8 files changed, 33 insertions(+), 9 deletions(-) create mode 100644 test/browser_tests/test_fail.pdf create mode 100644 test/browser_tests/test_fail.tex create mode 100644 test/browser_tests/test_fail/THIS_FOLDER_SHOULD_BE_EMPTY diff --git a/test/README.md b/test/README.md index d81facd..2c633ac 100644 --- a/test/README.md +++ b/test/README.md @@ -15,10 +15,15 @@ - `./test.py test_local_browser.test_basic_text` - Or `./test.py test_basic_text - Environment variables: - - set `P2H_TEST_SAVE_TMP=1` to keep the temporary files in `/tmp/pdf2htmlEX_test` - - set `P2H_TEST_GEN=1` to generate new reference files + - Set `P2H_TEST_SAVE_TMP=1` to keep the temporary files in `/tmp/pdf2htmlEX_test` + - Set `P2H_TEST_GEN=1` to generate new reference files + - Set `P2H_TEST_REMOTE=1` to test different browsers using Sauce Labs + - Set correct values for `SAUCE_USERNAME` and `SAUCE_ACCESS_KEY` + - Setup a HTTP server at `/` on port 8000 + - Enable Sauce Connect + - See `.travis.yml` as an example -### Guidelines for test cases +### Add new test cases - Make sure you have the proper copyrights. - Using meaningful file names, a description of the file, or issueXXX.pdf. @@ -27,4 +32,6 @@ - Grayscale only, unless the test case is about colors. - Remove unnecessary elements. - [Optional] Include the source files that the PDF file is generated from. +- Add the new PDF file to the correct folder in `test/`, and add a new function in the corresponding Python file +- Run `P2H_TEST_GEN=1 test/test.py test_issueXXX` to generate the reference, assuming that the new function is called `test_issueXXX` diff --git a/test/browser_tests.py b/test/browser_tests.py index 9323e07..c6cbba4 100644 --- a/test/browser_tests.py +++ b/test/browser_tests.py @@ -3,6 +3,7 @@ import os import subprocess import shutil +import unittest from PIL import Image, ImageChops from test import Common @@ -73,6 +74,14 @@ class BrowserTests(Common): diff_img.crop(diff_img.getbbox()).convert('RGB').save(os.path.join(png_out_dir, basefilename + '.diff.png')) self.fail('PNG files differ') + @unittest.skipIf(Common.GENERATING_MODE, 'Do not auto generate reference for test_fail') + def test_fail(self): + # The HTML reference is generated manually, which mismatches the PDF + # To test if the environment can detect any errors + # E.g. when network is down, 404 message is shown for any HTML message + with self.assertRaises(AssertionError): + self.run_test_case('test_fail.pdf') + def test_basic_text(self): self.run_test_case('basic_text.pdf') diff --git a/test/browser_tests/test_fail.pdf b/test/browser_tests/test_fail.pdf new file mode 100644 index 0000000000000000000000000000000000000000..86882f8c401cae533dd275be9bb731f5f63714cf GIT binary patch literal 20583 zcma%=Q;aSEvt?VSZQJhCwr$(CZQHhOn_t_uaoV;$xij-8lgv$K>Zx|J9;){1B2y3% zqh+LHg(jO{9$ANGCS)MAH?kt+;en=?F|{*yu^?n*XCwSy15GbxY2#w*L`W}YW9VWk zVrpz}VhYX22kq?QWNK&&?Xh{C*a<(#fGG0mGm_?J81Bl(r$wry&@GHAfNTd6=-|sc zTqbe=ac1VWXC<~-D8C5etUwye3fT)zN&`nde^k=U`G!nBT~AHNBzv`7i=kuL7V9>f z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ser_tests/test_fail.tex b/test/browser_tests/test_fail.tex new file mode 100644 index 0000000..48e5045 --- /dev/null +++ b/test/browser_tests/test_fail.tex @@ -0,0 +1,9 @@ +\documentclass{article} +\begin{document} +\Huge +The quick brown fox jumps over the lazy dog + +The quick brown fox jumps over the lazy dog + +The quick brown fox jumps over the lazy dog +\end{document} diff --git a/test/browser_tests/test_fail/THIS_FOLDER_SHOULD_BE_EMPTY b/test/browser_tests/test_fail/THIS_FOLDER_SHOULD_BE_EMPTY new file mode 100644 index 0000000..e69de29 diff --git a/test/test.py b/test/test.py index 294e2f9..8fa0494 100755 --- a/test/test.py +++ b/test/test.py @@ -13,8 +13,8 @@ class Common(object): DATA_DIR = os.path.join(SRC_DIR, 'share') PDF2HTMLEX_PATH = os.path.join(SRC_DIR, 'pdf2htmlEX') - SAVE_TMP = os.environ.get('P2H_TEST_SAVE_TMP') - GENERATING_MODE = os.environ.get('P2H_TEST_GEN') + SAVE_TMP = bool(os.environ.get('P2H_TEST_SAVE_TMP')) + GENERATING_MODE = bool(os.environ.get('P2H_TEST_GEN')) CANONICAL_TEMPDIR = '/tmp/pdf2htmlEX_test' @@ -91,7 +91,7 @@ if __name__ == '__main__': all_modules.append(__import__('test_local_browser')) all_classes = ['test_output', 'test_local_browser'] - if os.environ.get('P2H_TEST_REMOTE'): + if bool(os.environ.get('P2H_TEST_REMOTE')): m = __import__('test_remote_browser') all_modules.append(m) all_classes += m.test_classnames diff --git a/test/test_output.py b/test/test_output.py index 741cd82..e7e30a3 100644 --- a/test/test_output.py +++ b/test/test_output.py @@ -7,10 +7,9 @@ import os from test import Common +@unittest.skipIf(Common.GENERATING_MODE, 'Skipping test_output in generating mode') class test_output(Common, unittest.TestCase): def run_test_case(self, input_file, expected_output_files, args=[]): - if self.GENERATING_MODE: - self.skipTest("Skipping test_output test cases in generating mode") args = list(args) args.insert(0, os.path.join(self.TEST_DIR, 'test_output', input_file)) self.assertItemsEqual(self.run_pdf2htmlEX(args)['output_files'], expected_output_files) diff --git a/test/test_remote_browser.py b/test/test_remote_browser.py index 9fcc266..b299608 100755 --- a/test/test_remote_browser.py +++ b/test/test_remote_browser.py @@ -99,7 +99,7 @@ class test_remote_browser_base(BrowserTests): branch = os.environ.get('TRAVIS_BRANCH', 'manual') pull_request = os.environ.get('TRAVIS_PULL_REQUEST') self.sauce.jobs.update_job(self.browser.session_id, - build_num=os.environ.get('TRAVIS_BUILD_NUMBER', 0), + build_num=os.environ.get('TRAVIS_BUILD_NUMBER', '0'), name='pdf2htmlEX', passed=passed, public='public restricted', From df340bf3c49ff140d14def4e74b7d872948c9468 Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Thu, 20 Nov 2014 12:23:19 +0800 Subject: [PATCH 3/5] descripten for test[ci skip] --- test/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/test/README.md b/test/README.md index 2c633ac..eeac300 100644 --- a/test/README.md +++ b/test/README.md @@ -18,6 +18,7 @@ - Set `P2H_TEST_SAVE_TMP=1` to keep the temporary files in `/tmp/pdf2htmlEX_test` - Set `P2H_TEST_GEN=1` to generate new reference files - Set `P2H_TEST_REMOTE=1` to test different browsers using Sauce Labs + - Install `sauceclient` for Python - Set correct values for `SAUCE_USERNAME` and `SAUCE_ACCESS_KEY` - Setup a HTTP server at `/` on port 8000 - Enable Sauce Connect From bc6d9c5a24a12c074d4c49fe000a80c4900da6fb Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Thu, 20 Nov 2014 13:04:34 +0800 Subject: [PATCH 4/5] record screenshot in remote tests --- test/test_remote_browser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_remote_browser.py b/test/test_remote_browser.py index b299608..142e22b 100755 --- a/test/test_remote_browser.py +++ b/test/test_remote_browser.py @@ -21,7 +21,7 @@ BASEURL='http://localhost:8000/' SAUCE_OPTIONS = { 'record-video': False, - 'record-screenshots': False, + 'record-screenshots': True, 'record-logs': False, 'sauce-advisor': False, } From 942bf388f553e155460724b9cec62dac53a2be6f Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Thu, 20 Nov 2014 15:50:22 +0800 Subject: [PATCH 5/5] Enable Sauce Advisor --- test/test_remote_browser.py | 1 - 1 file changed, 1 deletion(-) diff --git a/test/test_remote_browser.py b/test/test_remote_browser.py index 142e22b..f24be67 100755 --- a/test/test_remote_browser.py +++ b/test/test_remote_browser.py @@ -23,7 +23,6 @@ SAUCE_OPTIONS = { 'record-video': False, 'record-screenshots': True, 'record-logs': False, - 'sauce-advisor': False, } # we want to test the latest stable version