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

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

Merged
merged 1 commit into from
Nov 16, 2023

Conversation

adzenith
Copy link
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
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
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.

CHANGELOG.md Outdated Show resolved Hide resolved
@adzenith
Copy link
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.
@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 bazelbuild:main with commit 2c82656 Nov 16, 2023
3 checks passed
@adzenith adzenith deleted the per-file-test-generation branch November 16, 2023 23:28
@adzenith
Copy link
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.

None yet

3 participants