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
Use authentication enabled docker for integration test #4160
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4160 +/- ##
==========================================
- Coverage 73.85% 73.81% -0.04%
==========================================
Files 339 339
Lines 22786 22827 +41
==========================================
+ Hits 16828 16850 +22
- Misses 4676 4691 +15
- Partials 1282 1286 +4
... and 7 files with indirect coverage changes
Flags with carried forward coverage won't be shown. Click here to find out more. |
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.
Cool! This will also help with sessions testing too :)
I will check the security workflow failure |
Description
For
task test-integration-mongodb
, the imagemongodb_secured
is used which has authentication and authorization enable. It already has an user created in docker.Calling
setup.SetupWithOpts(t, &setup.SetupOpts{SetupUser: true})
creates an user withroot
authorization permission at the beginning of the test, use that authenticated user for the test and drops the user at the end. Since all test share the users inadmin.system.users
database, the unique username is used for each test.For
task test-integration-postgresql
andtask test-integration-sqlite
the listener is created within setup, and each test creates its own independent postgresql database or sqlite directory, so no other test accesses it.Calling
setup.SetupWithOpts(t, &setup.SetupOpts{SetupUser: true})
creates an user using local exception at the beginning of the test, and entire postgresql database is dropped at the end of the test.postgres://username@127.0.0.1:5432/testcommandsauthenticationlogoutauthenticateduser
file:../tmp/sqlite-tests/testcommandsauthenticationlogoutauthenticateduser/
Closes #4100.
Readiness checklist
task all
, and it passed.@FerretDB/core
), Milestone (Next
), Labels, Project and project's Sprint fields.