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

Add regression test for #5621 #5635

Merged
merged 11 commits into from
Apr 20, 2021

Conversation

thehesiod
Copy link
Contributor

What do these changes do?

Adds regression test for issue #5621

Are there changes in behavior for the user?

Related issue number

#5621

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes
  • If you provide code modification, please add yourself to CONTRIBUTORS.txt
    • The format is <Name> <Surname>.
    • Please keep alphabetical order, the file is sorted by names.
  • Add a new news fragment into the CHANGES folder
    • name it <issue_id>.<type> for example (588.bugfix)
    • if you don't have an issue_id change it to the pr id after creating the pr
    • ensure type is one of the following:
      • .feature: Signifying a new feature.
      • .bugfix: Signifying a bug fix.
      • .doc: Signifying a documentation improvement.
      • .removal: Signifying a deprecation or removal of public API.
      • .misc: A ticket has been closed, but it is not of interest to users.
    • Make sure to use full sentences with correct case and punctuation, for example: "Fix issue with non-ascii contents in doctest text files."

@thehesiod thehesiod requested a review from asvetlov as a code owner April 20, 2021 14:36
@thehesiod
Copy link
Contributor Author

master version of #5633

@thehesiod thehesiod mentioned this pull request Apr 20, 2021
5 tasks
@webknjaz
Copy link
Member

@thehesiod could you drop those unrelated file changes with typings?

@webknjaz
Copy link
Member

Also, the linter is unhappy :( Those annoying style issues should be fixed...

@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Apr 20, 2021
@thehesiod
Copy link
Contributor Author

@thehesiod could you drop those unrelated file changes with typings?

if I don't keep those there are PEP typing warnings in the file

@thehesiod
Copy link
Contributor Author

sigh, not sure why mypy is complaining, pycharm is happy, seems like it doesn't recognize Union, I'll revert then and keep the warning

@thehesiod
Copy link
Contributor Author

ah, figured it out

@@ -144,14 +144,14 @@ async def start_server(self, **kwargs: Any) -> None:
async def _make_runner(self, **kwargs: Any) -> BaseRunner:
pass

def make_url(self, path: str) -> URL:
def make_url(self, path: Union[str, URL]) -> URL:
Copy link
Member

Choose a reason for hiding this comment

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

If these changes are necessary, please submit them in a separate PR with a separate changelog fragment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed

@codecov
Copy link

codecov bot commented Apr 20, 2021

Codecov Report

Merging #5635 (cdd4301) into master (a726db1) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #5635   +/-   ##
=======================================
  Coverage   97.17%   97.17%           
=======================================
  Files          41       41           
  Lines        8865     8865           
  Branches     1425     1425           
=======================================
  Hits         8615     8615           
  Misses        133      133           
  Partials      117      117           
Flag Coverage Δ
unit 97.06% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a726db1...cdd4301. Read the comment docs.

async def handler(_):
return web.Response()

app.router.add_get("/467%2C802%2C24834%2C24952%2C25362%2C40574/hello", handler)
Copy link
Member

Choose a reason for hiding this comment

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

Why doesn't this one have a regex? If the reproducer doesn't depend on it, why don't we just remove it from the first test too? Also, the URL is quite long and since the test doesn't seem to be influenced by its length, let's just make it 2-character, one char would be ascii and the other one would be something urlencoded — this will reduce the cognitive load for the readers.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it doesn't need a regex, this is ensuring you can't have a match to an escaped path

Copy link
Member

Choose a reason for hiding this comment

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

I have a feeling that the first test doesn't need that either. Just register a decoded route, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

correct, I've written it to match the actual bug in our production system. I think it's worth keeping both ways to ensure both the regex works and the non regex, resulting in more code coverage

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok cool, I wasn't sure if you guys like separate tests or combo tests

Copy link
Member

Choose a reason for hiding this comment

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

Okay, then, please incorporate the earlier parametrization suggestions and keep both cases as params.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

tests/test_web_urldispatcher.py Outdated Show resolved Hide resolved
tests/test_web_urldispatcher.py Outdated Show resolved Hide resolved
tests/test_web_urldispatcher.py Outdated Show resolved Hide resolved
tests/test_web_urldispatcher.py Outdated Show resolved Hide resolved
tests/test_web_urldispatcher.py Show resolved Hide resolved
tests/test_web_urldispatcher.py Outdated Show resolved Hide resolved
CHANGES/5635.misc Outdated Show resolved Hide resolved
thehesiod and others added 3 commits April 20, 2021 09:15
Co-authored-by: Sviatoslav Sydorenko <[email protected]>
Co-authored-by: Sviatoslav Sydorenko <[email protected]>
Co-authored-by: Sviatoslav Sydorenko <[email protected]>
@webknjaz webknjaz merged commit 09ac1cb into aio-libs:master Apr 20, 2021
@patchback
Copy link
Contributor

patchback bot commented Apr 20, 2021

Backport to 3.8: 💚 backport PR created

✅ Backport PR branch: patchback/backports/3.8/09ac1cbb4c07b4b3e1872374808512c9bc52f2ab/pr-5635

Backported as #5636

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Apr 20, 2021
Co-authored-by: Sviatoslav Sydorenko <[email protected]>
(cherry picked from commit 09ac1cb)
webknjaz added a commit that referenced this pull request Apr 20, 2021
Co-authored-by: Sviatoslav Sydorenko <[email protected]>
Co-authored-by: Alexander Mohr <[email protected]>
commonism pushed a commit to commonism/aiohttp that referenced this pull request Apr 27, 2021
commonism pushed a commit to commonism/aiohttp that referenced this pull request Apr 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot:chronographer:provided There is a change note present in this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants