From 7da34ffd144689716712573d57e34145d6f38c91 Mon Sep 17 00:00:00 2001 From: jainadc9 <93383550+jainadc9@users.noreply.github.com> Date: Mon, 24 Mar 2025 13:46:35 +0530 Subject: [PATCH 1/4] Update code coverage with jacoco --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e8ae77bdf..071cc67a3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -114,14 +114,14 @@ jobs: tar xf /tmp/apache-maven-3.6.3-bin.tar.gz -C /opt echo "${M2_HOME}/bin" >> $GITHUB_PATH - - name: Run cobertura + - name: Run jacoco shell: bash run: | - mvn cobertura:cobertura -Dcobertura.report.format=xml -B + mvn -V -B -U clean test jacoco:report -Dformats=xml # Generating test coverage report and publishing to Codacy - name: Run report coverage uses: codacy/codacy-coverage-reporter-action@v1 with: project-token: 571cdd20d4bf435f84b25d806d304792 - coverage-reports: target/site/cobertura/coverage.xml + coverage-reports: target/jacoco/jacoco.xml From 830cdb01de351e14360db5d0a653ac57d1c34088 Mon Sep 17 00:00:00 2001 From: jainadc9 <93383550+jainadc9@users.noreply.github.com> Date: Mon, 24 Mar 2025 14:09:59 +0530 Subject: [PATCH 2/4] Update pom.xml --- pom.xml | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/pom.xml b/pom.xml index d6d73cf91..42161efaa 100644 --- a/pom.xml +++ b/pom.xml @@ -664,26 +664,44 @@ org.jacoco jacoco-maven-plugin 0.8.8 - - - com/ericsson/ei/controller/model/* - - - jacoco-initialize + prepare-agent prepare-agent - jacoco-site - package + report + prepare-package report + + post-unit-test + test + + report + + + + target/jacoco.exec + + target/jacoco + + + + + com/ericsson/ei/controller/model/* + + + target/jacoco.exec + + From 55a8102fdcffea3a0970735821c5d7463f39629f Mon Sep 17 00:00:00 2001 From: jainadc9 <93383550+jainadc9@users.noreply.github.com> Date: Tue, 1 Apr 2025 17:39:26 +0530 Subject: [PATCH 3/4] Update main.yml --- .github/workflows/main.yml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 071cc67a3..1c79da299 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,7 +17,7 @@ on: jobs: # This workflow contains a single job called "build" unitAndFunctionalTests: - if: github.repository == 'eiffel-community/eiffel-intelligence' + if: github.repository == 'eiffel-community/eiffel-intelligence' && false # The type of runner that the job will run on runs-on: ubuntu-latest env: @@ -53,7 +53,7 @@ jobs: mvn test -DskipITs -Dsurefire.rerunFailingTestsCount=2 -Djasypt.encryptor.password=secret -Dspring.config.location=src/functionaltests/resources/application.properties -B integrationTests: - if: github.repository == 'eiffel-community/eiffel-intelligence' + if: github.repository == 'eiffel-community/eiffel-intelligence' && false # The type of runner that the job will run on runs-on: ubuntu-latest @@ -91,7 +91,8 @@ jobs: mvn verify -DskipUTs -Djasypt.encryptor.password=integrationtest -Dspring.config.location=src/integrationtests/resources/application.properties -B reportCoverage: - if: github.repository == 'eiffel-community/eiffel-intelligence' && github.event_name == 'push' + if: github.repository == 'eiffel-community/eiffel-intelligence' + # && github.event_name == 'push' # The type of runner that the job will run on runs-on: ubuntu-latest env: @@ -113,15 +114,22 @@ jobs: wget https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz -P /tmp tar xf /tmp/apache-maven-3.6.3-bin.tar.gz -C /opt echo "${M2_HOME}/bin" >> $GITHUB_PATH + + # To ensure docker containers are fully up and running we sleep 60s + - name: Before script + run: | + source src/main/docker/env.bash + docker compose -f src/main/docker/docker-compose.yml up -d mongodb mongodb-auth rabbitmq eiffel-er mail-server + sleep 60 - name: Run jacoco shell: bash run: | - mvn -V -B -U clean test jacoco:report -Dformats=xml + mvn -V -B -U clean test -DskipITs -Dsurefire.rerunFailingTestsCount=2 -Djasypt.encryptor.password=secret -Dspring.config.location=src/functionaltests/resources/application.properties jacoco:report -Dformats=xml # Generating test coverage report and publishing to Codacy - name: Run report coverage uses: codacy/codacy-coverage-reporter-action@v1 with: project-token: 571cdd20d4bf435f84b25d806d304792 - coverage-reports: target/jacoco/jacoco.xml + coverage-reports: target/site/jacoco/jacoco.xml From 85c02b7e696da323ac2f0ceff4ca5dcd9659113a Mon Sep 17 00:00:00 2001 From: jainadc9 <93383550+jainadc9@users.noreply.github.com> Date: Tue, 1 Apr 2025 18:05:48 +0530 Subject: [PATCH 4/4] Update main.yml --- .github/workflows/main.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1c79da299..69cc70ae1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,7 +17,7 @@ on: jobs: # This workflow contains a single job called "build" unitAndFunctionalTests: - if: github.repository == 'eiffel-community/eiffel-intelligence' && false + if: github.repository == 'eiffel-community/eiffel-intelligence' # The type of runner that the job will run on runs-on: ubuntu-latest env: @@ -53,7 +53,7 @@ jobs: mvn test -DskipITs -Dsurefire.rerunFailingTestsCount=2 -Djasypt.encryptor.password=secret -Dspring.config.location=src/functionaltests/resources/application.properties -B integrationTests: - if: github.repository == 'eiffel-community/eiffel-intelligence' && false + if: github.repository == 'eiffel-community/eiffel-intelligence' # The type of runner that the job will run on runs-on: ubuntu-latest @@ -91,8 +91,7 @@ jobs: mvn verify -DskipUTs -Djasypt.encryptor.password=integrationtest -Dspring.config.location=src/integrationtests/resources/application.properties -B reportCoverage: - if: github.repository == 'eiffel-community/eiffel-intelligence' - # && github.event_name == 'push' + if: github.repository == 'eiffel-community/eiffel-intelligence' && github.event_name == 'push' # The type of runner that the job will run on runs-on: ubuntu-latest env: