-
Notifications
You must be signed in to change notification settings - Fork 1k
chore(dev): changes for developer ergonomics #10816
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When running `make tests`, the current expectation is that the user has executed `make serve` and the database container is running in already. This brings in all the other runtime dependencies, when all the tests need is a running database instance. Setting the `depends_on` flag tells docker-compose to start the db container first, any time we run a `web` container, and saves us the step of starting it ourselves in another shell. Signed-off-by: Mike Fiedler <[email protected]>
The current settings for the elasticsearch container place the started node in "production, single node cluster" mode. This performs boostrap tests, one of which tests for virtual memory via the `sysctl` setting of `vm.max_map_count`. In certain Docker-in-Docker development environments, the end user may not have access to the underlying host settings, and cannot modify this setting. An alternative is to set the `discovery-type` to a single node, placing the service in "development mode", turning any bootstrap checks from errors to warnings. Refs: https://www.elastic.co/guide/en/elasticsearch/reference/7.10/system-config.html#dev-vs-prod Refs: https://www.elastic.co/guide/en/elasticsearch/reference/7.10/bootstrap-checks.html Originally reported in #1511, related to pypi#4370 Signed-off-by: Mike Fiedler <[email protected]>
coverage.py version 5.0 introduced the notion of measurement contexts. This adds details to the report to show: - how many times a given line was executed - which context executed a given line Enabling dynamic context measurement during the test execution adds test class/function contexts to the coverage data to be displayed on a given report output. Refs: https://coverage.readthedocs.io/en/6.3.2/contexts.html#dynamic-contexts Signed-off-by: Mike Fiedler <[email protected]>
Creating a port under 1024 often requires superuser privileges. In some environments this is disallowed. By using the built-in behavior from Docker Compose, a user can now set: WEB_PORT=8080 make serve and the web application will be made availabel on port 8080. The default remains port 80. Signed-off-by: Mike Fiedler <[email protected]>
supersedes #10265 |
ewdurbin
approved these changes
Feb 23, 2022
Thanks for the improvements and really detailed commit messages! |
domdfcoding
pushed a commit
to domdfcoding/warehouse
that referenced
this pull request
Jun 7, 2022
* chore(dev): set web to depend on db When running `make tests`, the current expectation is that the user has executed `make serve` and the database container is running in already. This brings in all the other runtime dependencies, when all the tests need is a running database instance. Setting the `depends_on` flag tells docker-compose to start the db container first, any time we run a `web` container, and saves us the step of starting it ourselves in another shell. Signed-off-by: Mike Fiedler <[email protected]> * chore(dev): set elasticsearch to single-node The current settings for the elasticsearch container place the started node in "production, single node cluster" mode. This performs boostrap tests, one of which tests for virtual memory via the `sysctl` setting of `vm.max_map_count`. In certain Docker-in-Docker development environments, the end user may not have access to the underlying host settings, and cannot modify this setting. An alternative is to set the `discovery-type` to a single node, placing the service in "development mode", turning any bootstrap checks from errors to warnings. Refs: https://www.elastic.co/guide/en/elasticsearch/reference/7.10/system-config.html#dev-vs-prod Refs: https://www.elastic.co/guide/en/elasticsearch/reference/7.10/bootstrap-checks.html Originally reported in pypi#1511, related to pypi#4370 Signed-off-by: Mike Fiedler <[email protected]> * chore: enable context reporting in coverage coverage.py version 5.0 introduced the notion of measurement contexts. This adds details to the report to show: - how many times a given line was executed - which context executed a given line Enabling dynamic context measurement during the test execution adds test class/function contexts to the coverage data to be displayed on a given report output. Refs: https://coverage.readthedocs.io/en/6.3.2/contexts.html#dynamic-contexts Signed-off-by: Mike Fiedler <[email protected]> * chore(dev): enable web port to be set via env var Creating a port under 1024 often requires superuser privileges. In some environments this is disallowed. By using the built-in behavior from Docker Compose, a user can now set: WEB_PORT=8080 make serve and the web application will be made availabel on port 8080. The default remains port 80. Signed-off-by: Mike Fiedler <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I found myself needing to set/reset these changes to be able to develop effectively.
Each commit has further description and context to explain more - happy to discuss further!