Skip to content

feat(gazelle): allow per-file py_test generation#1563

Merged
rickeylev merged 1 commit intobazel-contrib:mainfrom
adzenith:per-file-test-generation
Nov 16, 2023
Merged

feat(gazelle): allow per-file py_test generation#1563
rickeylev merged 1 commit intobazel-contrib:mainfrom
adzenith:per-file-test-generation

Conversation

@adzenith
Copy link
Copy Markdown
Contributor

Previously the per-file target generation only worked for py_library targets. This change makes it so that this feature works for py_test targets as well.
The change is careful to not affect any existing tests, so I'm not sure if it should count as a breaking change. New tests have been added to check the new functionality.

@aignas
Copy link
Copy Markdown
Collaborator

aignas commented Nov 15, 2023

Right now if there is no __test__ target or __test__.py file in the current package, gazelle should generate separate py_test targets. Is this PR adding functionality for cases where there is __test__ target and more than one _test.py file, which was not handled previously?

@adzenith
Copy link
Copy Markdown
Contributor Author

Yes, that's correct. You're right that it worked as expected before in cases where there was no target named __test__ or file named __test__.py. This PR changes those scenarios to create separate targets as well.

@adzenith adzenith force-pushed the per-file-test-generation branch from 02b81ef to c993bec Compare November 16, 2023 04:25
@adzenith
Copy link
Copy Markdown
Contributor Author

I clarified the changelog and added a second file to both those directories. Thanks for the feedback!

Previously the per-file target generation only worked for py_library
targets. This change makes it so that this works for py_test targets
as well. The change is careful to not affect any existing tests, and
new tests have been added to check the new functionality.
@adzenith adzenith force-pushed the per-file-test-generation branch from c993bec to 9f3e4cf Compare November 16, 2023 04:26
@rickeylev rickeylev removed their request for review November 16, 2023 20:13
@rickeylev rickeylev added this pull request to the merge queue Nov 16, 2023
Merged via the queue into bazel-contrib:main with commit 2c82656 Nov 16, 2023
@adzenith adzenith deleted the per-file-test-generation branch November 16, 2023 23:28
@adzenith
Copy link
Copy Markdown
Contributor Author

Thanks!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants