1
0
mirror of https://github.com/webrecorder/pywb.git synced 2025-03-14 15:53:28 +01:00

47 Commits

Author SHA1 Message Date
Ilya Kreymer
5e9b13e267
proxy mode: don't rewrite xml for ajax requests. Support python 3.8 (#563)
* rewrite:
- don't rewrite xml in proxy mode / html-insert only mode
- ajax: if sec-fetch-mode is set to non-navigate, also treat as 'ajax'

* ci: build python 3.8, ignore 2.7 failures

* reqs: use released ujson for extra_reqs

* hmac: add digestmod, fix for py3.8
2020-06-08 09:40:59 -07:00
Ilya Kreymer
259f571cb9
Python 3.7 Support (#447)
* py3.7 fixes:
- add __repr__ to WBException for consistent output in py3.7
- don't raise StopIteration in generator, just return

* ci: add py3.7 builds to travis and appveyor, (don't include in integration test suite for now)
2019-02-27 08:43:33 -08:00
Ilya Kreymer
38c1b1cc3e
Edge-case and HTML Rewrite Fixes (#441)
* recoder fix: ensure Transfer-Encoding header is not passed through by RecorderApp,
as may result in duplicate Transfer-Encoding in py2.7, fixes #432

* html rewriter fixes:
- html detection: allow for UTF-8 BOM when detecting if text is html
- html decl parsing: modify base parser regex to allow IE conditional declaration to also
end with -->, eg. support '<![endif]-->' in addition to '<![endif]>', fixes #425

* travis: add allow failure for integration tests (for now)
2019-02-18 10:11:29 -08:00
John Berlin
3b64b6d2c9 travis fix: added xvfb to services due to travis changes on xenial (#436) 2019-01-30 17:39:11 -05:00
John Berlin
9be9815da4 travis integration test fixes: removed caching of pip from .travis.yml (#431)
update pip and setuptools when running install.sh found in .travis

use xenial

removed trailing dash

only run webrecorder-tests using chrome and firefox

only run webrecorder-tests using pywbtest and chrometest marker expression
2019-01-30 16:36:45 -05:00
John Berlin
ec0df7b9ae Refactor of auto-fetch worker system with support for proxy mode, fixes https://github.com/webrecorder/pywb/issues/371: (#379)
- Split wombat and auto-fetch worker into two files (proxy mode and non-proxy mode)
- Renamed preservationWorker to autoFetchWorker in order to better convey what it does
- Root config file control over including wombat and auto-fetch worker in proxy or non-proxy mode
- Added additional proxy mode + auto-fetch worker only route for fetching the auto-fetch worker code nicely for CORS
- templateview: add 'tobool' formatter to more cleanly format python bools to JS 'true'/'false'
- proxy options: config and command line: 
  'use_auto_fetch_worker' and '--proxy-with-auto-fetch'
  'use_wombat' and '--proxy-with-wombat'
- head_insert.html: only include wombat in proxy mode when use_wombat or use_auto_fetch_worker are set.
- wombatProxyMode.js: slimmed down wombat for proxy mode only including auto-fetch support.
- more consistent naming: rename 'preserveWorker' and 'autoArchive' to 'auto-fetch'

Updated tests:
- test_wbrequestresponse.py: added tests covering constructor defaults, _init_derived, options_response, json_response, encode_stream, text_stream
- test_auto_colls.py: fixed broken test test_more_custom_templates, reason using ujson now not json so spacing was off
- test_proxy.py: updated existing tests to reflect splitting wombat into proxy and non-proxy mode, added tests covering auto-fetch worker specific endpoints in proxy mode
removed duplicate addons key in .travis.yml
- test_cli.py: updated to properly test the cli with these changes
added ultrajon dep to tests_require in setup.py to reflect its usage by wbrequestresponse.py

Fully documented:
- cli.py
- frontendapp.py
- templateview.py
- wbrequestresponse.py

Removed duplicate addons key in .travis.yml
Added ultrajson dependency to tests_require in setup.py to reflect its usage by wbrequestresponse.py

Fixes #371
2018-10-03 16:27:49 -04:00
John Berlin
2f062cf5c7 New integration tests using webrecorder-tests: (#355)
New integration tests using webrecorder-tests:
- WR_TEST=true is set for integration test run (only run with py3.6, excluded for py2.7, 3.5)
- Added .travis directory that includes two scripts: install.sh and test.sh.
- install.sh handles all installation and test.sh handles running of unit or integration tests
- sudo: true required to run headless chrome
2018-07-09 13:21:14 -07:00
Ilya Kreymer
4f340933f3
Add CodeCov (#282)
coverage: switch coverage reporting to codecov, enable in travis-ci and appveyor
coverage: update .coveragerc to include branch, exclude NotImplementedError, __repr__
README: badge update, add appveyor, codecov badges
2018-01-17 09:59:51 -08:00
Ilya Kreymer
af7bbfd6e1 build: update gevent, support py3.6 2017-03-09 11:59:54 -08:00
Ilya Kreymer
e86e3e6d32 build process: simplify build process by moving essential deps to requirements.txt, and extras to extra_requirements.txt
setup.py just loads from requirements.txt
Dockerfile pip installs requirements, then extra requirements for improved cacheing
travis runs setup install, then installs extra requirements
2017-03-08 17:05:29 -08:00
Ilya Kreymer
c7fa8b711c travis: trying 2.7, 3.5 only for now 2016-11-15 10:22:32 -08:00
Ilya Kreymer
008bc47fad tests & travis: change live test to httpbin, remove 3.3 for now 2016-11-13 18:37:47 -08:00
Ilya Kreymer
4a94aefead travis fixes: add dependency, remove unnecessary include 2016-11-11 12:07:51 -08:00
Ilya Kreymer
e37900b9c6 tests: add test dependency, remove 2.6 from travis 2016-11-11 11:03:16 -08:00
Ilya Kreymer
3f734e1c98 tests: remove 3.2, fix auto_index test assert 2016-03-10 13:07:57 -08:00
Ilya Kreymer
42aa12f9ae test py3.2 also 2016-03-10 12:55:36 -08:00
Ilya Kreymer
20bd9d118b travis: remove --use-mirrors 2016-02-23 18:39:27 -08:00
Ilya Kreymer
1d5b23413f proxy: ensure proxy cert download sets content length
proxy options: 'use_default_coll' must specify exact default coll
(otherwise a random coll is chosen, as ordering is not defined)
travis: add py3.4, py3.5!
2016-02-23 18:09:09 -08:00
Ilya Kreymer
04104f04d3 travis: move to travis env settings instead 2015-11-26 11:12:39 -08:00
Ilya Kreymer
fa8528b885 travis: testing with sauce connect enabled! 2015-11-26 11:00:01 -08:00
Robert Knight
70a098cbd4 Enable Sauce Connect in Travis
Rather than specifying the username and encrypted
key in the Travis config, we just enable Sauce Connect
and require SAUCE_USERNAME and SAUCE_ACCESS_KEY env vars
to be set.

This is so that the Karma tests have the same env vars
available to them which they can use to check whether
to run against Sauce Labs or not.
2015-11-26 11:10:38 +00:00
Robert Knight
a153ada08e Configure Travis to make Firefox available for Karma tests
For some Karma tests, we can run them faster by running
against a local browser in the Travis CI instance rather
than Sauce Labs.

This is also useful for:

 - Contributors wishing to run
   the Travis tests against their own forks and have not
   set up Sauce Labs credentials.

 - Running Karma tests against Pull Request builds where
   Sauce Connect is not available.
2015-11-26 11:09:41 +00:00
Ilya Kreymer
26684b0973 Merge pull request #152 from robertknight/wombatjs-tests
Wombatjs tests
2015-11-26 00:25:49 -08:00
Robert Knight
c38ca5cdd4 Add Python and node_module caching
Speed up Travis CI rebuilds by caching pip
and npm dependencies.
2015-11-25 14:57:51 +00:00
Robert Knight
a4d05d469f Add configuration for running client tests using Sauce Labs
This gives us the capability to test the client-side JS
rewriting against a suite of different browsers on different
platforms.

Note that getting Karma running on Travis CI requires some
additional configuration documented at
github.com/karma-runner/karma-sauce-launcher/issues/73
which is not made clear in the original documentation.

In order to run the Karma tests, the Sauce Labs username
and access keys need to be passed in via the SAUCE_USERNAME
and SAUCE_ACCESS_KEYS env vars.
2015-11-25 14:57:20 +00:00
Robert Knight
f4a43a14f5 Add tests for the client-side part of pywb using Karma
* Add a Karma configuration for unit/integration tests
   for the client-side pywb code.

 * Add an integration test suite which creates an <iframe> loads
   the client-side rewriting code (wombat.js) in it and
   then executes a test script.

   Since wombat.js monkey-patches the DOM and the exact behavior
   of DOM objects varies between browsers, which we want to test,
   the suite does not mock the DOM but instead runs
   a set of tests in an isolated environment against
   the DOM.

 * Add Travis config to run the Karma tests
2015-11-25 11:53:40 +00:00
Ilya Kreymer
e37636de84 cdxindexer: if latest ujson (with forward slash not-escaping) is available, use that when indexing, closes #140
tests: update indexer CDXJ tests to be order-independent
travis: install ujson for testing
2015-10-22 17:46:05 -07:00
Ilya Kreymer
fefb4a950e travis: turn-off osx for now 2015-09-02 06:15:31 -07:00
Ilya Kreymer
c35fd86c76 add boto to .travis.yml for testing s3 2015-04-17 11:02:57 -07:00
Ilya Kreymer
cda7705075 split and refactor: remove certauth.py / test_certauth.py and instead use this functionality from 'certauth' package. Also remove proxy-cert-auth cli as
the 'certauth' tool superceeds this functionality. (#90).
To use https proxy mode, 'pip install certauth' is required. (update travis config)
2015-03-29 17:38:57 -07:00
Ilya Kreymer
8ccfd811bd travisci: experiment with travis improvements (new container build) 2014-12-23 12:39:33 -08:00
Ilya Kreymer
f82afbc977 openssl: make openssl install optional, remove from dependency
https proxy support contingest on openssl installation
if not installed and https use is enabled, a warning is printed
tests: updated tests to skip if openssl not installed
(make https post to only run in 2.7, as there are issues with in 2.6)
2014-09-06 14:43:48 -07:00
Ilya Kreymer
61a9cd0dfa cleanup .travis.yml, remove lxml 2014-08-06 14:01:59 -07:00
Ilya Kreymer
f35e82a4d5 ensure final output from close() is encoded!
add config option to 'use_lxml_parser' if available, if not,
will default to regular parser
testing on travis with lxml (not adding to dep yet)
2014-03-17 13:19:51 -07:00
Ilya Kreymer
dd9a2c635f disable pypy travis builds for now 2014-03-13 22:38:56 -07:00
Ilya Kreymer
daf868fd61 README tweaks
update setup.py to support setup.py test!
.travis.yml uses python setup.py test
2014-03-05 11:19:26 -08:00
Ilya Kreymer
9690d84798 travis-ci: attempt to fix 2.6 build 2014-03-04 19:36:29 -08:00
Ilya Kreymer
f25de8af2a tweak travis pip install config 2014-03-04 19:17:33 -08:00
Ilya Kreymer
cc22448cc5 fixes for 2.6 and pypy 2014-03-04 19:11:17 -08:00
Ilya Kreymer
2d48f2d733 add testing of 2.6 and pypy (attempt) 2014-03-04 18:12:36 -08:00
Ilya Kreymer
349a1a7a3a add unit test to timeutils.py
tweak .travis.yml
2014-02-25 15:30:16 -08:00
Ilya Kreymer
b5d8accd1d trying different coveralls 2014-02-25 00:19:21 -08:00
Ilya Kreymer
7b9bc1ee3d fix .travis.yml 2014-02-24 23:45:37 -08:00
Ilya Kreymer
bf3a373e7e testing coveralls 2014-02-24 23:43:32 -08:00
Ilya Kreymer
2528ee0a7c refactoring of binsearch and cdxserver into seperate packages
also move complicated doctests and integration tests to tests/
2014-02-12 13:16:07 -08:00
Ilya Kreymer
2f5ffb3a88 switch test framework to use py.test instead of nose 2014-02-01 00:12:11 -08:00
Ilya Kreymer
cbf0e23ad9 add .travis.yml for Travis CI! 2014-01-23 16:20:51 -08:00