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

tests: run postgres via pytest #15365

Merged
merged 9 commits into from Feb 16, 2024

Conversation

miketheman
Copy link
Member

Instead of running a separate container, allow the pytest plugin to
bootstrap its own postgres process.

Increases the development image by adding the postgres server package.

Changes the overall Docker runtime to run under a non-root user.

Signed-off-by: Mike Fiedler miketheman@gmail.com

Instead of running a separate container, allow the pytest plugin to
bootstrap its own postgres process.

Increases the development image by adding the postgres server package.

Changes the overall Docker runtime to run under a non-root user.

Signed-off-by: Mike Fiedler <miketheman@gmail.com>
Now that pytest controls the server behavior during tests, remove from
CI steps as well.

Signed-off-by: Mike Fiedler <miketheman@gmail.com>
@miketheman miketheman added testing Test infrastructure and individual tests developer experience Anything that improves the experience for Warehouse devs labels Feb 12, 2024
@miketheman miketheman requested a review from a team as a code owner February 12, 2024 15:49
Dockerfile Outdated Show resolved Hide resolved
Further isolates development from testing by using `app_config` fixture
instead of pulling the configuration from the environment.

Signed-off-by: Mike Fiedler <miketheman@gmail.com>
Copy link
Member

@ewdurbin ewdurbin left a comment

Choose a reason for hiding this comment

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

now that it's nobody i'm 👍🏼

just had to configure coverage to write to a directory owned by the user.

confirmed creating migrations works.

@miketheman miketheman merged commit 51d7c35 into pypi:main Feb 16, 2024
17 checks passed
@miketheman miketheman deleted the miketheman/run-pg-in-tests branch February 16, 2024 17:02
@miketheman
Copy link
Member Author

Looks like nobody kills /opt/warehouse/src/.pytest_cache/v/randomly_seed for the same reason of not being able to write to the homedir, which is a warning, not an error.

I'll look for toggles that move that file

miketheman added a commit to miketheman/warehouse that referenced this pull request Feb 16, 2024
With the change to have the main container run as `nobody`, move some
more application-root directories to `dev/`.

Refs: pypi#15365

Signed-off-by: Mike Fiedler <miketheman@gmail.com>
miketheman added a commit to miketheman/warehouse that referenced this pull request Feb 16, 2024
With the change to have the main container run as `nobody`, move some
more application-root directories to `dev/`.

Refs: pypi#15365

Signed-off-by: Mike Fiedler <miketheman@gmail.com>
di added a commit to di/warehouse that referenced this pull request Feb 22, 2024
di added a commit that referenced this pull request Feb 22, 2024
* Revert "tests: run postgres via pytest (#15365)"

This reverts commit 51d7c35.

* Add back billing configuration

* Add back test service

* Remove unneeded .coveragerc mount
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
developer experience Anything that improves the experience for Warehouse devs testing Test infrastructure and individual tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants