Comments (3)
What I tried:
on an Ubuntu box:
Testing ESGF/master
- install as follows:
- create and activate a Python 3 virtual env, clone the repo, then in master do
pip install --ugrade pip
,pip install -r requirements.txt
,pip install .
- create and activate a Python 3 virtual env, clone the repo, then in master do
- test using:
cd tests
andpy.test
- many tests fail, for example:
============================================= FAILURES =============================================
_________________________________ TestConnection.test_blank_query __________________________________
Traceback (most recent call last):
File "/path/to/esgf-pyclient/tests/test_connection.py", line 24, in test_blank_query
json = conn.send_search({})
File "/tmp/venv/lib/python3.8/site-packages/pyesgf/search/connection.py", line 156, in send_search
self.open()
File "/tmp/venv/lib/python3.8/site-packages/pyesgf/search/connection.py", line 98, in open
self._passed_session, requests_cache.core.CachedSession)):
AttributeError: module 'requests_cache' has no attribute 'core'
_____________________________ TestConnection.test_connection_instance ______________________________
Traceback (most recent call last):
File "/path/to/esgf-pyclient/tests/test_connection.py", line 80, in test_connection_instance
session = requests_cache.core.CachedSession(self.cache,
AttributeError: module 'requests_cache' has no attribute 'core'
(a path munged above for privacy)
Overall: 35 failed, 13 passed, 12 skipped, 1 warning in 1.06s
Testing the larsbuntemeyer/requests_cache
branch
-
Then in the clone, add the remote https://github.com/larsbuntemeyer/esgf-pyclient . Check out the
requests_cache
from this remote and rerun the installation and the tests -
This time: most pass: 2 failed, 46 passed, 12 skipped, 1 warning in 336.30s (0:05:36)
Remaining failures are in: TestConnection.test_get_shard_list
and TestResults.test_batch_size_has_no_impact_on_results
. (There was also a failure in TestResults.test_shards_constrain4
due to timeout from esgf-node.llnl.gov, which was not repeatable when rerun.)
Both of these remaining failures were included in the 35 tests that were failing with module 'requests_cache' has no attribute 'core'
in master (i.e. tests which were not being run properly in master).
Of these:
- The failure in
TestConnection.test_get_shard_list
is an artefact of a previous wrong change - in this commit, line 46 oftests/test_connection.py
(change is not valid because replica shards at CEDA live on esgf-index2, hence only one shard on esgf-index1 and the assertion fails). We can separately revert this line. Failing at:
File "/path/to/esgf-pyclient/tests/test_connection.py", line 46, in test_get_shard_list
assert len(shards['esgf-index1.ceda.ac.uk']) > 1
AssertionError: assert 1 > 1
- The failure in
test_batch_size_has_no_impact_on_results
may be a genuine failure that we still need to fix. At least it is being tested properly now. Fails at:
Traceback (most recent call last):
File "/path/to/esgf-pyclient/tests/test_results.py", line 256, in test_batch_size_has_no_impact_on_results
assert len(ids_batch_size_50) == len(ids_batch_size_100)
AssertionError: assert 50 == 100
Conclusion
Recommend merge (and also revert Carsten's change to line 46 of tests/test_connection.py
)
from esgf-pyclient.
Leaving open until tests have been addressed, tagged: @alaniwi
from esgf-pyclient.
the install and test procedure is now changed to the modern conda+mamba env creation, pip install and pytest:
- mamba env create -n esgf-pyclient -f environment.yml
- pip install -e .[develop]
- pytest
There are number of tests that fail from test_results.py
module, and I have #98 open for that and a number of transitory fails due to ESGF servers' 503's that I opened #99 for, all other tests pass, and this can now be closed 👍
from esgf-pyclient.
Related Issues (20)
- Failing CI build: parsing of HTTPResponse by defusedxml.ElementTree HOT 1
- 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.