Skip to content
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

[BUG] test_eqcorrscan.py fails when data download fails. #435

Open
darren-tpk opened this issue Nov 7, 2020 · 7 comments
Open

[BUG] test_eqcorrscan.py fails when data download fails. #435

darren-tpk opened this issue Nov 7, 2020 · 7 comments
Assignees
Labels
Milestone

Comments

@darren-tpk
Copy link

What do you need help with?

Hi, I am trying to install eqcorrscan but running test_eqcorrscan.py yields "61 failed, 260 passed, 103 errors". I am also trying to go through the tutorials in the docs, but it does not seem to run smoothly. I will raise separate issues as I go along, but I want to make sure the tests run correctly first.

Provide an example so that we can reproduce your problem

Install eqcorrscan via conda install, pip install pytest, run test_eqcorrscan.py.

What help would you like?

"61 failed, 260 passed, 103 errors" does not seem like expected behaviour. Is something not installing right?

What is your setup? (please complete the following information):**

  • Operating System: macOS 10.15.6
  • Python version: 3.8.6
  • EQcorrscan version: 0.4

See log here:
test_log.txt

@calum-chamberlain
Copy link
Member

calum-chamberlain commented Nov 7, 2020

Kia Ora Darren, it looks like the failed tests were due to a failure to download the test data: all the failed tests that I saw in the log seem to be associated with fails not existing.

Can you please try deleting the test_data directory (/Users/darrentpk/opt/anaconda3/envs/eqcorrscan/lib/python3.8/site-packages/eqcorrscan/tests/test_data) and trying again - this should prompt test_eqcorrscan.py to re-download the test dataset.

@darren-tpk
Copy link
Author

Thank you for the prompt response! I tried that, but it seems like the test data still failed to download. I have attached the log again, that includes me removing the test_data directory and running test_eqcorrscan.py twice.

test2_log.txt

@calum-chamberlain
Copy link
Member

Ah, apologies, it looks like you need to remove your ~/.eqcorrscan directory as well - the error at the start of the log:

shutil.Error: Destination path '/Users/darrentpk/.eqcorrscan/pytest.ini' already exists

was the failure to overwrite the existing directory that some other necessary files for running the tests are stored. This is annoying, sorry - this should have a change to this line to add in a check for the file and ask for a user response to allow the file to be overwritten, or keep the existing file.

Sorry about that Darren!

@darren-tpk
Copy link
Author

No worries! I just ran the test code again and it works well now, with only 1 failed test.
I've attached the latest log for your reference. I will be trying out the rest of the tutorials in the days to come. Thank you for your help!

test3_log.txt

@calum-chamberlain
Copy link
Member

Thanks for that. That one fail is an annoying doc test fail comparing 1 to 1.0 so nothing to worry about.

@calum-chamberlain
Copy link
Member

I'm actually going to re-open this as a reminder to make the test_eqcorrscan script more resilient to failed downloads.

It should:

  1. Take command line args to allow re-downloading without the user having to manually remove directories;
  2. Cope with config files already being there and ask the user if they want to replace them or keep the existing ones (in case the user has changed them)

It would also be good if the script could know what files were expected in the test_data directory and at least tell the user that tests will fail without those files. Not sure how to do that.

@calum-chamberlain calum-chamberlain changed the title [HELP] test_eqcorrscan.py yielding numerous failed tests [BUG] test_eqcorrscan.py fails when data download fails. Nov 8, 2020
@calum-chamberlain calum-chamberlain self-assigned this Nov 8, 2020
@calum-chamberlain calum-chamberlain added this to the 0.4.3 milestone Nov 8, 2020
@calum-chamberlain
Copy link
Member

Bumping to 0.5.0 as we need to get 0.4.3 out and I won't have time to make this improvement before then.

@calum-chamberlain calum-chamberlain modified the milestones: 0.4.3, 0.5.0 Mar 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants