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
Check pagination links->next with validator #266
Conversation
7e32ded
to
f5e21a3
Compare
Codecov Report
@@ Coverage Diff @@
## master #266 +/- ##
==========================================
- Coverage 89.32% 89.15% -0.17%
==========================================
Files 54 54
Lines 2220 2241 +21
==========================================
+ Hits 1983 1998 +15
- Misses 237 243 +6
Continue to review full report at Codecov.
|
ce647d6
to
48490b0
Compare
Having lots of fun getting the docker server under CI to return the right base URL in pagination links... |
48490b0
to
fc14aad
Compare
Done now, with a bit of a CI-specific hack to the config file. |
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.
Great! Thanks @ml-evs !
We're slowly turning our tests over to the validator, as it should be.
I have some comments and suggestions for improvements, hope they help :)
fc14aad
to
5599411
Compare
Co-authored-by: Casper Welzel Andersen <CasperWA@users.noreply.github.com>
5599411
to
185dc70
Compare
Thanks for the review @CasperWA, think I've implemented the spirit of your suggestions if not the exact letter of them :) |
fffc4b1
to
a46a09c
Compare
a46a09c
to
abbcf54
Compare
abbcf54
to
1e6ea44
Compare
Co-authored-by: Casper Welzel Andersen <CasperWA@users.noreply.github.com>
Co-authored-by: Casper Welzel Andersen <CasperWA@users.noreply.github.com>
1e6ea44
to
cd0beb2
Compare
Co-authored-by: Casper Welzel Andersen <CasperWA@users.noreply.github.com>
cd0beb2
to
8d28119
Compare
It seems the validator is not getting the version included in it's calls to the Dockerized server. |
Ugh, looks like |
Think we're finally there, don't really want to make any other tweaks to the validator in this PR as it probably need a full refactoring pass to do it properly. |
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.
It sure is looking great now, thanks @ml-evs!
I have only a single comment (with included change suggestion) left.
I will approve now, if you don't feel the change is needed, otherwise, please apply and I'll re-approve for you to squash+merge.
@@ -113,10 +120,12 @@ def get(self, request: str): | |||
the `MAX_RETRIES` attempts. | |||
|
|||
""" | |||
if request: | |||
self.last_request = f"{self.base_url}{request}".replace("\n", "") | |||
if urllib.parse.urlparse(request, allow_fragments=True).scheme: |
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.
Do you still want to make sure the scheme
is part of ("http", "https")
or do we not care? If yes, here's a quick and dirty suggestion:
if urllib.parse.urlparse(request, allow_fragments=True).scheme: | |
request_scheme = urllib.parse.urlparse(request, allow_fragments=True).scheme | |
if request_scheme and request_scheme in ("http", "https"): |
Otherwise, fine 👍
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.
I'm going to leave it as is, on the off-chance that an implementation provides a different scheme (presumably accidentally) then it will be obvious from the error spat out. Your suggested change would lead to the next request being e.g. http://base_url.com/ssh://base_url.com?page_offset=5
, so I think it's clearer as is.
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.
Sure. Then the docstring should probably have been updated, but fine.
Again, I just want to be really nitpicky with everything in the validator since (in my opinion) it should be usable for every and any implementation. I.e., it should be really specific in what it wants, while at the same time being very broad in scope.. not easy :)
Closes #265.