Comments (1)
OK I ended up spending a good part of today going down this rabbit hole 🐰
I have now isolated a minimal test case that replicates the issue: ruun this bit of code:
from defusedxml import ElementTree as ET
def parse_httpresponse():
"""Parse an HTTPResponse into xml."""
xml = ET.parse("response.html")
parse_httpresponse()
where response.html
is the API response from the example website in the failing test:
<!doctype html><html lang="en"><head><base href="/"/><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>ESGF MetaGrid</title><script async src="https://www.googletagmanager.com/gtag/js?id=G-515H3RKZYX"></script><script>function gtag(){dataLayer.push(arguments)}window.dataLayer=window.dataLayer||[],gtag("js",new Date),gtag("config","G-515H3RKZYX")</script><script defer="defer" src="/static/js/main.e7481ee3.js"></script><link href="/static/css/main.df7af308.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
This replicates exactly the test fail. Problem is, I have no idea why - moreover, test fail happens or doesn't with identical deps and envs (well, there are a couple deps that differ but those don't matter - see below the differing deps): deps that differ between an env with no test fail vs one with test fail:
3c3
< + alabaster 0.7.15 pyhd8ed1ab_0 conda-forge/noarch 19kB
---
> + alabaster 0.7.13 pyhd8ed1ab_0 conda-forge/noarch 18kB
26c26
< + flake8 7.0.0 pyhd8ed1ab_0 conda-forge/noarch 111kB
---
> + flake8 6.1.0 pyhd8ed1ab_0 conda-forge/noarch 112kB
35c35
< + ipython 8.20.0 pyh707e725_0 conda-forge/noarch 591kB
---
> + ipython 8.19.0 pyh707e725_0 conda-forge/noarch 591kB
41c41
< + jupyter_core 5.7.1 py312h7900ff3_0 conda-forge/linux-64 94kB
---
> + jupyter_core 5.7.0 py312h7900ff3_0 conda-forge/linux-64 92kB
86c86
< + pyflakes 3.2.0 pyhd8ed1ab_0 conda-forge/noarch 59kB
---
> + pyflakes 3.1.0 pyhd8ed1ab_0 conda-forge/noarch 58kB
98c98
< + referencing 0.32.1 pyhd8ed1ab_0 conda-forge/noarch 39kB
---
> + referencing 0.32.0 pyhd8ed1ab_0 conda-forge/noarch 39kB
122c122
< + wcwidth 0.2.13 pyhd8ed1ab_0 conda-forge/noarch 33kB
---
> + wcwidth 0.2.12 pyhd8ed1ab_0 conda-forge/noarch 32kB
Even so, I have resolved these differences and the test still fails for me (locally). My only take is that the HTTPResponse has changed (its body) from 3 weeks ago - problem is, I don't know what a right response should look like (one that can be parsed correctly) since I barely speak any HTML at all, @bouweandela any ideas?
from esgf-pyclient.
Related Issues (20)
- No consistent result from different queries (CMIP6) HOT 1
- `ignore_facet_check` search option appears to be broken
- Dependency problem (version mismatch between pyesgf and requests library) leading to AttributeError: module 'requests_cache' has no attribute 'core' HOT 5
- add "facets" keyword argument to DatasetResult.file_context
- New release? HOT 5
- Import trial of `MyProxyClient` in `pyesgf/logon.py` outputs misleading error and incompatibility with `cryptography` from Anaconda `main` channel HOT 2
- logon for http request HOT 2
- lm.logon timeout HOT 12
- Facets warning with aggregation_context(): unexpected keyword
- CMIP6 data availability? HOT 2
- logon does not allow access to all ESGF nodes HOT 13
- Unexpected number of results for large query
- Not matching all the expected files HOT 4
- logon refused from my laptop HOT 3
- Facets warning appears even when facets are specified HOT 5
- collection import errors from python 3.10 HOT 1
- [via MyProxyClient] Import of `MyProxyClient` fails due to complete retirement of `SafeConfigParser` in Python 3.12 HOT 2
- Fix `tests/test_results` test module
- 503 HTTPErrors should not be failing the tests
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esgf-pyclient.