-
-
Notifications
You must be signed in to change notification settings - Fork 746
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 ci: add integration tests job #6273
base: master
Are you sure you want to change the base?
Commits on Nov 9, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 6db7446 - Browse repository at this point
Copy the full SHA 6db7446View commit details -
Configuration menu - View commit details
-
Copy full SHA for 845a388 - Browse repository at this point
Copy the full SHA 845a388View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1845fe4 - Browse repository at this point
Copy the full SHA 1845fe4View commit details -
Configuration menu - View commit details
-
Copy full SHA for f0bee02 - Browse repository at this point
Copy the full SHA f0bee02View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9256f36 - Browse repository at this point
Copy the full SHA 9256f36View commit details -
Configuration menu - View commit details
-
Copy full SHA for d103fbf - Browse repository at this point
Copy the full SHA d103fbfView commit details -
Add st2tests.config.db_opts_as_env_vars for itests
Integration tests need to start subprocesses that use the same database as the test. This matters when running under pantsbuild, because pants runs several instances of pytest in parallel. We configured pants to pass an env var to disambiguate parallel test runs: ST2TESTS_PARALLEL_SLOT. Then, the db name gets suffixed with this slot number at runtime. But, when an integration test runs production code in a subprocess, the production code does not use-- and should not use--any ST2TESTS_* vars, meaning the subprocess ends up using what is configured in the conf file instead of the parallel-safe test db. Thanks to a new-ish oslo_config feature, we can now update config via env variables. So, make use of that in integration tests to override the conf-file provided values with test-provided values.
Configuration menu - View commit details
-
Copy full SHA for 8a8db1b - Browse repository at this point
Copy the full SHA 8a8db1bView commit details -
Add st2tests.config.coord_opts_as_env_vars for itests
Integration tests need to start subprocesses that use the same redis as the test. This matters when running under pantsbuild, because pants runs several instances of pytest in parallel. This PR prepares to add support, to disambiguate test runs--similar to the database logic--using the env var: ST2TESTS_PARALLEL_SLOT. In any case, when an integration test runs production code in a subprocess, the production code does not use-- and should not use--any ST2TESTS_* vars, meaning the subprocess ends up using what is configured in the conf file instead of the (planned) parallel-safe coordinator. Thanks to a new-ish oslo_config feature, we can now update config via env variables. So, make use of that in integration tests to override the conf-file provided values with test-provided values.
Configuration menu - View commit details
-
Copy full SHA for fd8e270 - Browse repository at this point
Copy the full SHA fd8e270View commit details -
Run parse_args() in IntegrationTestCase.setUpClass()
This is needed so that vars are initialized before using them to configure the itest subprocesses via env vars.
Configuration menu - View commit details
-
Copy full SHA for 291539f - Browse repository at this point
Copy the full SHA 291539fView commit details -
Add st2tests.config.mq_opts_as_env_vars for itests
Integration tests need to start subprocesses that use the same exchanges as the test. This matters when running under pantsbuild, because pants runs several instances of pytest in parallel. This PR prepares to add support, to disambiguate test runs--similar to the database logic--using the env var: ST2TESTS_PARALLEL_SLOT. In any case, when an integration test runs production code in a subprocess, the production code does not use-- and should not use--any ST2TESTS_* vars, meaning the subprocess ends up using what is configured in the conf file instead of the (planned) parallel-safe coordinator. Thanks to a new-ish oslo_config feature, we can now update config via env variables. So, make use of that in integration tests to override the conf-file provided values with test-provided values.
Configuration menu - View commit details
-
Copy full SHA for 3c99f88 - Browse repository at this point
Copy the full SHA 3c99f88View commit details
Commits on Nov 12, 2024
-
Configuration menu - View commit details
-
Copy full SHA for d9bad68 - Browse repository at this point
Copy the full SHA d9bad68View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9c5c8c8 - Browse repository at this point
Copy the full SHA 9c5c8c8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6f1e6be - Browse repository at this point
Copy the full SHA 6f1e6beView commit details -
Configuration menu - View commit details
-
Copy full SHA for cdfd288 - Browse repository at this point
Copy the full SHA cdfd288View commit details -
scripts/github/prepare-integration.sh: Drop conf modification
conf/st2.dev.conf already sets [coordination].url, so we do not need to use sed to enable it again. It looks like the st2.dev.conf change happened shortly after the sed logic was added to prepare-integration.sh.
Configuration menu - View commit details
-
Copy full SHA for 5660b64 - Browse repository at this point
Copy the full SHA 5660b64View commit details -
Configuration menu - View commit details
-
Copy full SHA for df276f2 - Browse repository at this point
Copy the full SHA df276f2View commit details -
test: Add ?namespace=... to redis:// uri for parallel testing
This will make it safer to run tests in parallel as the tests will have separate service registration and coordination locks. To do that, this adds a namespace= query param to the redis url that includes the slot number that pants creates to allow tests to run in parallel more safely. The namespace is used by the tooz library's redis driver as a prefix for all the redis keys. Thus, multiple tests can use the same redis database without clobbering each other's keys.
Configuration menu - View commit details
-
Copy full SHA for 54e861f - Browse repository at this point
Copy the full SHA 54e861fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6a1e9c6 - Browse repository at this point
Copy the full SHA 6a1e9c6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0dfcc7c - Browse repository at this point
Copy the full SHA 0dfcc7cView commit details -
messaging: Make exchange/queue name prefix configurable
This, adds a new messaging.prefix option that gets modified to include the test slot as needed. Exchanges are defined as module level vars initialized on import. But, oslo_config is not setup yet at import time, so delay applying the new prefix setting until just before they get created in RabbitMQ. Luckily, Exchange() objects are lightweight objects that just hold the exchange name and type. They could do more, but we don't bind them to a channel. Because the exchange objects merely hold strings, and because they are basically singletons (module-level vars), we can safely update the exchange name just before declaring it in RabbitMQ. From that point on, everything that uses a singleton exchange object will get the updated name.
Configuration menu - View commit details
-
Copy full SHA for 25cf165 - Browse repository at this point
Copy the full SHA 25cf165View commit details -
stream: use well known st2. prefix in event names
Now that the exchange name prefix is configurable, we have to undo the prefix to maintain a backwards compatible API. Also, having the event names vary based on config would be a very bad UX, so we don't want to go there anyway.
Configuration menu - View commit details
-
Copy full SHA for 3614c4b - Browse repository at this point
Copy the full SHA 3614c4bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 71b5022 - Browse repository at this point
Copy the full SHA 71b5022View commit details -
Use Producer.auto_declare to declare exchanges as needed
Connection has a cache of which entities (exchange/queue) have been declared, so this shouldn't have too much of a performance impact. This does, however, make tests much more reliable.
Configuration menu - View commit details
-
Copy full SHA for e7e3fa4 - Browse repository at this point
Copy the full SHA e7e3fa4View commit details -
Configuration menu - View commit details
-
Copy full SHA for bc6ecdf - Browse repository at this point
Copy the full SHA bc6ecdfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 63f9b84 - Browse repository at this point
Copy the full SHA 63f9b84View commit details -
Configuration menu - View commit details
-
Copy full SHA for 53966b6 - Browse repository at this point
Copy the full SHA 53966b6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4b02962 - Browse repository at this point
Copy the full SHA 4b02962View commit details -
Configuration menu - View commit details
-
Copy full SHA for 837ea29 - Browse repository at this point
Copy the full SHA 837ea29View commit details -
skip tests that require passwordless sudo for local development
Only run them when ST2_CI==true to minimize requirements for local development. Also fix a typo in a comment.
Configuration menu - View commit details
-
Copy full SHA for 6792160 - Browse repository at this point
Copy the full SHA 6792160View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6e1054f - Browse repository at this point
Copy the full SHA 6e1054fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9085f7d - Browse repository at this point
Copy the full SHA 9085f7dView commit details -
Configuration menu - View commit details
-
Copy full SHA for dc9c440 - Browse repository at this point
Copy the full SHA dc9c440View commit details -
Configuration menu - View commit details
-
Copy full SHA for 730bf72 - Browse repository at this point
Copy the full SHA 730bf72View commit details -
Configuration menu - View commit details
-
Copy full SHA for a4fbef0 - Browse repository at this point
Copy the full SHA a4fbef0View commit details -
pants-plugins/uses_services: follow new conventions in redis rules too
These changes were already made for MongoDB and RabbitMQ rules. This removes a TODO comment and slightly refactors to follow the same convention.
Configuration menu - View commit details
-
Copy full SHA for d4697cf - Browse repository at this point
Copy the full SHA d4697cfView commit details -
Configuration menu - View commit details
-
Copy full SHA for d8af496 - Browse repository at this point
Copy the full SHA d8af496View commit details -
Configuration menu - View commit details
-
Copy full SHA for d83675a - Browse repository at this point
Copy the full SHA d83675aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7bbc4ef - Browse repository at this point
Copy the full SHA 7bbc4efView commit details -
pants ci: add integration tests job
pants `--tag=...` notes: `--tags=abc,def` (a csv list): is an OR condition (either `abc` tag, or `def` tag, or both). `--tags=abc --tag=def` (multiple entries): is an AND condition (Both `abc` tag AND `def` tag). So, we use `--tag=integration --tag=-st2cluster` to select targets that have the `integration` tag AND do NOT have the `st2cluster` tag.
Configuration menu - View commit details
-
Copy full SHA for dec8fd5 - Browse repository at this point
Copy the full SHA dec8fd5View commit details -
pants ci: orquesta (uses=st2cluster) itests
pants `--tag=...` notes: `--tags=abc,def` (a csv list): is an OR condition (either `abc` tag, or `def` tag, or both). `--tags=abc --tag=def` (multiple entries): is an AND condition (Both `abc` tag AND `def` tag). So, we use `--tag=integration --tag=st2cluster` to select targets that have the `integration tag AND the `st2cluster` tag. (The other integration test job excludes the st2cluster tagged targets).
Configuration menu - View commit details
-
Copy full SHA for 4a3a5a3 - Browse repository at this point
Copy the full SHA 4a3a5a3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8baae8a - Browse repository at this point
Copy the full SHA 8baae8aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 40825ca - Browse repository at this point
Copy the full SHA 40825caView commit details -
Configuration menu - View commit details
-
Copy full SHA for ca2d42f - Browse repository at this point
Copy the full SHA ca2d42fView commit details -
Configuration menu - View commit details
-
Copy full SHA for b98e5ae - Browse repository at this point
Copy the full SHA b98e5aeView commit details