Skip to content

Commit

Permalink
Merge pull request #12194 from rabbitmq/loic-parallel-ct
Browse files Browse the repository at this point in the history
Make in CI
  • Loading branch information
lhoguin authored Oct 1, 2024
2 parents 36a84f4 + 7fe78a3 commit 297981e
Show file tree
Hide file tree
Showing 61 changed files with 890 additions and 338 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/templates/test.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ name: Test
on:
push:
branches:
- main
#! - main
- v4.0.x
- v3.13.x
- v3.12.x
Expand All @@ -42,7 +42,7 @@ on:
- '*.bzl'
- '*.bazel'
- .github/workflows/test.yaml
pull_request:
#! pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
Expand Down
81 changes: 81 additions & 0 deletions .github/workflows/test-make-target.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Test target (make)
on:
workflow_call:
inputs:
erlang_version:
required: true
type: string
elixir_version:
required: true
type: string
metadata_store:
required: true
type: string
make_target:
required: true
type: string
plugin:
required: true
type: string
jobs:
test:
name: ${{ inputs.plugin }} (${{ inputs.make_target }})
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: CHECKOUT REPOSITORY
uses: actions/checkout@v4

- name: FETCH TAGS
run: git fetch --tags

- name: SETUP OTP & ELIXIR
uses: erlef/[email protected]
with:
otp-version: ${{ inputs.erlang_version }}
elixir-version: ${{ inputs.elixir_version }}
hexpm-mirrors: |
https://builds.hex.pm
https://cdn.jsdelivr.net/hex
# This currently only applies to Elixir; and can be safely
# restricted to the build jobs to avoid duplication in output.
disable_problem_matchers: true

- name: SETUP DOTNET (rabbit)
uses: actions/setup-dotnet@v4
if: inputs.plugin == 'rabbit'
with:
dotnet-version: '3.1.x'

- name: SETUP SLAPD (rabbitmq_auth_backend_ldap)
if: inputs.plugin == 'rabbitmq_auth_backend_ldap'
run: |
sudo apt-get update && \
sudo apt-get install -y \
apparmor-utils \
ldap-utils \
slapd
sudo aa-complain `which slapd`
- name: RUN TESTS
if: inputs.plugin != 'rabbitmq_cli'
run: |
make -C deps/${{ inputs.plugin }} ${{ inputs.make_target }} RABBITMQ_METADATA_STORE=${{ inputs.metadata_store }}
# rabbitmq_cli needs a correct broker version for two of its tests.
# But setting PROJECT_VERSION makes other plugins fail.
- name: RUN TESTS (rabbitmq_cli)
if: inputs.plugin == 'rabbitmq_cli'
run: |
make -C deps/${{ inputs.plugin }} ${{ inputs.make_target }} RABBITMQ_METADATA_STORE=${{ inputs.metadata_store }} PROJECT_VERSION="4.1.0"
- name: UPLOAD TEST LOGS
if: always()
uses: actions/upload-artifact@v4
with:
name: CT logs (${{ inputs.plugin }} ${{ inputs.make_target }} OTP-${{ inputs.erlang_version }} ${{ inputs.metadata_store }})
path: |
logs/
!logs/**/log_private
if-no-files-found: ignore
114 changes: 114 additions & 0 deletions .github/workflows/test-make-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
name: Run tests (make)
on:
workflow_call:
inputs:
erlang_version:
required: true
type: string
elixir_version:
required: true
type: string
metadata_store:
required: true
type: string
jobs:
test-rabbit:
name: Test rabbit
strategy:
fail-fast: false
matrix:
make_target:
- parallel-ct-set-1
- parallel-ct-set-2
- parallel-ct-set-3
- parallel-ct-set-4
- ct-clustering_management
- eunit ct-dead_lettering
- ct-feature_flags
- ct-metadata_store_clustering
- ct-quorum_queue
- ct-rabbit_stream_queue
uses: ./.github/workflows/test-make-target.yaml
with:
erlang_version: ${{ inputs.erlang_version }}
elixir_version: ${{ inputs.elixir_version }}
metadata_store: ${{ inputs.metadata_store }}
make_target: ${{ matrix.make_target }}
plugin: rabbit

test-rabbitmq-mqtt:
name: Test rabbitmq_mqtt
uses: ./.github/workflows/test-make-target.yaml
with:
erlang_version: ${{ inputs.erlang_version }}
elixir_version: ${{ inputs.elixir_version }}
metadata_store: ${{ inputs.metadata_store }}
make_target: parallel-ct-set-1
plugin: rabbitmq_mqtt

# The integration_SUITE requires secrets and
# is therefore run from a separate workflow.
test-rabbitmq-peer-discovery-aws:
name: Test rabbitmq_peer_discovery_aws (partially)
uses: ./.github/workflows/test-make-target.yaml
with:
erlang_version: ${{ inputs.erlang_version }}
elixir_version: ${{ inputs.elixir_version }}
metadata_store: ${{ inputs.metadata_store }}
make_target: ct-config_schema ct-unit
plugin: rabbitmq_peer_discovery_aws

test-plugin:
name: Test plugins
strategy:
fail-fast: false
matrix:
plugin:
- amqp10_client
- amqp10_common
- amqp_client
- oauth2_client
- rabbit_common
- rabbitmq_amqp_client
- rabbitmq_auth_backend_cache
- rabbitmq_auth_backend_http
- rabbitmq_auth_backend_ldap
- rabbitmq_auth_backend_oauth2
- rabbitmq_auth_mechanism_ssl
- rabbitmq_aws
- rabbitmq_cli
- rabbitmq_consistent_hash_exchange
- rabbitmq_event_exchange
- rabbitmq_federation
- rabbitmq_federation_management
- rabbitmq_federation_prometheus
- rabbitmq_jms_topic_exchange
- rabbitmq_management
- rabbitmq_management_agent
- rabbitmq_peer_discovery_common
- rabbitmq_peer_discovery_consul
- rabbitmq_peer_discovery_etcd
- rabbitmq_peer_discovery_k8s
- rabbitmq_prelaunch
- rabbitmq_prometheus
- rabbitmq_recent_history_exchange
- rabbitmq_sharding
- rabbitmq_shovel
- rabbitmq_shovel_management
- rabbitmq_shovel_prometheus
- rabbitmq_stomp
- rabbitmq_stream
- rabbitmq_stream_common
- rabbitmq_stream_management
- rabbitmq_tracing
- rabbitmq_trust_store
- rabbitmq_web_dispatch
- rabbitmq_web_mqtt
- rabbitmq_web_stomp
uses: ./.github/workflows/test-make-target.yaml
with:
erlang_version: ${{ inputs.erlang_version }}
elixir_version: ${{ inputs.elixir_version }}
metadata_store: ${{ inputs.metadata_store }}
make_target: tests
plugin: ${{ matrix.plugin }}
82 changes: 82 additions & 0 deletions .github/workflows/test-make-type-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Type check (make)
on:
workflow_call:
inputs:
erlang_version:
required: true
type: string
elixir_version:
required: true
type: string
jobs:
type-check-plugin:
name: Type check plugins
strategy:
fail-fast: false
matrix:
plugin:
# These are using plugin-specific test jobs.
- rabbit
- rabbitmq_mqtt
- rabbitmq_peer_discovery_aws
# These are from the test-plugin test job.
- amqp10_client
- amqp10_common
- amqp_client
- oauth2_client
- rabbit_common
- rabbitmq_amqp_client
- rabbitmq_auth_backend_cache
- rabbitmq_auth_backend_http
- rabbitmq_auth_backend_ldap
- rabbitmq_auth_backend_oauth2
- rabbitmq_auth_mechanism_ssl
- rabbitmq_aws
- rabbitmq_consistent_hash_exchange
- rabbitmq_event_exchange
- rabbitmq_federation
- rabbitmq_federation_management
- rabbitmq_federation_prometheus
- rabbitmq_jms_topic_exchange
- rabbitmq_management
- rabbitmq_management_agent
- rabbitmq_peer_discovery_common
- rabbitmq_peer_discovery_consul
# @todo We are getting errors because of wrong types
# in the eetcd dep. But upgrading requires using gun 2.0,
# which we can't because another app's dep, emqtt, requires
# gun 1.3.x. So for now we don't type check this plugin.
#- rabbitmq_peer_discovery_etcd
- rabbitmq_peer_discovery_k8s
- rabbitmq_prelaunch
- rabbitmq_prometheus
- rabbitmq_recent_history_exchange
- rabbitmq_sharding
- rabbitmq_shovel
- rabbitmq_shovel_management
- rabbitmq_shovel_prometheus
- rabbitmq_stomp
- rabbitmq_stream
- rabbitmq_stream_common
- rabbitmq_stream_management
- rabbitmq_tracing
- rabbitmq_trust_store
- rabbitmq_web_dispatch
- rabbitmq_web_mqtt
- rabbitmq_web_stomp
# This one we do not want to run tests so no corresponding test job.
- rabbitmq_ct_helpers
# These do not have tests at this time so no corresponding test job.
- rabbitmq_ct_client_helpers
- rabbitmq_random_exchange
- rabbitmq_top
- rabbitmq_web_mqtt_examples
- rabbitmq_web_stomp_examples
- trust_store_http
uses: ./.github/workflows/test-make-target.yaml
with:
erlang_version: ${{ inputs.erlang_version }}
elixir_version: ${{ inputs.elixir_version }}
metadata_store: khepri # Not actually used.
make_target: dialyze
plugin: ${{ matrix.plugin }}
84 changes: 84 additions & 0 deletions .github/workflows/test-make.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Test (make)
on:
push:
branches:
- main
paths:
- deps/**
- scripts/**
- Makefile
- plugins.mk
- rabbitmq-components.mk
- .github/workflows/test-make.yaml
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build-and-xref:
name: Build and Xref
strategy:
fail-fast: false
matrix:
erlang_version:
- '26'
- '27'
elixir_version:
- '1.17'
# @todo Add macOS and Windows.
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: CHECKOUT REPOSITORY
uses: actions/checkout@v4

- name: FETCH TAGS
run: git fetch --tags

- name: SETUP OTP & ELIXIR
uses: erlef/[email protected]
with:
otp-version: ${{ matrix.erlang_version }}
elixir-version: ${{ matrix.elixir_version }}
hexpm-mirrors: |
https://builds.hex.pm
https://cdn.jsdelivr.net/hex
- name: BUILD
run: make

- name: XREF
run: make xref

test:
name: Test
strategy:
fail-fast: false
matrix:
erlang_version:
- '26'
- '27'
elixir_version:
- '1.17'
metadata_store:
- mnesia
- khepri
uses: ./.github/workflows/test-make-tests.yaml
with:
erlang_version: ${{ matrix.erlang_version }}
elixir_version: ${{ matrix.elixir_version }}
metadata_store: ${{ matrix.metadata_store }}

type-check:
name: Type check
strategy:
fail-fast: false
matrix:
erlang_version: # Latest OTP
- '27'
elixir_version: # Latest Elixir
- '1.17'
uses: ./.github/workflows/test-make-type-check.yaml
with:
erlang_version: ${{ matrix.erlang_version }}
elixir_version: ${{ matrix.elixir_version }}
2 changes: 0 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: Test
on:
push:
branches:
- main
- v4.0.x
- v3.13.x
- v3.12.x
Expand All @@ -22,7 +21,6 @@ on:
- '*.bzl'
- '*.bazel'
- .github/workflows/test.yaml
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
Expand Down
Loading

0 comments on commit 297981e

Please sign in to comment.