forked from rabbitmq/rabbitmq-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mixed version testing in bazel (rabbitmq#3200)
Unlike with gnu make, mixed version testing with bazel uses a package-generic-unix for the secondary umbrella rather than the source. This brings the benefit of being able to mixed version test releases built with older erlang versions (even though all nodes will run under the single version given to bazel) This introduces new test labels, adding a `-mixed` suffix for every existing test. They can be skipped if necessary with `--test_tag_filters` (see the github actions workflow for an example) As part of the change, it is now possible to run an old release of rabbit with rabbitmq_run rule, such as: `bazel run @rabbitmq-server-generic-unix-3.8.17//:rabbitmq-run run-broker`
- Loading branch information
Showing
16 changed files
with
316 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
name: Test Mixed Version Clusters | ||
on: push | ||
jobs: | ||
test-mixed-versions: | ||
name: Test (Mixed Version Cluster) | ||
runs-on: ubuntu-18.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
erlang_version: | ||
- "23" | ||
- "24" | ||
timeout-minutes: 120 | ||
steps: | ||
- name: CHECKOUT REPOSITORY | ||
uses: actions/[email protected] | ||
- name: CONFIGURE BAZEL | ||
run: | | ||
echo "${{ secrets.BUILDBUDDY_CERT }}" > buildbuddy-cert.pem | ||
echo "${{ secrets.BUILDBUDDY_KEY }}" > buildbuddy-key.pem | ||
cat << EOF >> user.bazelrc | ||
build:buildbuddy --tls_client_certificate=buildbuddy-cert.pem | ||
build:buildbuddy --tls_client_key=buildbuddy-key.pem | ||
build:buildbuddy --build_metadata=ROLE=CI | ||
build:buildbuddy --build_metadata=VISIBILITY=PUBLIC | ||
build:buildbuddy --remote_instance_name=buildbuddy-io/buildbuddy/ci-${{ matrix.erlang_version }} | ||
EOF | ||
#! - name: Setup tmate session | ||
#! uses: mxschmitt/action-tmate@v3 | ||
- name: RUN TESTS | ||
run: | | ||
bazelisk test //... \ | ||
--config=rbe-${{ matrix.erlang_version }} \ | ||
--test_tag_filters=mixed-version-cluster,-exclusive,-aws \ | ||
--verbose_failures | ||
test-exclusive-mixed-versions: | ||
name: Test (Exclusive Tests with Mixed Version Cluster) | ||
runs-on: ubuntu-18.04 | ||
strategy: | ||
matrix: | ||
erlang_version: | ||
- "23" | ||
- "24" | ||
timeout-minutes: 60 | ||
steps: | ||
- name: CHECKOUT REPOSITORY | ||
uses: actions/[email protected] | ||
- name: CONFIGURE OTP & ELIXIR | ||
uses: erlef/[email protected] | ||
with: | ||
otp-version: ${{ matrix.erlang_version }} | ||
elixir-version: 1.11.4 | ||
- name: CONFIGURE BAZEL | ||
run: | | ||
ERLANG_HOME="$(dirname $(dirname $(which erl)))" | ||
ELIXIR_HOME="$(dirname $(dirname $(which iex)))" | ||
echo "${{ secrets.BUILDBUDDY_CERT }}" > buildbuddy-cert.pem | ||
echo "${{ secrets.BUILDBUDDY_KEY }}" > buildbuddy-key.pem | ||
cat << EOF >> user.bazelrc | ||
build:buildbuddy --tls_client_certificate=buildbuddy-cert.pem | ||
build:buildbuddy --tls_client_key=buildbuddy-key.pem | ||
build:buildbuddy --build_metadata=ROLE=CI | ||
build:buildbuddy --build_metadata=VISIBILITY=PRIVATE | ||
build:buildbuddy --remote_instance_name=buildbuddy-io/buildbuddy/ci-exclusive-${{ matrix.erlang_version }} | ||
build --@bazel-erlang//:erlang_version=${{ matrix.erlang_version }} | ||
build --@bazel-erlang//:erlang_home=${ERLANG_HOME} | ||
build --//:elixir_home=${ELIXIR_HOME} | ||
EOF | ||
#! - name: Setup tmate session | ||
#! uses: mxschmitt/action-tmate@v3 | ||
- name: RUN EXCLUSIVE TESTS | ||
run: | | ||
MIXED_EXCLUSIVE_TESTS=$(bazel query 'attr(tags, "mixed-version-cluster", attr(tags, "exclusive", tests(//...)))') | ||
bazelisk test $MIXED_EXCLUSIVE_TESTS \ | ||
--config=buildbuddy \ | ||
--test_tag_filters=-aws \ | ||
--build_tests_only \ | ||
--test_env RABBITMQ_CT_HELPERS_DELETE_UNUSED_NODES=true \ | ||
--verbose_failures |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
load("@//:rabbitmq_package_generic_unix.bzl", "rabbitmq_package_generic_unix") | ||
load("@//:rabbitmq_run.bzl", "rabbitmq_run") | ||
|
||
rabbitmq_package_generic_unix( | ||
name = "broker-home", | ||
sbin = glob(["sbin/*"]), | ||
escript = glob(["escript/*"]), | ||
plugins = [ | ||
"//plugins:standard_plugins", | ||
"//plugins:inet_tcp_proxy_ez", | ||
], | ||
) | ||
|
||
rabbitmq_run( | ||
name = "rabbitmq-run", | ||
home = ":broker-home", | ||
visibility = ["//visibility:public"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.