fix: Add [test] extra into options and include tests/ dir in package#656
Merged
alisonlhart merged 1 commit intoansible:mainfrom Jan 7, 2026
Merged
Conversation
a16146d to
dbbf53b
Compare
dbbf53b to
0a1f1c3
Compare
0a1f1c3 to
20429a6
Compare
20429a6 to
1e3be83
Compare
1e3be83 to
e130d35
Compare
e130d35 to
0a1ae44
Compare
cidrblock
approved these changes
Jan 7, 2026
Contributor
cidrblock
left a comment
There was a problem hiding this comment.
nice, can't wait to see it in action
renovate bot
added a commit
to sdwilsh/ansible-playbooks
that referenced
this pull request
Jan 9, 2026
##### [\`26.1.0\`](https://github.com/ansible/ansible-dev-tools/releases/tag/v26.1.0) #### Fixes - fix: Remove sonar.tests from config ([#658](ansible/ansible-dev-tools#658)) [@alisonlhart](https://github.com/alisonlhart) - fix: Add \[test] extra into options and include tests/ dir in package ([#656](ansible/ansible-dev-tools#656)) [@alisonlhart](https://github.com/alisonlhart) #### Maintenance - Add full exclusion path for tests/ in Sonarcloud config ([#663](ansible/ansible-dev-tools#663)) [@alisonlhart](https://github.com/alisonlhart) - chore: Upgrade navigator version to 26.1.1 ([#662](ansible/ansible-dev-tools#662)) [@alisonlhart](https://github.com/alisonlhart) - chore: Change django upper bound to <6.0 ([#659](ansible/ansible-dev-tools#659)) [@alisonlhart](https://github.com/alisonlhart) - fix: update dependencies with newest ansible devtools releases ([#657](ansible/ansible-dev-tools#657)) [@alisonlhart](https://github.com/alisonlhart)
sdwilsh
pushed a commit
to sdwilsh/ansible-playbooks
that referenced
this pull request
Jan 14, 2026
##### [\`26.1.0\`](https://github.com/ansible/ansible-dev-tools/releases/tag/v26.1.0) #### Fixes - fix: Remove sonar.tests from config ([#658](ansible/ansible-dev-tools#658)) [@alisonlhart](https://github.com/alisonlhart) - fix: Add \[test] extra into options and include tests/ dir in package ([#656](ansible/ansible-dev-tools#656)) [@alisonlhart](https://github.com/alisonlhart) #### Maintenance - Add full exclusion path for tests/ in Sonarcloud config ([#663](ansible/ansible-dev-tools#663)) [@alisonlhart](https://github.com/alisonlhart) - chore: Upgrade navigator version to 26.1.1 ([#662](ansible/ansible-dev-tools#662)) [@alisonlhart](https://github.com/alisonlhart) - chore: Change django upper bound to <6.0 ([#659](ansible/ansible-dev-tools#659)) [@alisonlhart](https://github.com/alisonlhart) - fix: update dependencies with newest ansible devtools releases ([#657](ansible/ansible-dev-tools#657)) [@alisonlhart](https://github.com/alisonlhart)
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
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.
Closes: AAP-52688
Description
Moves the
tests/dir inside the source directory and adds [tests] extra to only include test dependencies when needed.With tests included, we can run integration tests anywhere the package is installed.
This will allow us to run integration tests downstream directly from the package during container build.
Other changes
Has the server_url fixture self-start instead of requiring the
--include-serverflag, allowing us to start the server without the flag if necessary.Reasoning
When running tests via
pytest --pyargs ansible_dev_tools.tests...(from an installed package), pytest's hook execution order is:pytest_sessionstartfires before package discoveryconftest.py(with the server startup logic) isn't loaded until step 2So even if we had a
--include-serverflag, by the time pytest loads our conftest that registers the flag and starts the server,pytest_sessionstarthas already finished.The solution: Make the
server_urlfixture self-starting:pytest_sessionstarthook fires first, starts server, fixture detects it's runningThis allows the same tests to work both from source and from an installed package without any manual server startup.