-
Notifications
You must be signed in to change notification settings - Fork 113
More capable HTTP-serving test environment #6153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report
@@ Coverage Diff @@
## master #6153 +/- ##
===========================================
- Coverage 89.70% 74.69% -15.02%
===========================================
Files 318 318
Lines 41854 41876 +22
===========================================
- Hits 37547 31280 -6267
- Misses 4307 10596 +6289
Continue to review full report at Codecov.
|
For this to work in a reliable way that needs no per-request fiddling, we have to ship the entire CA/cert shebang. A complete, pre-generated root CA, keys, and a 10-year certficiate+key for 'localhost' URLs is shipped under `datalad/tests/ca`. If it is detected, the internal HTTP server can be SSL-enable via the new flag `use_ssl` (off by default). On-startup the webserver is tested to have a functional SSL setup. If it cannot be confirmed `SkipTest` is raised. Dedicated tests for python-requests and stdlib-tooling are performed. For a complete setup: 1) a root CA must be deployed # deploy certificate on Debian sudo mkdir -p /usr/local/share/ca-certificates/ sudo cp datalad/tests/ca/ca-root.pem /usr/local/share/ca-certificates/datalad-root.crt sudo update-ca-certificates 2) python-requests must get the root CA in addition export REQUESTS_CA_BUNDLE="$(readlink -f datalad/tests/ca/ca_bundle.pem)" This is automatically done in `setup_package()` Afterwards a `python -m nose -s -v datalad.tests.test_tests_utils:test_serve_path_via_http` should confirm a working SSL setup.
Only do it inside the decorator that runs our internal test HTTP server, and only if it has SSL turned on -- in order to minimize potential interference with regular HTTPS requests elsewhere.
@@ -0,0 +1,33 @@ | |||
# Provenance info for the complete root CA/cert setup in this directory | |||
|
|||
password=OoTh9oM9 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is a password. It is OK to be here.
3c820c6
to
7343b94
Compare
The previous strict linkage between access protocols and IO implementation to generate test stores was pointless. This is a general pattern that needs to be altered throughout the codebase.
This requires a complex and fragile toolchain that is hard to maintain or require across testing environment. Given that HTTP vs HTTPS should not make THAT much of a difference, skip rather than fail to keep the focus on what matters most.
Thanks @yarikoptic for the hint
I will merge this, as soon as the tests pass. |
Uh oh!
There was an error while loading. Please reload this page.