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

pants: disambiguate test file dependencies #5833

Merged
merged 2 commits into from
Dec 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Added
* Continue introducing `pants <https://www.pantsbuild.org/docs>`_ to improve DX (Developer Experience)
working on StackStorm, improve our security posture, and improve CI reliability thanks in part
to pants' use of PEX lockfiles. This is not a user-facing addition.
#5778 #5789 #5817 #5795 #5830
#5778 #5789 #5817 #5795 #5830 #5833
Contributed by @cognifloyd


Expand Down
13 changes: 12 additions & 1 deletion contrib/core/tests/BUILD
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
python_tests()
python_tests(
overrides={
"test_action_sendmail.py": {
"dependencies": [
# contrib/core is symlinked to st2tests/st2tests/fixtures/packs/core
# so pants thinks "mail-parser" is defined twice, making it ambiguous.
# Use contrib/core as the canonical copy.
"contrib/core:reqs#mail-parser",
],
}
},
)
11 changes: 10 additions & 1 deletion contrib/packs/tests/BUILD
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
python_tests()
python_tests(
overrides={
"test_action_download.py": {
"dependencies": [
# imports tests.fixtures which is ambiguous. Tell pants which one to use.
"contrib/packs/tests/fixtures",
],
}
},
)
4 changes: 4 additions & 0 deletions contrib/runners/orquesta_runner/tests/unit/BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
python_tests(
name="tests",
dependencies=[
# most files import tests.unit.base which is ambiguous. Tell pants which one to use.
"contrib/runners/orquesta_runner/tests/unit/base.py",
],
)

python_sources()
4 changes: 4 additions & 0 deletions st2auth/tests/unit/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
python_tests(
name="tests",
dependencies=[
# most files import tests.base which is ambiguous. Tell pants which one to use.
"st2auth/tests/base.py",
],
)
4 changes: 4 additions & 0 deletions st2auth/tests/unit/controllers/v1/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
python_tests(
name="tests",
dependencies=[
# most files import tests.base which is ambiguous. Tell pants which one to use.
"st2auth/tests/base.py",
],
)
4 changes: 4 additions & 0 deletions st2client/tests/unit/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
python_tests(
name="tests",
dependencies=[
# most files import tests.base which is ambiguous. Tell pants which one to use.
"st2client/tests/base.py",
],
)
4 changes: 4 additions & 0 deletions st2common/tests/unit/BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
python_tests(
name="tests",
dependencies=[
# several files import tests.unit.base which is ambiguous. Tell pants which one to use.
"st2common/tests/unit/base.py",
],
)

python_sources()