From 5220621b2255c5286961bedd58c56435a102ab82 Mon Sep 17 00:00:00 2001 From: "angelo.andreussi" Date: Fri, 26 May 2023 15:15:42 +0200 Subject: [PATCH 01/11] inserted action definition for each test suite --- .github/actions/runTestsTaggedAs/action.yaml | 51 ++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/actions/runTestsTaggedAs/action.yaml diff --git a/.github/actions/runTestsTaggedAs/action.yaml b/.github/actions/runTestsTaggedAs/action.yaml new file mode 100644 index 00000000000..2c4cfd4d528 --- /dev/null +++ b/.github/actions/runTestsTaggedAs/action.yaml @@ -0,0 +1,51 @@ +name: 'Execute tests tagged in a certain way' +description: 'Execute tests suite for tests tagged as specified' +inputs: + tag: + description: Cucumber tag of the tests to run + required: true + needs-docker-images: + description: true if this suite needs docker images, false otherwise + required: false + default: 'true' +#outputs: +runs: + using: "composite" + steps: + - name: Clones Kapua repo inside the runner + uses: actions/checkout@v3 + - name: Setup java + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: 11 + cache: 'maven' #TODO + - name: Cache Maven repository #TODO + uses: actions/cache@v3 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + - name: Docker images creation + if: ${{ inputs.needs-docker-images }} + run: mvn -B ${BUILD_OPTS} -Pdocker -DskipTests clean install + shell: bash + - name: Dns look-up containers needed for tests - message-broker + if: ${{ inputs.needs-docker-images }} + run: echo "127.0.0.1 message-broker" | sudo tee -a /etc/hosts + shell: bash + - name: Dns look-up containers needed for tests - job-engine + if: ${{ inputs.needs-docker-images }} + run: echo "127.0.0.1 job-engine" | sudo tee -a /etc/hosts + shell: bash + - name: Test execution step + uses: nick-fields/retry@v2.8.1 + with: + timeout_minutes: 45 + retry_on: error + max_attempts: 1 + command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags=${{ inputs.tag }} verify + - name: Code-coverage results + run: bash <(curl -s https://codecov.io/bash) + shell: bash \ No newline at end of file From 0878ef5bc324b11356c21de8b1e8d480f9cc4ef6 Mon Sep 17 00:00:00 2001 From: "angelo.andreussi" Date: Fri, 26 May 2023 15:20:34 +0200 Subject: [PATCH 02/11] Used action for test suite --- .github/actions/runTestsTaggedAs/action.yaml | 8 +- .github/workflows/kapua-ci.yaml | 708 ++++--------------- 2 files changed, 143 insertions(+), 573 deletions(-) diff --git a/.github/actions/runTestsTaggedAs/action.yaml b/.github/actions/runTestsTaggedAs/action.yaml index 2c4cfd4d528..ce9ddb97c98 100644 --- a/.github/actions/runTestsTaggedAs/action.yaml +++ b/.github/actions/runTestsTaggedAs/action.yaml @@ -12,8 +12,6 @@ inputs: runs: using: "composite" steps: - - name: Clones Kapua repo inside the runner - uses: actions/checkout@v3 - name: Setup java uses: actions/setup-java@v3 with: @@ -28,15 +26,15 @@ runs: restore-keys: | ${{ runner.os }}-maven- - name: Docker images creation - if: ${{ inputs.needs-docker-images }} + if: ${{ inputs.needs-docker-images == 'true' }} run: mvn -B ${BUILD_OPTS} -Pdocker -DskipTests clean install shell: bash - name: Dns look-up containers needed for tests - message-broker - if: ${{ inputs.needs-docker-images }} + if: ${{ inputs.needs-docker-images == 'true' }} run: echo "127.0.0.1 message-broker" | sudo tee -a /etc/hosts shell: bash - name: Dns look-up containers needed for tests - job-engine - if: ${{ inputs.needs-docker-images }} + if: ${{ inputs.needs-docker-images == 'true' }} run: echo "127.0.0.1 job-engine" | sudo tee -a /etc/hosts shell: bash - name: Test execution step diff --git a/.github/workflows/kapua-ci.yaml b/.github/workflows/kapua-ci.yaml index 8dc0473004c..2695d73a968 100755 --- a/.github/workflows/kapua-ci.yaml +++ b/.github/workflows/kapua-ci.yaml @@ -31,710 +31,282 @@ jobs: needs: build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 + - name: Clones Kapua repo inside the runner + uses: actions/checkout@v3 + - uses: ./.github/actions/runTestsTaggedAs with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - run: echo "127.0.0.1 message-broker" | sudo tee -a /etc/hosts - - run: echo "127.0.0.1 job-engine" | sudo tee -a /etc/hosts - - run: mvn -B ${BUILD_OPTS} -Pdocker -DskipTests clean install - - uses: nick-fields/retry@v2.8.1 - with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@brokerAcl" verify - - run: bash <(curl -s https://codecov.io/bash) + tag: '@brokerAcl' + needs-docker-images: 'true' test-tag: needs: build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - uses: nick-fields/retry@v2.8.1 + - name: Clones Kapua repo inside the runner + uses: actions/checkout@v3 + - uses: ./.github/actions/runTestsTaggedAs with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@tag" verify - - run: bash <(curl -s https://codecov.io/bash) + tag: '@tag' + needs-docker-images: 'false' test-broker: needs: build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - run: echo "127.0.0.1 message-broker" | sudo tee -a /etc/hosts - - run: echo "127.0.0.1 job-engine" | sudo tee -a /etc/hosts - - run: mvn -B ${BUILD_OPTS} -Pdocker -DskipTests clean install - - uses: nick-fields/retry@v2.8.1 + - name: Clones Kapua repo inside the runner + uses: actions/checkout@v3 + - uses: ./.github/actions/runTestsTaggedAs with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@broker" verify - - run: bash <(curl -s https://codecov.io/bash) + tag: '@broker' + needs-docker-images: 'true' test-device: needs: build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 + - name: Clones Kapua repo inside the runner + uses: actions/checkout@v3 + - uses: ./.github/actions/runTestsTaggedAs with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - run: echo "127.0.0.1 message-broker" | sudo tee -a /etc/hosts - - run: echo "127.0.0.1 job-engine" | sudo tee -a /etc/hosts - - run: mvn -B ${BUILD_OPTS} -Pdocker -DskipTests clean install - - uses: nick-fields/retry@v2.8.1 - with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@device" verify - - run: bash <(curl -s https://codecov.io/bash) + tag: '@device' + needs-docker-images: 'true' test-device-management: needs: build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 + - name: Clones Kapua repo inside the runner + uses: actions/checkout@v3 + - uses: ./.github/actions/runTestsTaggedAs with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - run: echo "127.0.0.1 message-broker" | sudo tee -a /etc/hosts - - run: echo "127.0.0.1 job-engine" | sudo tee -a /etc/hosts - - run: mvn -B ${BUILD_OPTS} -Pdocker -DskipTests clean install - - uses: nick-fields/retry@v2.8.1 - with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@deviceManagement" verify - - run: bash <(curl -s https://codecov.io/bash) + tag: '@deviceManagement' + needs-docker-images: 'true' test-connection: needs: build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 + - name: Clones Kapua repo inside the runner + uses: actions/checkout@v3 + - uses: ./.github/actions/runTestsTaggedAs with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - run: echo "127.0.0.1 message-broker" | sudo tee -a /etc/hosts - - run: echo "127.0.0.1 job-engine" | sudo tee -a /etc/hosts - - run: mvn -B ${BUILD_OPTS} -Pdocker -DskipTests clean install - - uses: nick-fields/retry@v2.8.1 - with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@connection" verify - - run: bash <(curl -s https://codecov.io/bash) + tag: '@connection' + needs-docker-images: 'true' test-datastore: needs: build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 + - name: Clones Kapua repo inside the runner + uses: actions/checkout@v3 + - uses: ./.github/actions/runTestsTaggedAs with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - run: echo "127.0.0.1 message-broker" | sudo tee -a /etc/hosts - - run: echo "127.0.0.1 job-engine" | sudo tee -a /etc/hosts - - run: mvn -B ${BUILD_OPTS} -Pdocker -DskipTests clean install - - uses: nick-fields/retry@v2.8.1 - with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@datastore" verify - - run: bash <(curl -s https://codecov.io/bash) + tag: '@datastore' + needs-docker-images: 'true' test-user: needs: build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 + - name: Clones Kapua repo inside the runner + uses: actions/checkout@v3 + - uses: ./.github/actions/runTestsTaggedAs with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - uses: nick-fields/retry@v2.8.1 - with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@user" verify - - run: bash <(curl -s https://codecov.io/bash) + tag: '@user' + needs-docker-images: 'false' test-userIntegrationBase: needs: build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - run: echo "127.0.0.1 message-broker" | sudo tee -a /etc/hosts - - run: echo "127.0.0.1 job-engine" | sudo tee -a /etc/hosts - - run: mvn -B ${BUILD_OPTS} -Pdocker -DskipTests clean install - - uses: nick-fields/retry@v2.8.1 + - name: Clones Kapua repo inside the runner + uses: actions/checkout@v3 + - uses: ./.github/actions/runTestsTaggedAs with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@userIntegrationBase" verify - - run: bash <(curl -s https://codecov.io/bash) + tag: '@userIntegrationBase' + needs-docker-images: 'true' test-userIntegration: needs: build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - run: echo "127.0.0.1 message-broker" | sudo tee -a /etc/hosts - - run: echo "127.0.0.1 job-engine" | sudo tee -a /etc/hosts - - run: mvn -B ${BUILD_OPTS} -Pdocker -DskipTests clean install - - uses: nick-fields/retry@v2.8.1 + - name: Clones Kapua repo inside the runner + uses: actions/checkout@v3 + - uses: ./.github/actions/runTestsTaggedAs with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@userIntegration" verify - - run: bash <(curl -s https://codecov.io/bash) + tag: '@userIntegration' + needs-docker-images: 'true' test-security: needs: build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 + - name: Clones Kapua repo inside the runner + uses: actions/checkout@v3 + - uses: ./.github/actions/runTestsTaggedAs with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - uses: nick-fields/retry@v2.8.1 - with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@security" verify - - run: bash <(curl -s https://codecov.io/bash) + tag: '@security' + needs-docker-images: 'true' test-jobsAndScheduler: needs: build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 + - name: Clones Kapua repo inside the runner + uses: actions/checkout@v3 + - uses: ./.github/actions/runTestsTaggedAs with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - uses: nick-fields/retry@v2.8.1 - with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@jobs or @scheduler" verify - - run: bash <(curl -s https://codecov.io/bash) + tag: '@jobs or @scheduler' + needs-docker-images: 'true' test-jobsIntegrationBase: needs: build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 + - name: Clones Kapua repo inside the runner + uses: actions/checkout@v3 + - uses: ./.github/actions/runTestsTaggedAs with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - run: echo "127.0.0.1 message-broker" | sudo tee -a /etc/hosts - - run: echo "127.0.0.1 job-engine" | sudo tee -a /etc/hosts - - run: mvn -B ${BUILD_OPTS} -Pdocker -DskipTests clean install - - uses: nick-fields/retry@v2.8.1 - with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@jobsIntegrationBase" verify - - run: bash <(curl -s https://codecov.io/bash) + tag: '@jobsIntegrationBase' + needs-docker-images: 'true' test-jobsIntegration: needs: build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 + - name: Clones Kapua repo inside the runner + uses: actions/checkout@v3 + - uses: ./.github/actions/runTestsTaggedAs with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - run: echo "127.0.0.1 message-broker" | sudo tee -a /etc/hosts - - run: echo "127.0.0.1 job-engine" | sudo tee -a /etc/hosts - - run: mvn -B ${BUILD_OPTS} -Pdocker -DskipTests clean install - - uses: nick-fields/retry@v2.8.1 - with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@jobsIntegration" verify - - run: bash <(curl -s https://codecov.io/bash) + tag: '@jobsIntegration' + needs-docker-images: 'true' test-triggerService: needs: build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 + - name: Clones Kapua repo inside the runner + uses: actions/checkout@v3 + - uses: ./.github/actions/runTestsTaggedAs with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - run: echo "127.0.0.1 message-broker" | sudo tee -a /etc/hosts - - run: echo "127.0.0.1 job-engine" | sudo tee -a /etc/hosts - - run: mvn -B ${BUILD_OPTS} -Pdocker -DskipTests clean install - - uses: nick-fields/retry@v2.8.1 - with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@triggerService" verify - - run: bash <(curl -s https://codecov.io/bash) + tag: '@triggerService' + needs-docker-images: 'true' test-triggerServiceIntegrationBase: needs: build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - run: echo "127.0.0.1 message-broker" | sudo tee -a /etc/hosts - - run: echo "127.0.0.1 job-engine" | sudo tee -a /etc/hosts - - run: mvn -B ${BUILD_OPTS} -Pdocker -DskipTests clean install - - uses: nick-fields/retry@v2.8.1 + - name: Clones Kapua repo inside the runner + uses: actions/checkout@v3 + - uses: ./.github/actions/runTestsTaggedAs with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@triggerServiceIntegrationBase" verify - - run: bash <(curl -s https://codecov.io/bash) + tag: '@triggerServiceIntegrationBase' + needs-docker-images: 'true' test-triggerServiceIntegration: needs: build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - run: echo "127.0.0.1 message-broker" | sudo tee -a /etc/hosts - - run: echo "127.0.0.1 job-engine" | sudo tee -a /etc/hosts - - run: mvn -B ${BUILD_OPTS} -Pdocker -DskipTests clean install - - uses: nick-fields/retry@v2.8.1 + - name: Clones Kapua repo inside the runner + uses: actions/checkout@v3 + - uses: ./.github/actions/runTestsTaggedAs with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@triggerServiceIntegration" verify - - run: bash <(curl -s https://codecov.io/bash) + tag: '@triggerServiceIntegration' + needs-docker-images: 'true' test-accountAndTranslator: needs: build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 + - name: Clones Kapua repo inside the runner + uses: actions/checkout@v3 + - uses: ./.github/actions/runTestsTaggedAs with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - uses: nick-fields/retry@v2.8.1 - with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@account or @translator" verify - - run: bash <(curl -s https://codecov.io/bash) + tag: '@account or @translator' + needs-docker-images: 'false' test-jobEngineStepDefinitions: needs: build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 + - name: Clones Kapua repo inside the runner + uses: actions/checkout@v3 + - uses: ./.github/actions/runTestsTaggedAs with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - run: echo "127.0.0.1 message-broker" | sudo tee -a /etc/hosts - - run: echo "127.0.0.1 job-engine" | sudo tee -a /etc/hosts - - run: mvn -B ${BUILD_OPTS} -Pdocker -DskipTests clean install - - uses: nick-fields/retry@v2.8.1 - with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@jobEngineStepDefinitions" verify - - run: bash <(curl -s https://codecov.io/bash) + tag: '@jobEngineStepDefinitions' + needs-docker-images: 'true' test-jobEngineStartOfflineDevice: needs: build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 + - name: Clones Kapua repo inside the runner + uses: actions/checkout@v3 + - uses: ./.github/actions/runTestsTaggedAs with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - run: echo "127.0.0.1 message-broker" | sudo tee -a /etc/hosts - - run: echo "127.0.0.1 job-engine" | sudo tee -a /etc/hosts - - run: mvn -B ${BUILD_OPTS} -Pdocker -DskipTests clean install - - uses: nick-fields/retry@v2.8.1 - with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@jobEngineStartOfflineDevice" verify - - run: bash <(curl -s https://codecov.io/bash) + tag: '@jobEngineStartOfflineDevice' + needs-docker-images: 'true' test-jobEngineStartOnlineDevice: needs: build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 + - name: Clones Kapua repo inside the runner + uses: actions/checkout@v3 + - uses: ./.github/actions/runTestsTaggedAs with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - run: echo "127.0.0.1 message-broker" | sudo tee -a /etc/hosts - - run: echo "127.0.0.1 job-engine" | sudo tee -a /etc/hosts - - run: mvn -B ${BUILD_OPTS} -Pdocker -DskipTests clean install - - uses: nick-fields/retry@v2.8.1 - with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@jobEngineStartOnlineDevice" verify - - run: bash <(curl -s https://codecov.io/bash) + tag: '@jobEngineStartOnlineDevice' + needs-docker-images: 'true' test-jobEngineRestartOfflineDevice: needs: build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 + - name: Clones Kapua repo inside the runner + uses: actions/checkout@v3 + - uses: ./.github/actions/runTestsTaggedAs with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - run: echo "127.0.0.1 message-broker" | sudo tee -a /etc/hosts - - run: echo "127.0.0.1 job-engine" | sudo tee -a /etc/hosts - - run: mvn -B ${BUILD_OPTS} -Pdocker -DskipTests clean install - - uses: nick-fields/retry@v2.8.1 - with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@jobEngineRestartOfflineDevice" verify - - run: bash <(curl -s https://codecov.io/bash) + tag: '@jobEngineRestartOfflineDevice' + needs-docker-images: 'true' test-jobEngineRestartOnlineDevice: needs: build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - run: echo "127.0.0.1 message-broker" | sudo tee -a /etc/hosts - - run: echo "127.0.0.1 job-engine" | sudo tee -a /etc/hosts - - run: mvn -B ${BUILD_OPTS} -Pdocker -DskipTests clean install - - uses: nick-fields/retry@v2.8.1 + - name: Clones Kapua repo inside the runner + uses: actions/checkout@v3 + - uses: ./.github/actions/runTestsTaggedAs with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@jobEngineRestartOnlineDevice" verify - - run: bash <(curl -s https://codecov.io/bash) + tag: '@jobEngineRestartOnlineDevice' + needs-docker-images: 'false' test-jobEngineRestartOnlineDeviceSecondPart: needs: build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - run: echo "127.0.0.1 message-broker" | sudo tee -a /etc/hosts - - run: echo "127.0.0.1 job-engine" | sudo tee -a /etc/hosts - - run: mvn -B ${BUILD_OPTS} -Pdocker -DskipTests clean install - - uses: nick-fields/retry@v2.8.1 + - name: Clones Kapua repo inside the runner + uses: actions/checkout@v3 + - uses: ./.github/actions/runTestsTaggedAs with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@jobEngineRestartOnlineDeviceSecondPart" verify - - run: bash <(curl -s https://codecov.io/bash) + tag: '@jobEngineRestartOnlineDeviceSecondPart' + needs-docker-images: 'true' test-jobEngineServiceStop: needs: build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 + - name: Clones Kapua repo inside the runner + uses: actions/checkout@v3 + - uses: ./.github/actions/runTestsTaggedAs with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - run: echo "127.0.0.1 message-broker" | sudo tee -a /etc/hosts - - run: echo "127.0.0.1 job-engine" | sudo tee -a /etc/hosts - - run: mvn -B ${BUILD_OPTS} -Pdocker -DskipTests clean install - - uses: nick-fields/retry@v2.8.1 - with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@jobEngineServiceStop" verify - - run: bash <(curl -s https://codecov.io/bash) + tag: '@jobEngineServiceStop' + needs-docker-images: 'true' test-RoleAndGroup: needs: build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 + - name: Clones Kapua repo inside the runner + uses: actions/checkout@v3 + - uses: ./.github/actions/runTestsTaggedAs with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - uses: nick-fields/retry@v2.8.1 - with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@role or @group" verify - - run: bash <(curl -s https://codecov.io/bash) + tag: '@role or @group' + needs-docker-images: 'false' test-deviceRegistry: needs: build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 + - name: Clones Kapua repo inside the runner + uses: actions/checkout@v3 + - uses: ./.github/actions/runTestsTaggedAs with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - run: echo "127.0.0.1 message-broker" | sudo tee -a /etc/hosts - - run: mvn -B ${BUILD_OPTS} -Pdocker -DskipTests clean install - - uses: nick-fields/retry@v2.8.1 - with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@deviceRegistry" verify - - run: bash <(curl -s https://codecov.io/bash) + tag: '@deviceRegistry' + needs-docker-images: 'false' test-endpoint: needs: build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 + - name: Clones Kapua repo inside the runner + uses: actions/checkout@v3 + - uses: ./.github/actions/runTestsTaggedAs with: - distribution: 'zulu' - java-version: 11 - cache: 'maven' - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - run: echo "127.0.0.1 message-broker" | sudo tee -a /etc/hosts - - run: mvn -B ${BUILD_OPTS} -Pdocker -DskipTests clean install - - uses: nick-fields/retry@v2.8.1 - with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="@endpoint" verify - - run: bash <(curl -s https://codecov.io/bash) + tag: '@endpoint' + needs-docker-images: 'false' junit-tests: needs: build runs-on: ubuntu-latest From ba157e5a7b263fa12c148f3eb2cd4fe12cb6fb54 Mon Sep 17 00:00:00 2001 From: "angelo.andreussi" Date: Fri, 26 May 2023 16:02:38 +0200 Subject: [PATCH 03/11] Execution of tests suite only under test projects (ci speed-up) --- .github/actions/runTestsTaggedAs/action.yaml | 2 +- .github/workflows/kapua-ci.yaml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/actions/runTestsTaggedAs/action.yaml b/.github/actions/runTestsTaggedAs/action.yaml index ce9ddb97c98..e20b972f375 100644 --- a/.github/actions/runTestsTaggedAs/action.yaml +++ b/.github/actions/runTestsTaggedAs/action.yaml @@ -43,7 +43,7 @@ runs: timeout_minutes: 45 retry_on: error max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags=${{ inputs.tag }} verify + command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags=${{ inputs.tag }} -pl ${TEST_PROJECTS} verify - name: Code-coverage results run: bash <(curl -s https://codecov.io/bash) shell: bash \ No newline at end of file diff --git a/.github/workflows/kapua-ci.yaml b/.github/workflows/kapua-ci.yaml index 2695d73a968..dc07731d38c 100755 --- a/.github/workflows/kapua-ci.yaml +++ b/.github/workflows/kapua-ci.yaml @@ -5,6 +5,7 @@ env: BUILD_OPTS: "" CONFIG_OVERRIDES: "-Dcommons.db.schema=kapuadb -Dcommons.settings.hotswap=true -Dbroker.host=localhost -Dcrypto.secret.key=kapuaTestsKey!!!" MAVEN_OPTS: "-Xmx4096m" + TEST_PROJECTS: "org.eclipse.kapua:kapua-security-test,org.eclipse.kapua:kapua-qa-integration,org.eclipse.kapua:kapua-scheduler-test,org.eclipse.kapua:kapua-user-test,org.eclipse.kapua:kapua-system-test,org.eclipse.kapua:kapua-job-test,org.eclipse.kapua:kapua-device-registry-test,org.eclipse.kapua:kapua-account-test,org.eclipse.kapua:kapua-tag-test,org.eclipse.kapua:kapua-translator-test" jobs: build: From b675b6ff65c5698fd4753ad53cba8ee5046bb208 Mon Sep 17 00:00:00 2001 From: "angelo.andreussi" Date: Fri, 26 May 2023 16:20:56 +0200 Subject: [PATCH 04/11] small fix with tag defined with the logical or --- .github/actions/runTestsTaggedAs/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/runTestsTaggedAs/action.yaml b/.github/actions/runTestsTaggedAs/action.yaml index e20b972f375..e62ffe51dd4 100644 --- a/.github/actions/runTestsTaggedAs/action.yaml +++ b/.github/actions/runTestsTaggedAs/action.yaml @@ -43,7 +43,7 @@ runs: timeout_minutes: 45 retry_on: error max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags=${{ inputs.tag }} -pl ${TEST_PROJECTS} verify + command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="${{ inputs.tag }}" -pl ${TEST_PROJECTS} verify - name: Code-coverage results run: bash <(curl -s https://codecov.io/bash) shell: bash \ No newline at end of file From 9380d333e6dc1610288a4030f7347b728b4ddbac Mon Sep 17 00:00:00 2001 From: "angelo.andreussi" Date: Tue, 30 May 2023 09:45:45 +0200 Subject: [PATCH 05/11] changed some need-docker-images values in some jobs --- .github/workflows/kapua-ci.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/kapua-ci.yaml b/.github/workflows/kapua-ci.yaml index dc07731d38c..8c1f6a28c04 100755 --- a/.github/workflows/kapua-ci.yaml +++ b/.github/workflows/kapua-ci.yaml @@ -137,7 +137,7 @@ jobs: - uses: ./.github/actions/runTestsTaggedAs with: tag: '@security' - needs-docker-images: 'true' + needs-docker-images: 'false' test-jobsAndScheduler: needs: build runs-on: ubuntu-latest @@ -147,7 +147,7 @@ jobs: - uses: ./.github/actions/runTestsTaggedAs with: tag: '@jobs or @scheduler' - needs-docker-images: 'true' + needs-docker-images: 'false' test-jobsIntegrationBase: needs: build runs-on: ubuntu-latest @@ -257,7 +257,7 @@ jobs: - uses: ./.github/actions/runTestsTaggedAs with: tag: '@jobEngineRestartOnlineDevice' - needs-docker-images: 'false' + needs-docker-images: 'true' test-jobEngineRestartOnlineDeviceSecondPart: needs: build runs-on: ubuntu-latest @@ -297,7 +297,7 @@ jobs: - uses: ./.github/actions/runTestsTaggedAs with: tag: '@deviceRegistry' - needs-docker-images: 'false' + needs-docker-images: 'true' test-endpoint: needs: build runs-on: ubuntu-latest @@ -307,7 +307,7 @@ jobs: - uses: ./.github/actions/runTestsTaggedAs with: tag: '@endpoint' - needs-docker-images: 'false' + needs-docker-images: 'true' junit-tests: needs: build runs-on: ubuntu-latest From 19b7549182b2ec930a5b6cccc415f145e5f8c16b Mon Sep 17 00:00:00 2001 From: "angelo.andreussi" Date: Mon, 29 May 2023 10:45:15 +0200 Subject: [PATCH 06/11] mods to maven caching to use different cache in each workflow run --- .github/actions/runTestsTaggedAs/action.yaml | 5 ++--- .github/workflows/kapua-ci.yaml | 7 +++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/actions/runTestsTaggedAs/action.yaml b/.github/actions/runTestsTaggedAs/action.yaml index e62ffe51dd4..4b05cbc70d9 100644 --- a/.github/actions/runTestsTaggedAs/action.yaml +++ b/.github/actions/runTestsTaggedAs/action.yaml @@ -17,12 +17,11 @@ runs: with: distribution: 'zulu' java-version: 11 - cache: 'maven' #TODO - - name: Cache Maven repository #TODO + - name: Cache Maven repository uses: actions/cache@v3 with: path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + key: ${{ github.run_id }}-${{ github.run_number }}-maven-cache restore-keys: | ${{ runner.os }}-maven- - name: Docker images creation diff --git a/.github/workflows/kapua-ci.yaml b/.github/workflows/kapua-ci.yaml index 8c1f6a28c04..9b67b662c7d 100755 --- a/.github/workflows/kapua-ci.yaml +++ b/.github/workflows/kapua-ci.yaml @@ -17,11 +17,10 @@ jobs: with: distribution: 'zulu' java-version: 11 - cache: 'maven' - uses: actions/cache@v3 # Cache local Maven repository to reuse dependencies with: path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + key: ${{ github.run_id }}-${{ github.run_number }}-maven-cache restore-keys: | ${{ runner.os }}-maven- - run: mvn -v @@ -321,7 +320,7 @@ jobs: - uses: actions/cache@v3 with: path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + key: ${{ github.run_id }}-${{ github.run_number }}-maven-cache restore-keys: | ${{ runner.os }}-maven- - uses: nick-fields/retry@v2.8.1 @@ -344,7 +343,7 @@ jobs: - uses: actions/cache@v3 with: path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + key: ${{ github.run_id }}-${{ github.run_number }}-maven-cache restore-keys: | ${{ runner.os }}-maven- - run: mvn -B -DskipTests install javadoc:jar From 899d3e14f6b303e9448a8069fef87c9483754030 Mon Sep 17 00:00:00 2001 From: "angelo.andreussi" Date: Mon, 29 May 2023 11:33:38 +0200 Subject: [PATCH 07/11] fine tuning maven artifacts cache --- .github/actions/runTestsTaggedAs/action.yaml | 2 -- .github/workflows/kapua-ci.yaml | 8 -------- 2 files changed, 10 deletions(-) diff --git a/.github/actions/runTestsTaggedAs/action.yaml b/.github/actions/runTestsTaggedAs/action.yaml index 4b05cbc70d9..ada1586a041 100644 --- a/.github/actions/runTestsTaggedAs/action.yaml +++ b/.github/actions/runTestsTaggedAs/action.yaml @@ -22,8 +22,6 @@ runs: with: path: ~/.m2/repository key: ${{ github.run_id }}-${{ github.run_number }}-maven-cache - restore-keys: | - ${{ runner.os }}-maven- - name: Docker images creation if: ${{ inputs.needs-docker-images == 'true' }} run: mvn -B ${BUILD_OPTS} -Pdocker -DskipTests clean install diff --git a/.github/workflows/kapua-ci.yaml b/.github/workflows/kapua-ci.yaml index 9b67b662c7d..2520ae6a907 100755 --- a/.github/workflows/kapua-ci.yaml +++ b/.github/workflows/kapua-ci.yaml @@ -21,8 +21,6 @@ jobs: with: path: ~/.m2/repository key: ${{ github.run_id }}-${{ github.run_number }}-maven-cache - restore-keys: | - ${{ runner.os }}-maven- - run: mvn -v - run: docker images -a # used as log (should show only github environment standard docker images; if kapua images are present, something is wrong) - run: mvn -B ${BUILD_OPTS} -DskipTests clean install @@ -316,13 +314,10 @@ jobs: with: distribution: 'zulu' java-version: 11 - cache: 'maven' - uses: actions/cache@v3 with: path: ~/.m2/repository key: ${{ github.run_id }}-${{ github.run_number }}-maven-cache - restore-keys: | - ${{ runner.os }}-maven- - uses: nick-fields/retry@v2.8.1 with: timeout_minutes: 45 @@ -339,12 +334,9 @@ jobs: with: distribution: 'zulu' java-version: 11 - cache: 'maven' - uses: actions/cache@v3 with: path: ~/.m2/repository key: ${{ github.run_id }}-${{ github.run_number }}-maven-cache - restore-keys: | - ${{ runner.os }}-maven- - run: mvn -B -DskipTests install javadoc:jar - run: bash <(curl -s https://codecov.io/bash) From 68fd57c8d0e55c7b6b21cc18a10d4dc03e364938 Mon Sep 17 00:00:00 2001 From: "angelo.andreussi" Date: Tue, 30 May 2023 15:20:00 +0200 Subject: [PATCH 08/11] removed test suites without respective tests in code base --- .github/workflows/kapua-ci.yaml | 61 +++++++++++++++++---------------- 1 file changed, 31 insertions(+), 30 deletions(-) diff --git a/.github/workflows/kapua-ci.yaml b/.github/workflows/kapua-ci.yaml index 2520ae6a907..5247b2f35e4 100755 --- a/.github/workflows/kapua-ci.yaml +++ b/.github/workflows/kapua-ci.yaml @@ -165,36 +165,37 @@ jobs: with: tag: '@jobsIntegration' needs-docker-images: 'true' - test-triggerService: - needs: build - runs-on: ubuntu-latest - steps: - - name: Clones Kapua repo inside the runner - uses: actions/checkout@v3 - - uses: ./.github/actions/runTestsTaggedAs - with: - tag: '@triggerService' - needs-docker-images: 'true' - test-triggerServiceIntegrationBase: - needs: build - runs-on: ubuntu-latest - steps: - - name: Clones Kapua repo inside the runner - uses: actions/checkout@v3 - - uses: ./.github/actions/runTestsTaggedAs - with: - tag: '@triggerServiceIntegrationBase' - needs-docker-images: 'true' - test-triggerServiceIntegration: - needs: build - runs-on: ubuntu-latest - steps: - - name: Clones Kapua repo inside the runner - uses: actions/checkout@v3 - - uses: ./.github/actions/runTestsTaggedAs - with: - tag: '@triggerServiceIntegration' - needs-docker-images: 'true' + #the next 3 tests-suites have been disabled because in the code-base I can't find feature files tagged in this way +# test-triggerService: +# needs: build +# runs-on: ubuntu-latest +# steps: +# - name: Clones Kapua repo inside the runner +# uses: actions/checkout@v3 +# - uses: ./.github/actions/runTestsTaggedAs +# with: +# tag: '@triggerService' +# needs-docker-images: 'true' +# test-triggerServiceIntegrationBase: +# needs: build +# runs-on: ubuntu-latest +# steps: +# - name: Clones Kapua repo inside the runner +# uses: actions/checkout@v3 +# - uses: ./.github/actions/runTestsTaggedAs +# with: +# tag: '@triggerServiceIntegrationBase' +# needs-docker-images: 'true' +# test-triggerServiceIntegration: +# needs: build +# runs-on: ubuntu-latest +# steps: +# - name: Clones Kapua repo inside the runner +# uses: actions/checkout@v3 +# - uses: ./.github/actions/runTestsTaggedAs +# with: +# tag: '@triggerServiceIntegration' +# needs-docker-images: 'true' test-accountAndTranslator: needs: build runs-on: ubuntu-latest From 0dbdc11715a764608539cc191cbc740d048afd6e Mon Sep 17 00:00:00 2001 From: "angelo.andreussi" Date: Tue, 30 May 2023 15:24:55 +0200 Subject: [PATCH 09/11] removed full-build for jobs that need docker images --- .github/actions/runTestsTaggedAs/action.yaml | 2 +- .github/workflows/kapua-ci.yaml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/actions/runTestsTaggedAs/action.yaml b/.github/actions/runTestsTaggedAs/action.yaml index ada1586a041..4090773b354 100644 --- a/.github/actions/runTestsTaggedAs/action.yaml +++ b/.github/actions/runTestsTaggedAs/action.yaml @@ -24,7 +24,7 @@ runs: key: ${{ github.run_id }}-${{ github.run_number }}-maven-cache - name: Docker images creation if: ${{ inputs.needs-docker-images == 'true' }} - run: mvn -B ${BUILD_OPTS} -Pdocker -DskipTests clean install + run: mvn clean install -pl ${APP_PROJECTS} && mvn clean install -Pdocker --f assembly/pom.xml shell: bash - name: Dns look-up containers needed for tests - message-broker if: ${{ inputs.needs-docker-images == 'true' }} diff --git a/.github/workflows/kapua-ci.yaml b/.github/workflows/kapua-ci.yaml index 5247b2f35e4..8c7bee8d205 100755 --- a/.github/workflows/kapua-ci.yaml +++ b/.github/workflows/kapua-ci.yaml @@ -1,11 +1,12 @@ name: Kapua CI on: [ push, pull_request ] # Triggers the workflow on push or pull request events -env: +env: #the last 2 env variables defines respectively the maven projects were cucumber tests resides and maven projects were consumers applications needed for docker images building resides. BUILD_OPTS: "" CONFIG_OVERRIDES: "-Dcommons.db.schema=kapuadb -Dcommons.settings.hotswap=true -Dbroker.host=localhost -Dcrypto.secret.key=kapuaTestsKey!!!" MAVEN_OPTS: "-Xmx4096m" TEST_PROJECTS: "org.eclipse.kapua:kapua-security-test,org.eclipse.kapua:kapua-qa-integration,org.eclipse.kapua:kapua-scheduler-test,org.eclipse.kapua:kapua-user-test,org.eclipse.kapua:kapua-system-test,org.eclipse.kapua:kapua-job-test,org.eclipse.kapua:kapua-device-registry-test,org.eclipse.kapua:kapua-account-test,org.eclipse.kapua:kapua-tag-test,org.eclipse.kapua:kapua-translator-test" + APP_PROJECTS: "org.eclipse.kapua:kapua-service-authentication-app,org.eclipse.kapua:kapua-consumer-lifecycle-app,org.eclipse.kapua:kapua-consumer-telemetry-app" jobs: build: From 96a67917c38625bcfd1ca3ed359e833f836feadb Mon Sep 17 00:00:00 2001 From: "angelo.andreussi" Date: Wed, 31 May 2023 10:03:58 +0200 Subject: [PATCH 10/11] removed comments from removed tests --- .github/workflows/kapua-ci.yaml | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/.github/workflows/kapua-ci.yaml b/.github/workflows/kapua-ci.yaml index 8c7bee8d205..214f2c7bcc4 100755 --- a/.github/workflows/kapua-ci.yaml +++ b/.github/workflows/kapua-ci.yaml @@ -166,37 +166,6 @@ jobs: with: tag: '@jobsIntegration' needs-docker-images: 'true' - #the next 3 tests-suites have been disabled because in the code-base I can't find feature files tagged in this way -# test-triggerService: -# needs: build -# runs-on: ubuntu-latest -# steps: -# - name: Clones Kapua repo inside the runner -# uses: actions/checkout@v3 -# - uses: ./.github/actions/runTestsTaggedAs -# with: -# tag: '@triggerService' -# needs-docker-images: 'true' -# test-triggerServiceIntegrationBase: -# needs: build -# runs-on: ubuntu-latest -# steps: -# - name: Clones Kapua repo inside the runner -# uses: actions/checkout@v3 -# - uses: ./.github/actions/runTestsTaggedAs -# with: -# tag: '@triggerServiceIntegrationBase' -# needs-docker-images: 'true' -# test-triggerServiceIntegration: -# needs: build -# runs-on: ubuntu-latest -# steps: -# - name: Clones Kapua repo inside the runner -# uses: actions/checkout@v3 -# - uses: ./.github/actions/runTestsTaggedAs -# with: -# tag: '@triggerServiceIntegration' -# needs-docker-images: 'true' test-accountAndTranslator: needs: build runs-on: ubuntu-latest From e227c2939673306dc100d2d4d2533cf224347364 Mon Sep 17 00:00:00 2001 From: "angelo.andreussi" Date: Mon, 5 Jun 2023 15:19:57 +0200 Subject: [PATCH 11/11] Added time-out using default parameters & removing retry gitAction --- .github/actions/runTestsTaggedAs/action.yaml | 8 ++--- .github/workflows/kapua-ci.yaml | 35 ++++++++++++++++---- 2 files changed, 31 insertions(+), 12 deletions(-) diff --git a/.github/actions/runTestsTaggedAs/action.yaml b/.github/actions/runTestsTaggedAs/action.yaml index 4090773b354..472fe15a080 100644 --- a/.github/actions/runTestsTaggedAs/action.yaml +++ b/.github/actions/runTestsTaggedAs/action.yaml @@ -35,12 +35,8 @@ runs: run: echo "127.0.0.1 job-engine" | sudo tee -a /etc/hosts shell: bash - name: Test execution step - uses: nick-fields/retry@v2.8.1 - with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="${{ inputs.tag }}" -pl ${TEST_PROJECTS} verify + run: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='!org.eclipse.kapua.qa.markers.junit.JUnitTests' -Dcucumber.filter.tags="${{ inputs.tag }}" -pl ${TEST_PROJECTS} verify + shell: bash - name: Code-coverage results run: bash <(curl -s https://codecov.io/bash) shell: bash \ No newline at end of file diff --git a/.github/workflows/kapua-ci.yaml b/.github/workflows/kapua-ci.yaml index 214f2c7bcc4..130e74cfcd7 100755 --- a/.github/workflows/kapua-ci.yaml +++ b/.github/workflows/kapua-ci.yaml @@ -12,6 +12,7 @@ jobs: build: name: Build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - uses: actions/checkout@v3 # Checks out a copy of the repository on the ubuntu-latest machine - uses: actions/setup-java@v3 @@ -29,6 +30,7 @@ jobs: test-brokerAcl: needs: build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - name: Clones Kapua repo inside the runner uses: actions/checkout@v3 @@ -39,6 +41,7 @@ jobs: test-tag: needs: build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - name: Clones Kapua repo inside the runner uses: actions/checkout@v3 @@ -49,6 +52,7 @@ jobs: test-broker: needs: build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - name: Clones Kapua repo inside the runner uses: actions/checkout@v3 @@ -59,6 +63,7 @@ jobs: test-device: needs: build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - name: Clones Kapua repo inside the runner uses: actions/checkout@v3 @@ -69,6 +74,7 @@ jobs: test-device-management: needs: build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - name: Clones Kapua repo inside the runner uses: actions/checkout@v3 @@ -79,6 +85,7 @@ jobs: test-connection: needs: build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - name: Clones Kapua repo inside the runner uses: actions/checkout@v3 @@ -89,6 +96,7 @@ jobs: test-datastore: needs: build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - name: Clones Kapua repo inside the runner uses: actions/checkout@v3 @@ -99,6 +107,7 @@ jobs: test-user: needs: build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - name: Clones Kapua repo inside the runner uses: actions/checkout@v3 @@ -109,6 +118,7 @@ jobs: test-userIntegrationBase: needs: build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - name: Clones Kapua repo inside the runner uses: actions/checkout@v3 @@ -119,6 +129,7 @@ jobs: test-userIntegration: needs: build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - name: Clones Kapua repo inside the runner uses: actions/checkout@v3 @@ -129,6 +140,7 @@ jobs: test-security: needs: build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - name: Clones Kapua repo inside the runner uses: actions/checkout@v3 @@ -139,6 +151,7 @@ jobs: test-jobsAndScheduler: needs: build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - name: Clones Kapua repo inside the runner uses: actions/checkout@v3 @@ -149,6 +162,7 @@ jobs: test-jobsIntegrationBase: needs: build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - name: Clones Kapua repo inside the runner uses: actions/checkout@v3 @@ -159,6 +173,7 @@ jobs: test-jobsIntegration: needs: build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - name: Clones Kapua repo inside the runner uses: actions/checkout@v3 @@ -169,6 +184,7 @@ jobs: test-accountAndTranslator: needs: build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - name: Clones Kapua repo inside the runner uses: actions/checkout@v3 @@ -179,6 +195,7 @@ jobs: test-jobEngineStepDefinitions: needs: build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - name: Clones Kapua repo inside the runner uses: actions/checkout@v3 @@ -189,6 +206,7 @@ jobs: test-jobEngineStartOfflineDevice: needs: build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - name: Clones Kapua repo inside the runner uses: actions/checkout@v3 @@ -199,6 +217,7 @@ jobs: test-jobEngineStartOnlineDevice: needs: build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - name: Clones Kapua repo inside the runner uses: actions/checkout@v3 @@ -209,6 +228,7 @@ jobs: test-jobEngineRestartOfflineDevice: needs: build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - name: Clones Kapua repo inside the runner uses: actions/checkout@v3 @@ -219,6 +239,7 @@ jobs: test-jobEngineRestartOnlineDevice: needs: build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - name: Clones Kapua repo inside the runner uses: actions/checkout@v3 @@ -229,6 +250,7 @@ jobs: test-jobEngineRestartOnlineDeviceSecondPart: needs: build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - name: Clones Kapua repo inside the runner uses: actions/checkout@v3 @@ -239,6 +261,7 @@ jobs: test-jobEngineServiceStop: needs: build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - name: Clones Kapua repo inside the runner uses: actions/checkout@v3 @@ -249,6 +272,7 @@ jobs: test-RoleAndGroup: needs: build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - name: Clones Kapua repo inside the runner uses: actions/checkout@v3 @@ -259,6 +283,7 @@ jobs: test-deviceRegistry: needs: build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - name: Clones Kapua repo inside the runner uses: actions/checkout@v3 @@ -269,6 +294,7 @@ jobs: test-endpoint: needs: build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - name: Clones Kapua repo inside the runner uses: actions/checkout@v3 @@ -279,6 +305,7 @@ jobs: junit-tests: needs: build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - uses: actions/checkout@v3 - uses: actions/setup-java@v3 @@ -289,16 +316,12 @@ jobs: with: path: ~/.m2/repository key: ${{ github.run_id }}-${{ github.run_number }}-maven-cache - - uses: nick-fields/retry@v2.8.1 - with: - timeout_minutes: 45 - retry_on: error - max_attempts: 1 - command: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='org.eclipse.kapua.qa.markers.junit.JUnitTests' verify + - run: ./ci-output.sh mvn -B ${BUILD_OPTS} ${CONFIG_OVERRIDES} -Dgroups='org.eclipse.kapua.qa.markers.junit.JUnitTests' verify - run: bash <(curl -s https://codecov.io/bash) build-javadoc: needs: build runs-on: ubuntu-latest + timeout-minutes: 45 steps: - uses: actions/checkout@v3 - uses: actions/setup-java@v3