Skip to content

Comments

ci: add reusable run-tests action and support custom test image/tag#3671

Open
Peter-Sh wants to merge 1 commit intoredis:mainfrom
Peter-Sh:client_testing_reusable_action
Open

ci: add reusable run-tests action and support custom test image/tag#3671
Peter-Sh wants to merge 1 commit intoredis:mainfrom
Peter-Sh:client_testing_reusable_action

Conversation

@Peter-Sh
Copy link

These changes are to enable running nightly tests against Redis unstable builds and custom builds.

The PR follows the same idea as in Jedis: redis/jedis#4425

Main changes

  • Created a new reusable action .github/actions/run-tests/action.yml that is intended to be run by workflows in this and external repositories.
  • Moved all the steps from integration.yml to the new action, with modifications allowing the use of a custom image tag instead of a baked-in version.

What was changed in integration.yml:

  • Uses the run-tests action to run the tests
  • Allows running tests against a custom image tag (this is indicated in the run-name, if used)

Docker Compose

  • Added the CLIENT_LIBS_TEST_IMAGE_TAG variable to Docker Compose. I'm using a separate CLIENT_LIBS_TEST_IMAGE_TAG variable to clearly separate regular versions set with REDIS_VERSION from image tags.
  • Added the CLIENT_LIBS_TEST_IMAGE variable, it's not directly used in Makefile or workflows, but is supported in run-tests action. Added it for consitency with Jedis which originally has the ability to use different image url.

Changes to Makefile

  • ⚠️ Added direct setting of domainsocket and sentineldomainsocket properties when invoking maven because TestSettings.java didn't respect REDIS_ENV_WORK_DIR value and always tried to open sockets using relative paths

  • If CLIENT_LIBS_TEST_IMAGE_TAG is present, then the version argument is ignored.

Changes to the workflow logic

  • CLIENT_LIBS_TEST_IMAGE_TAG, along with CLIENT_LIBS_TEST_IMAGE, is passed to make start if any or both are present. Then Docker Compose gets them from the environment.
make start CLIENT_LIBS_TEST_IMAGE=redislabsdev/client-libs-test CLIENT_LIBS_TEST_IMAGE_TAG=custom-1235-debian-amd64

run-tests action allows setting a different image name using CLIENT_LIBS_TEST_IMAGE (not used in integration.yml).

⚠️ setup-maven action was updated from 1.8.0 to 1.19.0 to allow disabling secondary checkout using checkout-enabled option and avoid incorrect checkouts when using run-tests externally, seems to work fine.

Minor changes

  • Docker Compose is started with --quiet-pull to reduce noise.
  • Docker Compose is started with the --wait option, which is a more correct way to wait for readiness.
  • make stop is used instead docker-compose stop for consistency with make start and to enable any tear-down logic inluded in Makefile

Make sure that:

  • You have read the contribution guidelines.
  • You have created a feature request first to discuss your contribution intent. Please reference the feature request ticket number in the pull request.
  • You applied code formatting rules using the mvn formatter:format target. Don’t submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.

These changes are to enable running nightly tests against Redis unstable
builds and custom builds.

The PR follows the same idea as in Jedis: redis/jedis#4425

Main changes

* Created a new reusable action `.github/actions/run-tests/action.yml`
that is intended to be run by workflows in this and external
repositories.
* Moved all the steps from `integration.yml` to the new action, with
modifications allowing the use of a custom image tag instead of a
baked-in version.

What was changed in `integration.yml`:

* Uses the run-tests action to run the tests
* Allows running tests against a custom image tag (this is indicated in
the run-name, if used)

Docker Compose

* Added the `CLIENT_LIBS_TEST_IMAGE_TAG` variable to Docker Compose.
  I'm using a separate `CLIENT_LIBS_TEST_IMAGE_TAG` variable to clearly
  separate regular versions set with REDIS_VERSION from image tags.
* Added the `CLIENT_LIBS_TEST_IMAGE` variable, it's not directly used in
  Makefile or workflows, but is supported in run-tests action. Added it for
  consitency with Jedis which originally has the ability to use different
  image url.

Changes to `Makefile`

* Added direct setting of `domainsocket` and `sentineldomainsocket` properties
  when invoking maven because `TestSettings.java` didn't respect
  REDIS_ENV_WORK_DIR value and always tried to open sockets using relative
  paths

* If `CLIENT_LIBS_TEST_IMAGE_TAG` is present, then the `version` argument
is ignored.

Changes to the workflow logic

* `CLIENT_LIBS_TEST_IMAGE_TAG`, along with `CLIENT_LIBS_TEST_IMAGE`, is
passed to `make start` if any or both are present. Then Docker Compose
gets them from the environment.

```
make start CLIENT_LIBS_TEST_IMAGE=redislabsdev/client-libs-test CLIENT_LIBS_TEST_IMAGE_TAG=custom-1235-debian-amd64
```

run-tests action allows setting a different image name using
`CLIENT_LIBS_TEST_IMAGE` (not used in `integration.yml`).

setup-maven action was updated from `1.8.0` to `1.19.0` to allow disabling
secondary checkout using `checkout-enabled` option and avoid incorrect
chekouts when using run-tests externally

Minor changes
* Docker Compose is started with `--quiet-pull` to reduce noise.
* Docker Compose is started with the `--wait` option, which is a more
correct way to wait for readiness.
* `make stop` is used instead `docker-compose stop` for consistency with
  `make start` and to enable any tear-down logic inluded in Makefile
@a-TODO-rov a-TODO-rov force-pushed the client_testing_reusable_action branch from e8ab748 to f1baab1 Compare February 18, 2026 14:12
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.

1 participant