From eccf2dbfda46e4ab2cf36c69d417fa13962137b2 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Sat, 25 May 2024 16:49:35 +0100 Subject: [PATCH 1/2] CI: Test with newer RabbitMQ versions Version 3.6/3.7 are super old and unsupported, let's test with newer, supported versions instead. We still want to support v3.8, since that's the last one that doesn't require any extra configuration (i.e. setting longer timeouts), but this version is tested as part of normal tests in ci-code.yml Since AiiDA interacts with RabbitMQ only via the kiwipy interface, it's unlikely that changes to AiiDA would break it. Therefore, the RabbitMQ tests are moved to the nightly run. --- .github/workflows/nightly.yml | 48 +++++++++++++++++++++++++++- .github/workflows/rabbitmq.yml | 58 ---------------------------------- 2 files changed, 47 insertions(+), 59 deletions(-) delete mode 100644 .github/workflows/rabbitmq.yml diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 0fe70299b0..cb37aa8325 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -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 @@ -88,3 +88,49 @@ 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' diff --git a/.github/workflows/rabbitmq.yml b/.github/workflows/rabbitmq.yml deleted file mode 100644 index 231cf9440e..0000000000 --- a/.github/workflows/rabbitmq.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: rabbitmq - -on: - push: - branches-ignore: [gh-pages] - pull_request: - branches-ignore: [gh-pages] - paths-ignore: [docs/**] - -# https://docs.github.com/en/actions/using-jobs/using-concurrency -concurrency: - # only cancel in-progress jobs or runs for the current workflow - matches against branch & tags - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - - tests: - - runs-on: ubuntu-latest - timeout-minutes: 30 - - strategy: - fail-fast: false - matrix: - rabbitmq-version: ['3.6', '3.7', '3.8'] - - services: - postgres: - image: postgres:10 - 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' From 391b200c53bee82b940f8f1d9fa2946ff8230c83 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Mon, 27 May 2024 13:21:56 +0100 Subject: [PATCH 2/2] Add Slack notification --- .github/workflows/nightly.yml | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index cb37aa8325..03fffaa269 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -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: @@ -134,3 +134,17 @@ jobs: - 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.