-
Notifications
You must be signed in to change notification settings - Fork 77
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 an issue with invalid build number for candidate scraper #607
Conversation
Now scraper fails when invalid build number is used instead of downloading other build Fixes issue #445
Fixed build numbers in devedition tests
Hi @whimboo, could you review please? |
Hi @whimboo, friendly reminder :) |
Sorry for the delay. I was kinda swamped with other work the last weeks. I will try my best to get to the review tomorrow. |
No worries, thank you. |
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.
Thanks for your patch, and sorry again for the long delay in review. The patch in general works fine, but there are some inline comments I would like to see explained/fixed before we can get it landed.
@@ -39,18 +39,18 @@ def test_release_scraper(tmpdir, args, url): | |||
|
|||
@pytest.mark.ci_only | |||
@pytest.mark.parametrize("args,url", [ | |||
({'application': 'devedition', 'platform': 'linux', 'version': '60.0b1', 'build_number': 1}, |
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.
Can you please explain, why you've made these changes?
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.
Every test case here has build 3 in its URL, for example:
devedition/candidates/60.0b1-candidates/build3/linux-i686/en-US/firefox-60.0b1.tar.bz2
Before the fix, if build with requested build_number was not found, then first build was used. So these tests started failing after the fix because build_number 1 was used as an argument.
So I have fixed tests to use build_number 3.
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.
Oh! What an oversight when we created those tests. Good that we cover those cases now. Thanks for explaining.
args = {'application': 'firefox', 'build_number': '2', 'platform': 'linux', 'version': '23.0.1'} | ||
|
||
with pytest.raises(errors.NotSupportedError): | ||
ReleaseCandidateScraper(destination=tmpdir, base_url=httpd.get_url(), **args) |
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.
Please add a new line at the end.
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.
ok
mozdownload/scraper.py
Outdated
self.logger.info('Selected build: %s' % | ||
(parser.entries[self.build_index])) | ||
message = 'Selected build not available!' | ||
self.logger.info(message) |
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.
No need to log this extra line. Immediately raise the error.
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.
ok
@@ -6,22 +6,29 @@ | |||
|
|||
import pytest | |||
|
|||
from mozdownload import ReleaseCandidateScraper | |||
from mozdownload import ReleaseCandidateScraper, errors |
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.
We try to keep the alphabetical order of imports. So please exchange both entries.
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.
ok
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.
Thanks for your patch, and sorry again for the long delay in review. The patch in general works fine, but there are some inline comments I would like to see explained/fixed before we can get it landed.
Thank you for comments.
args = {'application': 'firefox', 'build_number': '2', 'platform': 'linux', 'version': '23.0.1'} | ||
|
||
with pytest.raises(errors.NotSupportedError): | ||
ReleaseCandidateScraper(destination=tmpdir, base_url=httpd.get_url(), **args) |
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.
ok
And added new line in the end of test_release_candidate_scraper_indices.py
Friendly reminder :) |
Sorry, but I was on PTO for a while. I will get back as soon as possible. |
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.
Thanks a lot for your work and I'm very sorry for all the delays in reviewing this PR.
@@ -39,18 +39,18 @@ def test_release_scraper(tmpdir, args, url): | |||
|
|||
@pytest.mark.ci_only | |||
@pytest.mark.parametrize("args,url", [ | |||
({'application': 'devedition', 'platform': 'linux', 'version': '60.0b1', 'build_number': 1}, |
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.
Oh! What an oversight when we created those tests. Good that we cover those cases now. Thanks for explaining.
No problem. Thank you for accepting changes. |
Now scraper fails when invalid build number is used instead of downloading other build
Fixes issue #445