From a70be1f9581741eb93558c4a726a75c2e5eec61f Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Thu, 9 Mar 2023 00:08:14 -0600 Subject: [PATCH 1/5] chore(pants): reclassify st2common/tests/unit/base.py as test_utils not sources It makes more sense for the files in the tests directory to be "test_utils" instead of regular sources. It does not make a functional difference to pants, but I feel it captures the intent of those files better. The canonical example of "test_utils" is conftest.py which we might switch to later once we finish transitioning to pytest. --- st2common/tests/unit/BUILD | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/st2common/tests/unit/BUILD b/st2common/tests/unit/BUILD index 2373cbcd46..53db304442 100644 --- a/st2common/tests/unit/BUILD +++ b/st2common/tests/unit/BUILD @@ -12,4 +12,6 @@ python_tests( uses=["mongo", "rabbitmq"], ) -python_sources() +python_test_utils( + sources=["*.py", "!test_*.py"], +) From 39d29824d404369696d352382e5c95063ca24994 Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Thu, 9 Mar 2023 00:54:35 -0600 Subject: [PATCH 2/5] chore(pants): reclassify st2client/tests/*.py as test_utils --- st2client/tests/BUILD | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/st2client/tests/BUILD b/st2client/tests/BUILD index abb3713743..9fffb418a0 100644 --- a/st2client/tests/BUILD +++ b/st2client/tests/BUILD @@ -4,4 +4,6 @@ __defaults__( ) ) -python_sources() +python_test_utils( + sources=["*.py"], +) From 792d47ac8c2dcd84904adc90915ef4122103a0c4 Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Thu, 9 Mar 2023 12:03:24 -0600 Subject: [PATCH 3/5] chore(pants): reclassify contrib/runners/orquesta_runner/tests/unit/base.py as test_utils not sources --- contrib/runners/orquesta_runner/tests/unit/BUILD | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contrib/runners/orquesta_runner/tests/unit/BUILD b/contrib/runners/orquesta_runner/tests/unit/BUILD index f52633177d..772d9fbddb 100644 --- a/contrib/runners/orquesta_runner/tests/unit/BUILD +++ b/contrib/runners/orquesta_runner/tests/unit/BUILD @@ -11,4 +11,6 @@ python_tests( ], ) -python_sources() +python_test_utils( + sources=["*.py", "!test_*.py"], +) From be982ec656dfd2e7016f91f1cbfc35ea0ba0011d Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Thu, 9 Mar 2023 14:13:33 -0600 Subject: [PATCH 4/5] update changelog entry --- CHANGELOG.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 5683d412f0..9cc2bf74a4 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -16,7 +16,7 @@ Added to pants' use of PEX lockfiles. This is not a user-facing addition. #5778 #5789 #5817 #5795 #5830 #5833 #5834 #5841 #5840 #5838 #5842 #5837 #5849 #5850 #5846 #5853 #5848 #5847 #5858 #5857 #5860 #5868 #5871 #5864 #5874 #5884 #5893 #5891 - #5890 #5898 #5901 #5906 #5899 #5907 #5909 #5922 + #5890 #5898 #5901 #5906 #5899 #5907 #5909 #5922 #5926 Contributed by @cognifloyd * Added a joint index to solve the problem of slow mongo queries for scheduled executions. #5805 From cc72ea2a6e4e183ace160541b13af72b0f536d52 Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Thu, 9 Mar 2023 20:22:26 -0600 Subject: [PATCH 5/5] reclassify st2tests/integration/orquesta as test_utils --- st2tests/integration/orquesta/BUILD | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/st2tests/integration/orquesta/BUILD b/st2tests/integration/orquesta/BUILD index e2d2f13e20..5b6c97ec1f 100644 --- a/st2tests/integration/orquesta/BUILD +++ b/st2tests/integration/orquesta/BUILD @@ -1,6 +1,8 @@ -python_sources() - python_tests( name="tests", uses=["redis"], ) + +python_test_utils( + sources=["*.py", "!test_*.py"], +)