Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX - Ci improvement - maven artifact caching and various tweaks #3785

Merged
merged 11 commits into from
Jun 7, 2023
46 changes: 46 additions & 0 deletions .github/actions/runTestsTaggedAs/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
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: Setup java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11
- name: Cache Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ github.run_id }}-${{ github.run_number }}-maven-cache
- name: Docker images creation
if: ${{ inputs.needs-docker-images == 'true' }}
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' }}
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 == 'true' }}
run: echo "127.0.0.1 job-engine" | sudo tee -a /etc/hosts
shell: bash
- name: Test execution step
uses: nick-fields/[email protected]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be removed completely? Having a retry plugin with attempts=1 just adds confusion

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I maintained it thinking that the timeout mechanism of 45 mins could be useful for some reason. I would wait what Riccardo has to say to this regard

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is no ather way (or action) to handle the timeout of a single job I prefer to keep the retry action.
Did you check the job 'timeout-minutes' parameter: timeout-parameter

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I introduced the job timeout parameter, substituting the retry GitAction. Learning the provided doc. I understood that this has an equivalent result

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
- name: Code-coverage results
run: bash <(curl -s https://codecov.io/bash)
shell: bash
Loading