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

Fail redis and mongo tests if incorrect URI provided + some storages tests refactoring #1510

Merged
merged 17 commits into from
Jun 16, 2024

Conversation

Rishat-F
Copy link
Contributor

@Rishat-F Rishat-F commented Jun 13, 2024

Description

If incorrect URIs provided to "--redis" and/or "--mongo" options tests should fail with errors instead of skipping.
Otherwise the next scenario is possible:

  1. developer breaks RedisStorage and/or MongoStorage code
  2. tests are run with incorrect redis and/or mongo URIsprovided by "--redis" and "--mongo" options (for example, wrong port specified)
  3. tests pass because skipping doesn't fail tests run
  4. developer or reviewer doesn't notice that redis and/or mongo tests were skipped
  5. broken code gets in codebase

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • New and existing unit tests pass locally with my changes

By default serverSelectionTimeoutMS=30000. This is too much
If incorrect URIs provided to "--redis" and/or "--mongo" options
tests should fail with ERRORs instead of skipping.
Otherwise the next scenario is possible:
  1) developer breaks RedisStorage and/or MongoStorage code
  2) tests are run with incorrect redis and/or mongo URIs
     provided by "--redis" and "--mongo" options.
     For example, wrong port specified.
  3) tests pass because skipping doesn't fail tests run
  4) developer or reviewer doesn't notice
     that redis and/or mongo tests were skipped
  5) broken code gets in codebase
@github-actions github-actions bot added the 3.x Issue or PR for stable 3.x version label Jun 13, 2024
Copy link

github-actions bot commented Jun 13, 2024

✔️ Changelog found.

Thank you for adding a description of the changes

Copy link

codecov bot commented Jun 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (7760ab1) to head (c644867).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           dev-3.x     #1510   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          436       436           
  Lines        11294     11294           
=========================================
  Hits         11294     11294           
Flag Coverage Δ
unittests 100.00% <ø> (ø)

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

Files Coverage Δ
aiogram/filters/command.py 100.00% <ø> (ø)

Copy link
Contributor

@Olegt0rr Olegt0rr left a comment

Choose a reason for hiding this comment

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

LGTM, but make 100% coverage, please

@Rishat-F
Copy link
Contributor Author

LGTM, but make 100% coverage, please

Done

examples/multibot.py Show resolved Hide resolved
tests/conftest.py Outdated Show resolved Hide resolved
Copy link
Member

@JrooTJunior JrooTJunior left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution.

I will update the changelog message and category, this change does not affect the functionality of the framework, but improves the development process of the framework itself, so these changes should be marked as "misc" and not as "bugfixes".

@JrooTJunior JrooTJunior merged commit 1df3ada into aiogram:dev-3.x Jun 16, 2024
25 checks passed
@Rishat-F Rishat-F deleted the redis_mongo_storages_tests branch June 17, 2024 03:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.x Issue or PR for stable 3.x version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants