Skip to content

Commit

Permalink
Devops: Move RabbitMQ CI to nightly and update versions (#6419)
Browse files Browse the repository at this point in the history
The `rabbitmq.yml` was running a subset of the unit test suite against
a number of versions of RabbitMQ. The versions tested were very outdated
and are not officially supported anymore. The versions are updated to
3.11, 3.12, and 3.13.

Since the introduction, the tests have never really failed, which is not
too suprising as the code in `aiida-core` doesn't actually directly
interface with RabbitMQ. Rather this is done in `kiwipy`. Therefore, the
tests are moved to the nightly workflow such that they are no longer
run on every push and PR, which is overkill.
  • Loading branch information
danielhollas authored May 27, 2024
1 parent 9c9ff79 commit b47a566
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 62 deletions.
68 changes: 64 additions & 4 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ concurrency:

jobs:

tests:
nightly-tests:

if: github.repository == 'aiidateam/aiida-core' # Prevent running the builds on forks as well
runs-on: ubuntu-latest
Expand Down Expand Up @@ -76,9 +76,9 @@ jobs:
run: .github/workflows/tests_nightly.sh

- name: Slack notification
# Always run this step (otherwise it would be skipped if any of the previous steps fail) but only if the
# `install` or `tests` steps failed, and the `SLACK_WEBHOOK` is available. The latter is not the case for
# pull requests that come from forks. This is a limitation of secrets on GHA
# Always run this step (otherwise it would be skipped if any of the previous steps fail) but only if the
# `install` or `tests` steps failed, and the `SLACK_WEBHOOK` is available. The latter is not the case for
# pull requests that come from forks. This is a limitation of secrets on GHA
if: always() && (steps.install.outcome == 'Failure' || steps.tests.outcome == 'Failure') && env.SLACK_WEBHOOK != null
uses: rtCamp/action-slack-notify@v2
env:
Expand All @@ -88,3 +88,63 @@ jobs:
SLACK_COLOR: b60205
SLACK_TITLE: Nightly build of `aiida-core/main` failed
SLACK_MESSAGE: The tests of the `nightly.yml` GHA worklow failed.


# Run a subset of test suite to ensure compatibility with latest RabbitMQ releases
rabbitmq_tests:

runs-on: ubuntu-latest
timeout-minutes: 30

strategy:
fail-fast: false
matrix:
# Currently supported RMQ versions per:
# https://www.rabbitmq.com/docs/which-erlang#compatibility-matrix
rabbitmq-version: ['3.11', '3.12', '3.13']

services:
postgres:
image: postgres:16
env:
POSTGRES_DB: test_aiida
POSTGRES_PASSWORD: ''
POSTGRES_HOST_AUTH_METHOD: trust
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
rabbitmq:
image: rabbitmq:${{ matrix.rabbitmq-version }}-management
ports:
- 5672:5672
- 15672:15672

steps:
- uses: actions/checkout@v4

- name: Install aiida-core
uses: ./.github/actions/install-aiida-core

- name: Install system dependencies
run: sudo apt update && sudo apt install postgresql

- name: Run tests
run: pytest -sv -k 'requires_rmq'

- name: Slack notification
# Always run this step (otherwise it would be skipped if any of the previous steps fail) but only if the
# `install` or `tests` steps failed, and the `SLACK_WEBHOOK` is available. The latter is not the case for
# pull requests that come from forks. This is a limitation of secrets on GHA
if: always() && (steps.install.outcome == 'Failure' || steps.tests.outcome == 'Failure') && env.SLACK_WEBHOOK != null
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_ICON: https://www.materialscloud.org/discover/images/0ba0a17d.aiida-logo-128.png
SLACK_CHANNEL: dev-aiida-core
SLACK_COLOR: b60205
SLACK_TITLE: RabbitMQ nightly tests of `aiida-core/main` failed
SLACK_MESSAGE: The rabbitmq tests in the `nightly.yml` GHA worklow failed.
58 changes: 0 additions & 58 deletions .github/workflows/rabbitmq.yml

This file was deleted.

0 comments on commit b47a566

Please sign in to comment.