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

fix-fix-1971 #2001

Merged
merged 8 commits into from
Nov 29, 2016
Merged

fix-fix-1971 #2001

merged 8 commits into from
Nov 29, 2016

Conversation

antgonza
Copy link
Member

Turns out that when the EBI submission fails, we populate the ebi_experiment_accessions with Nones, which is the expected behavior.

@josenavas
Copy link
Contributor

Is it possible to add a test?

@antgonza
Copy link
Member Author

Not sure, suggestions?

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.03%) to 91.372% when pulling 04b40be on antgonza:fix-fix-1971 into b5c82d9 on biocore:master.

@@ -173,7 +173,8 @@ def study_prep_get_req(study_id, user_id):
info['start_artifact_id'] = start_artifact.id
info['youngest_artifact'] = '%s - %s' % (
youngest_artifact.name, youngest_artifact.artifact_type)
info['ebi_experiment'] = bool(prep.ebi_experiment_accessions)
info['ebi_experiment'] = bool(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am likely missing something, this is going to generate a list of "accessions", and if some are None, they will still be included in the resulting list, right? There's no filter being applied here. Otherwise, what's the goal of enumerating explicitly the values? If this is still the correct approach, maybe it would be shorter to use bool(prep.ebi_experiment_accessions.values()).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Long day already, you are 100% right! Fixing.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using the .values() method wouldn't work here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems more concise, but not necessary. This is good to be merged pending @josenavas' comment.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.03%) to 91.372% when pulling ba853f3 on antgonza:fix-fix-1971 into b5c82d9 on biocore:master.

Copy link
Member Author

@antgonza antgonza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess, do you have a preference?

@@ -173,7 +173,8 @@ def study_prep_get_req(study_id, user_id):
info['start_artifact_id'] = start_artifact.id
info['youngest_artifact'] = '%s - %s' % (
youngest_artifact.name, youngest_artifact.artifact_type)
info['ebi_experiment'] = bool(prep.ebi_experiment_accessions)
info['ebi_experiment'] = bool(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Long day already, you are 100% right! Fixing.

@josenavas
Copy link
Contributor

@antgonza I think the only way to test this will be to emulate a failed EBI submission adding Nones in the DB as ebi_experiment_accession numbers for one artifact. Do you think that it can be done?

@antgonza
Copy link
Member Author

@josenavas, @ElDeveloper, can you guys check why this is failing ... can't find the reason! Thanks.

@ElDeveloper
Copy link
Member

Can't quite tell what is it that's leading to the mismatch in statuses. Could it be something to do with "reseting the database" or not resetting it? (just guessing).

@antgonza
Copy link
Member Author

Thought about that and pull the latests version to check locally and it works fine. To test, I'm changing the order of the asserts in those tests ...

@josenavas
Copy link
Contributor

@antgonza I think the errors here are related with the test that you added. Remember that now the tests are not independent unless you write them in that way. Probably your test is altering the data that those other tests are accessing.

@antgonza
Copy link
Member Author

@josenavas the issue is that I originally only modified qiita_pet/handlers/api_proxy/tests/test_studies.py and the errors are in qiita_ware/test/test_dispatchable.py (I modified test_dispatchable.py later to see if we could get more insight into the problem) so either the DB reset is not working in test_studies.py or I'm missing something, not sure ... any ideas?


# (A)
# ignoring warnings generated when adding templates
simplefilter("ignore")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already discussed with @antgonza offline but noticing here for others in the thread. The problem is that this line is ignoring the warning and this applies to all future tests

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.005%) to 91.424% when pulling 09d23db on antgonza:fix-fix-1971 into d54f533 on biocore:master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants