From c53639a1ca9d686dcf26257dccccb5a0508f4673 Mon Sep 17 00:00:00 2001 From: Michael Klishin Date: Mon, 14 Oct 2024 12:59:09 -0400 Subject: [PATCH] Actions: try disabling AppArmor (cherry picked from commit ba8d7a82dc9c0c10740ef1403deac13d04ce778a) # Conflicts: # .github/workflows/test-make-target.yaml --- .github/workflows/test-make-target.yaml | 80 ++++++++++++++++++++++++ .github/workflows/test-plugin-mixed.yaml | 3 +- .github/workflows/test-plugin.yaml | 3 +- 3 files changed, 82 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/test-make-target.yaml diff --git a/.github/workflows/test-make-target.yaml b/.github/workflows/test-make-target.yaml new file mode 100644 index 000000000000..d3386061f180 --- /dev/null +++ b/.github/workflows/test-make-target.yaml @@ -0,0 +1,80 @@ +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/setup-beam@v1.17 + 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 \ + ldap-utils \ + slapd + + sudo service apparmor stop + + - 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 diff --git a/.github/workflows/test-plugin-mixed.yaml b/.github/workflows/test-plugin-mixed.yaml index 9de3f8acac4a..df27e1f0ab9a 100644 --- a/.github/workflows/test-plugin-mixed.yaml +++ b/.github/workflows/test-plugin-mixed.yaml @@ -98,11 +98,10 @@ jobs: run: | sudo apt-get update && \ sudo apt-get install -y \ - apparmor-utils \ ldap-utils \ slapd - sudo aa-complain `which slapd` + sudo service apparmor stop cat << EOF >> user.bazelrc build --strategy=TestRunner=local diff --git a/.github/workflows/test-plugin.yaml b/.github/workflows/test-plugin.yaml index 3998013c03eb..d0110bfd5427 100644 --- a/.github/workflows/test-plugin.yaml +++ b/.github/workflows/test-plugin.yaml @@ -95,11 +95,10 @@ jobs: run: | sudo apt-get update && \ sudo apt-get install -y \ - apparmor-utils \ ldap-utils \ slapd - sudo aa-complain `which slapd` + sudo service apparmor stop cat << EOF >> user.bazelrc build --strategy=TestRunner=local