-
-
Notifications
You must be signed in to change notification settings - Fork 749
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
Run more tests via Pants + pytest #6202
base: master
Are you sure you want to change the base?
Commits on Sep 12, 2024
-
Lockfile diff: lockfiles/pants-plugins.lock [pants-plugins] == Upgraded dependencies == pantsbuild-pants 2.22.0 --> 2.23.0a0 pantsbuild-pants-testutil 2.22.0 --> 2.23.0a0 pex 2.3.1 --> 2.16.2 typing-extensions 4.3.0 --> 4.12.2 == Added dependencies == libcst 1.4.0
Configuration menu - View commit details
-
Copy full SHA for bce1194 - Browse repository at this point
Copy the full SHA bce1194View commit details -
pants: rename [export].py_hermetic_scripts option
It is now a per-resolve option: [export].py_non_hermetic_scripts_in_resolve = ["st2"]
Configuration menu - View commit details
-
Copy full SHA for 0046645 - Browse repository at this point
Copy the full SHA 0046645View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1e91b62 - Browse repository at this point
Copy the full SHA 1e91b62View commit details -
Configuration menu - View commit details
-
Copy full SHA for dc9f98b - Browse repository at this point
Copy the full SHA dc9f98bView commit details -
Configuration menu - View commit details
-
Copy full SHA for d85903a - Browse repository at this point
Copy the full SHA d85903aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 60b5814 - Browse repository at this point
Copy the full SHA 60b5814View commit details -
use fixtures imports for test_content_loader
First, add metadata so pants can load the packs base path fixtures from st2common/resources for the content laoder tests. Second, add a fixture.py file in each base path, similar to the fixtures we have in st2tests, so that pants dependency inferrence can see where these fixtures are used. Third, the fixture file ended up creating a __pycache__ directory in the packs base paths which made tests fail due to an unexpected extra "pack" named "__pycache__". So, I excluded that as a valid pack name.
Configuration menu - View commit details
-
Copy full SHA for 7228e10 - Browse repository at this point
Copy the full SHA 7228e10View commit details -
use fixtures imports for test_logger
First, add metadata so pants can load the conf fixture from st2common/tests/resources for the logger test. Second, add a fixture.py file, similar to the fixtures we have in st2tests, so that pants dependency inferrence can see where these fixtures are used.
Configuration menu - View commit details
-
Copy full SHA for 4aefa9d - Browse repository at this point
Copy the full SHA 4aefa9dView commit details -
use fixture import for test_plugin_loader
First, add metadata so pants can load the loadableplugin fixture from st2common/tests/resources for the plugin loader test. Second, add a fixture.py file, similar to the fixtures we have in st2tests, so that pants dependency inferrence can see where these fixtures are used.
Configuration menu - View commit details
-
Copy full SHA for 9fddea6 - Browse repository at this point
Copy the full SHA 9fddea6View commit details -
pants: ignore test_dist_utils.py since we already ignore dist_utils.py
Once pants can build our packages, all of the dist_utils bits should be deleted.
Configuration menu - View commit details
-
Copy full SHA for 717e2d0 - Browse repository at this point
Copy the full SHA 717e2d0View commit details -
pants: fix running st2common/tests/unit/test_policies.py by adding de…
…pendency metadata
Configuration menu - View commit details
-
Copy full SHA for 1707923 - Browse repository at this point
Copy the full SHA 1707923View commit details -
Configuration menu - View commit details
-
Copy full SHA for c90fd8b - Browse repository at this point
Copy the full SHA c90fd8bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 81bf32e - Browse repository at this point
Copy the full SHA 81bf32eView commit details -
tests: Ensure tests can run in isolation
Various tests were relying on the side effects of tests that nosetest runs before they ran. These include: - 3 in test_action_alias_utils.py::TestInjectImmutableParameters - 2 in test_jinja_render_data_filters.py - 1 in test_logging_middleware.py - 9 in test_operators.py::SearchOperatorTest - 3 in test_util_payload.py In particular, the oslo config initialization from the tests in st2common/tests/unit/services/ happens before these test ran, obscuring their dependence on this initialization. Pants runs each test file separately for fine-grained caching.
Configuration menu - View commit details
-
Copy full SHA for 49f7253 - Browse repository at this point
Copy the full SHA 49f7253View commit details -
Configuration menu - View commit details
-
Copy full SHA for a7d435c - Browse repository at this point
Copy the full SHA a7d435cView commit details -
Configuration menu - View commit details
-
Copy full SHA for c54dafc - Browse repository at this point
Copy the full SHA c54dafcView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1f1ae2e - Browse repository at this point
Copy the full SHA 1f1ae2eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8a2f489 - Browse repository at this point
Copy the full SHA 8a2f489View commit details -
tests: drop unnecessary calls to tests_config.parse_args()
This looks like copy pasta as some of these files have a comment saying that running this before importing something else is required. However, by importing st2tests, that already implicitly happens in st2tests/st2tests/base.py. Then tests_config.parse_args() gets called again in the class init. Plus, I reviewed all the other imports, and none of them have import time side effects that matter for oslo config bits. So, these calls are not necessary, and the comments about them are wrong.
Configuration menu - View commit details
-
Copy full SHA for 785add8 - Browse repository at this point
Copy the full SHA 785add8View commit details -
tests: add missing monkey_patch for isolated test support
pants runs each test file separately. test_workflow_rerun only worked under nosetest because earlier files already did the monkey_patch. Without this, running this file in isolation, with either nosetest or pytest, hangs.
Configuration menu - View commit details
-
Copy full SHA for 88a5d88 - Browse repository at this point
Copy the full SHA 88a5d88View commit details -
tests: allow overriding system_user.user via env vars in tests
This way we do not need to patch the conf files in so many places.
Configuration menu - View commit details
-
Copy full SHA for cf93d96 - Browse repository at this point
Copy the full SHA cf93d96View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8869245 - Browse repository at this point
Copy the full SHA 8869245View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6a0e971 - Browse repository at this point
Copy the full SHA 6a0e971View commit details -
Configuration menu - View commit details
-
Copy full SHA for 69ef3db - Browse repository at this point
Copy the full SHA 69ef3dbView commit details -
Configuration menu - View commit details
-
Copy full SHA for d4a943f - Browse repository at this point
Copy the full SHA d4a943fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 65cae40 - Browse repository at this point
Copy the full SHA 65cae40View commit details -
Remove duplicate test fixture files
These are not test files: - st2actions/tests/unit/test_async_runner.py - st2actions/tests/unit/test_polling_async_runner.py It looks like they were copied to st2tests/st2tests/mocks/runners/ at some point. Nothing imports from or uses the copies in st2actions, so just delete them.
Configuration menu - View commit details
-
Copy full SHA for 8a17a7b - Browse repository at this point
Copy the full SHA 8a17a7bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6361089 - Browse repository at this point
Copy the full SHA 6361089View commit details -
tests: reorder st2tests imports in st2actions tests for import side-e…
…ffects importing anything form st2tests already handles running st2tests.config.parse_args() on import before loading the files from st2common that need those side effects. So, rely on that, and on the db test case base classes for running parse_args() where appropriate. The import side-effects are unfortunate, but this reduces how many places are making those changes.
Configuration menu - View commit details
-
Copy full SHA for 656ae8e - Browse repository at this point
Copy the full SHA 656ae8eView commit details -
Configuration menu - View commit details
-
Copy full SHA for c6346c2 - Browse repository at this point
Copy the full SHA c6346c2View commit details -
tests: reorder st2tests imports in st2common tests for import side-ef…
…fects importing anything form st2tests already handles running st2tests.config.parse_args() on import before loading the files from st2common that need those side effects. So, rely on that, and on the db test case base classes for running parse_args() where appropriate. The import side-effects are unfortunate, but this reduces how many places are making those changes.
Configuration menu - View commit details
-
Copy full SHA for ddca590 - Browse repository at this point
Copy the full SHA ddca590View commit details -
Configuration menu - View commit details
-
Copy full SHA for c25eba5 - Browse repository at this point
Copy the full SHA c25eba5View commit details -
Configuration menu - View commit details
-
Copy full SHA for fc65de2 - Browse repository at this point
Copy the full SHA fc65de2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2b54d84 - Browse repository at this point
Copy the full SHA 2b54d84View commit details -
Configuration menu - View commit details
-
Copy full SHA for b2db72d - Browse repository at this point
Copy the full SHA b2db72dView commit details -
pants: run unit tests for st2tests/ st2actions/ st2reactor/
Actually there are no unit tests in st2tests/, so this just ensures no one will add one without pants running it.
Configuration menu - View commit details
-
Copy full SHA for f465455 - Browse repository at this point
Copy the full SHA f465455View commit details -
Configuration menu - View commit details
-
Copy full SHA for d26da96 - Browse repository at this point
Copy the full SHA d26da96View commit details -
Configuration menu - View commit details
-
Copy full SHA for ae3c06d - Browse repository at this point
Copy the full SHA ae3c06dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1bb600f - Browse repository at this point
Copy the full SHA 1bb600fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6b8c84d - Browse repository at this point
Copy the full SHA 6b8c84dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5302211 - Browse repository at this point
Copy the full SHA 5302211View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6bba55b - Browse repository at this point
Copy the full SHA 6bba55bView commit details -
Configuration menu - View commit details
-
Copy full SHA for b4c7155 - Browse repository at this point
Copy the full SHA b4c7155View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5bf1332 - Browse repository at this point
Copy the full SHA 5bf1332View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5bc97c0 - Browse repository at this point
Copy the full SHA 5bc97c0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4a48fad - Browse repository at this point
Copy the full SHA 4a48fadView commit details -
pants-plugins/pack_metadata: add pack_content_resource target type
Now pack_metadata targets will generate pack_content_resource instead of just resource. pack_content_resource is still a resource, but this setup allows us to find the generated resource targets more simply. This also harmonizes the implementation of pack_metadata to follow the fields definition of resources (esp moving dependencies into moved_fields instead of core_fields).
Configuration menu - View commit details
-
Copy full SHA for 68d817c - Browse repository at this point
Copy the full SHA 68d817cView commit details -
pants-plugins/pack_metadata: classify metadata type of pack_content_r…
…esource targets This will allow rules to look up just action and sensor metadata (for example).
Configuration menu - View commit details
-
Copy full SHA for f6d028e - Browse repository at this point
Copy the full SHA f6d028eView commit details -
pants-plugins/pack_metadata: register actions/sensors in pants python…
… module mapping Only handles the actual action/sensor python files. It does not yet handle: - <pack>/lib - <pack>/actions/lib
Configuration menu - View commit details
-
Copy full SHA for 371db6c - Browse repository at this point
Copy the full SHA 371db6cView commit details -
pants-plugins/pack_metadata: register lib and actions/lib in pants py…
…thon module mapping This makes dependency inference aware of these which may be on the PYTHONPATH. - <pack>/lib - <pack>/actions/lib
Configuration menu - View commit details
-
Copy full SHA for b655e84 - Browse repository at this point
Copy the full SHA b655e84View commit details -
pants: Remove <pack>/lib and <pack>/actions/lib from source roots
The pack_metadata plugin now handles identifying these imports for dep inference. Next step, modify the PYTHONPATH as well.
Configuration menu - View commit details
-
Copy full SHA for b3ca250 - Browse repository at this point
Copy the full SHA b3ca250View commit details -
pants: Resolve ambiguous imports
The pack_metadata plugin now handles identifying these imports for dep inference, so there are more opportunities for the core pack to be imported ambiguously thanks to its symlink in st2tests/st2tests/fixtures/packs
Configuration menu - View commit details
-
Copy full SHA for 433e901 - Browse repository at this point
Copy the full SHA 433e901View commit details -
Configuration menu - View commit details
-
Copy full SHA for b6ca68f - Browse repository at this point
Copy the full SHA b6ca68fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0577b2b - Browse repository at this point
Copy the full SHA 0577b2bView commit details -
pants-plugins/pack_metadata: Extract python_module_mapper rule from p…
…ython_content_rules
Configuration menu - View commit details
-
Copy full SHA for 76e249a - Browse repository at this point
Copy the full SHA 76e249aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 13c1500 - Browse repository at this point
Copy the full SHA 13c1500View commit details -
Configuration menu - View commit details
-
Copy full SHA for ca2237c - Browse repository at this point
Copy the full SHA ca2237cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3bd815a - Browse repository at this point
Copy the full SHA 3bd815aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 31b7e64 - Browse repository at this point
Copy the full SHA 31b7e64View commit details -
pants-plugins/pack_metadata: Add implementation notes for python_pack…
…_content and related rules
Configuration menu - View commit details
-
Copy full SHA for ffa1f5e - Browse repository at this point
Copy the full SHA ffa1f5eView commit details -
pants-plugins/pack_metadata: Add python_path_rules to generate PEX_EX…
…TRA_SYS_PATH for tests This won't work until pants gets support for injecting path entries.
Configuration menu - View commit details
-
Copy full SHA for 3a82a29 - Browse repository at this point
Copy the full SHA 3a82a29View commit details -
Configuration menu - View commit details
-
Copy full SHA for df71152 - Browse repository at this point
Copy the full SHA df71152View commit details -
Configuration menu - View commit details
-
Copy full SHA for bf34e01 - Browse repository at this point
Copy the full SHA bf34e01View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4a4dcbc - Browse repository at this point
Copy the full SHA 4a4dcbcView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8354129 - Browse repository at this point
Copy the full SHA 8354129View commit details -
Configuration menu - View commit details
-
Copy full SHA for fb48612 - Browse repository at this point
Copy the full SHA fb48612View commit details -
Configuration menu - View commit details
-
Copy full SHA for 09af97d - Browse repository at this point
Copy the full SHA 09af97dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1de71ae - Browse repository at this point
Copy the full SHA 1de71aeView commit details -
pants-plugins/pack_metadata: add python_rules.conftest.rule_runner fi…
…xture Writes various test scenarios in the test sandbox. This should avoid repeating the setup in every test.
Configuration menu - View commit details
-
Copy full SHA for 5494a2a - Browse repository at this point
Copy the full SHA 5494a2aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 97f7226 - Browse repository at this point
Copy the full SHA 97f7226View commit details -
pants-plugins/pack_metadata: add test for pack content type detection
And fix the identified issues.
Configuration menu - View commit details
-
Copy full SHA for b069a83 - Browse repository at this point
Copy the full SHA b069a83View commit details -
pants-plugins/pack_metadata: add tests for entry_point and pack_lib r…
…ules And fix the identified mistake in conftest.
Configuration menu - View commit details
-
Copy full SHA for 8ff5e93 - Browse repository at this point
Copy the full SHA 8ff5e93View commit details -
Configuration menu - View commit details
-
Copy full SHA for d3b06a9 - Browse repository at this point
Copy the full SHA d3b06a9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1c37c68 - Browse repository at this point
Copy the full SHA 1c37c68View commit details -
pants-plugins/pack_metadata: add test for get_extra_sys_path_for_pack…
…_dependencies rule
Configuration menu - View commit details
-
Copy full SHA for 8b99025 - Browse repository at this point
Copy the full SHA 8b99025View commit details -
Configuration menu - View commit details
-
Copy full SHA for d81ff6b - Browse repository at this point
Copy the full SHA d81ff6bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 33d5085 - Browse repository at this point
Copy the full SHA 33d5085View commit details -
fix shell syntax in action chain test
I do not know why this worked before. Perhaps it relied on quirks from old versions of /bin/sh. Without this fix the action chain test test_chain_pause_resume_with_error fails.
Configuration menu - View commit details
-
Copy full SHA for 7b39bff - Browse repository at this point
Copy the full SHA 7b39bffView commit details -
Configuration menu - View commit details
-
Copy full SHA for f841444 - Browse repository at this point
Copy the full SHA f841444View commit details -
do not rely on the runner.yaml symlink in the test
The symlink is not registered in pants. So far, this is the first time something has tried to access that file. So, just use the actual file instead of the symlink
Configuration menu - View commit details
-
Copy full SHA for 9dacdf3 - Browse repository at this point
Copy the full SHA 9dacdf3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1079b9c - Browse repository at this point
Copy the full SHA 1079b9cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4b3f8cb - Browse repository at this point
Copy the full SHA 4b3f8cbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6471f25 - Browse repository at this point
Copy the full SHA 6471f25View commit details -
Configuration menu - View commit details
-
Copy full SHA for 45f6cee - Browse repository at this point
Copy the full SHA 45f6ceeView commit details -
Configuration menu - View commit details
-
Copy full SHA for cb1c612 - Browse repository at this point
Copy the full SHA cb1c612View commit details -
Configuration menu - View commit details
-
Copy full SHA for 63e5c21 - Browse repository at this point
Copy the full SHA 63e5c21View commit details -
Configuration menu - View commit details
-
Copy full SHA for 542e120 - Browse repository at this point
Copy the full SHA 542e120View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4ea9245 - Browse repository at this point
Copy the full SHA 4ea9245View commit details -
Configuration menu - View commit details
-
Copy full SHA for a80e091 - Browse repository at this point
Copy the full SHA a80e091View commit details -
Configuration menu - View commit details
-
Copy full SHA for a14721f - Browse repository at this point
Copy the full SHA a14721fView commit details -
Configuration menu - View commit details
-
Copy full SHA for e90c2c0 - Browse repository at this point
Copy the full SHA e90c2c0View commit details -
Configuration menu - View commit details
-
Copy full SHA for de25a79 - Browse repository at this point
Copy the full SHA de25a79View commit details -
Configuration menu - View commit details
-
Copy full SHA for b5545a8 - Browse repository at this point
Copy the full SHA b5545a8View commit details -
pants: workaround GHA using fetch-depth=1 for submodules
I could change fetch-depth, but that would change it for both submodules and for the st2.git checkout.
Configuration menu - View commit details
-
Copy full SHA for 1a8a911 - Browse repository at this point
Copy the full SHA 1a8a911View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1e13d28 - Browse repository at this point
Copy the full SHA 1e13d28View commit details -
Configuration menu - View commit details
-
Copy full SHA for d9a115d - Browse repository at this point
Copy the full SHA d9a115dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3ff52e8 - Browse repository at this point
Copy the full SHA 3ff52e8View commit details -
Configuration menu - View commit details
-
Copy full SHA for a026915 - Browse repository at this point
Copy the full SHA a026915View commit details