From c56387039aa402f76b91cb0073590a0c792f8084 Mon Sep 17 00:00:00 2001 From: Tadgh Date: Thu, 10 Dec 2020 16:12:39 -0500 Subject: [PATCH 01/58] Rename file, partial rework --- azure-pipelines.yml | 8 ++++++++ slice_modules.sh | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 slice_modules.sh diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 5aecb406cbae..b8de75d9e876 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -14,6 +14,9 @@ pool: jobs: - job: Build + strategy: + parallel: 2 + displayName: Build Hapi timeoutInMinutes: 360 container: maven:3-jdk-11 steps: @@ -25,6 +28,11 @@ jobs: inputs: targetType: 'inline' script: mkdir -p $(MAVEN_CACHE_FOLDER); pwd; ls -al $(MAVEN_CACHE_FOLDER) + - task: Bash@3 + inputs: + targetType: 'filePath' + filePath: 'slice_modules.sh' + script: mkdir -p $(MAVEN_CACHE_FOLDER); pwd; ls -al $(MAVEN_CACHE_FOLDER) - task: Maven@3 env: JAVA_HOME_11_X64: /usr/local/openjdk-11 diff --git a/slice_modules.sh b/slice_modules.sh new file mode 100644 index 000000000000..72fb0319e9ea --- /dev/null +++ b/slice_modules.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +totalAgents=$SYSTEM_TOTALJOBSINPHASE +agentNumber=$SYSTEM_JOBPOSITIONINPHASE + +#totalAgents=4 +#agentNumber=2 + +if [[ $totalAgents -eq 0 ]]; then totalAgents=1; fi +if [ -z "$agentNumber" ]; then agentNumber=1; fi + +echo $totalAgents +echo $agentNumber + +# Find all directories that have hapi- in the name, assuming they are all modules. +modules=$(ls | grep "hapi-" | grep -v "\." | grep -v "hapi-fhir-jpaserver-base") + +modulesToTest="" + +if [ $agentNumber -eq 1 ]; then modulesToTest="hapi-fhir-jpaserver-base"; fi + +responsibleAgentCounter=1 + +for i in $modules; do + echo Counter is $responsibleAgentCounter + if [[ $responsibleAgentCounter -eq $agentNumber ]]; then + echo "adding $i to modules to test!"; + if [[ $modulesToTest == "" ]]; then + modulesToTest=$i + else + modulesToTest=$modulesToTest,$i; + fi; + fi + + responsibleAgentCounter=$((responsibleAgentCounter+1)) + if [[ $responsibleAgentCounter -gt $totalAgents ]]; then responsibleAgentCounter=1; fi +done + +echo This agent \[\#$agentNumber\] is responsible for these modules: $modulesToTest +echo "##vso[task.setvariable variable=slicedModules]$modulesToTest" From 1198622ed20f776863e51fa2346454a48c68d4e0 Mon Sep 17 00:00:00 2001 From: Tadgh Date: Thu, 10 Dec 2020 16:18:59 -0500 Subject: [PATCH 02/58] First pass at running parallel tests --- azure-pipelines.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b8de75d9e876..298c21e2b7a4 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -32,14 +32,13 @@ jobs: inputs: targetType: 'filePath' filePath: 'slice_modules.sh' - script: mkdir -p $(MAVEN_CACHE_FOLDER); pwd; ls -al $(MAVEN_CACHE_FOLDER) - task: Maven@3 env: JAVA_HOME_11_X64: /usr/local/openjdk-11 inputs: goals: 'clean install' # These are Maven CLI options (and show up in the build logs) - "-nsu"=Don't update snapshots. We can remove this when Maven OSS is more healthy - options: '-P ALLMODULES,JACOCO,CI,ERRORPRONE -e -B -Dmaven.repo.local=$(MAVEN_CACHE_FOLDER)' + options: "-P ALLMODULES,JACOCO,CI,ERRORPRONE -e -B -Dmaven.repo.local=$(MAVEN_CACHE_FOLDER) -pl :$(slicedModules)" # These are JVM options (and don't show up in the build logs) mavenOptions: '-Xmx1024m $(MAVEN_OPTS) -Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss,SSS -Duser.timezone=America/Toronto' jdkVersionOption: 1.11 From 6b0293ed6a435693d9031dd1d321d41993bce48f Mon Sep 17 00:00:00 2001 From: Tadgh Date: Thu, 10 Dec 2020 16:26:25 -0500 Subject: [PATCH 03/58] exclude some projects --- slice_modules.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slice_modules.sh b/slice_modules.sh index 72fb0319e9ea..c95c839746b5 100644 --- a/slice_modules.sh +++ b/slice_modules.sh @@ -13,7 +13,7 @@ echo $totalAgents echo $agentNumber # Find all directories that have hapi- in the name, assuming they are all modules. -modules=$(ls | grep "hapi-" | grep -v "\." | grep -v "hapi-fhir-jpaserver-base") +modules=$(ls | grep "hapi-" | grep -v "\." | grep -v "hapi-fhir-jpaserver-base" | grep -v "hapi-fhir-android-realm" | grep -v "hapi-fhir-narrativegenerator") modulesToTest="" From 5a5bc7acf97064cfebff75f2562f939ee06bb4a8 Mon Sep 17 00:00:00 2001 From: Tadgh Date: Thu, 10 Dec 2020 16:37:03 -0500 Subject: [PATCH 04/58] Update excludes --- slice_modules.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slice_modules.sh b/slice_modules.sh index c95c839746b5..95517300eee1 100644 --- a/slice_modules.sh +++ b/slice_modules.sh @@ -13,7 +13,7 @@ echo $totalAgents echo $agentNumber # Find all directories that have hapi- in the name, assuming they are all modules. -modules=$(ls | grep "hapi-" | grep -v "\." | grep -v "hapi-fhir-jpaserver-base" | grep -v "hapi-fhir-android-realm" | grep -v "hapi-fhir-narrativegenerator") +modules=$(ls | grep "hapi-" | grep -v "\." | grep -v "hapi-fhir-jpaserver-base" | grep -v "hapi-fhir-android-realm" | grep -v "hapi-fhir-narrativegenerator" | grep -v "hapi-fhir-oauth2" | grep -v "hapi-fhir-testpage-interceptor" | grep -v "hapi-fhir-structures-dstu" | ) modulesToTest="" From b90ee1246c4841a24f8e8993506c7d44a3bd152d Mon Sep 17 00:00:00 2001 From: Tadgh Date: Thu, 10 Dec 2020 16:42:31 -0500 Subject: [PATCH 05/58] Fix bug, add names --- azure-pipelines.yml | 2 ++ slice_modules.sh | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 298c21e2b7a4..cf155212154b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -25,10 +25,12 @@ jobs: key: 'maven | "$(Agent.OS)" | ./pom.xml' path: $(MAVEN_CACHE_FOLDER) - task: Bash@3 + displayName: Create Maven Cache inputs: targetType: 'inline' script: mkdir -p $(MAVEN_CACHE_FOLDER); pwd; ls -al $(MAVEN_CACHE_FOLDER) - task: Bash@3 + displayName: Determine Target Modules inputs: targetType: 'filePath' filePath: 'slice_modules.sh' diff --git a/slice_modules.sh b/slice_modules.sh index 95517300eee1..d624be25b384 100644 --- a/slice_modules.sh +++ b/slice_modules.sh @@ -13,7 +13,7 @@ echo $totalAgents echo $agentNumber # Find all directories that have hapi- in the name, assuming they are all modules. -modules=$(ls | grep "hapi-" | grep -v "\." | grep -v "hapi-fhir-jpaserver-base" | grep -v "hapi-fhir-android-realm" | grep -v "hapi-fhir-narrativegenerator" | grep -v "hapi-fhir-oauth2" | grep -v "hapi-fhir-testpage-interceptor" | grep -v "hapi-fhir-structures-dstu" | ) +modules=$(ls | grep "hapi-" | grep -v "\." | grep -v "hapi-fhir-jpaserver-base" | grep -v "hapi-fhir-android-realm" | grep -v "hapi-fhir-narrativegenerator" | grep -v "hapi-fhir-oauth2" | grep -v "hapi-fhir-testpage-interceptor" | grep -v "hapi-fhir-structures-dstu") modulesToTest="" From d1956361a5f4fb886fd822edba3ca229a6844268 Mon Sep 17 00:00:00 2001 From: Tadgh Date: Thu, 10 Dec 2020 17:52:50 -0500 Subject: [PATCH 06/58] try new slicing --- azure-pipelines.yml | 2 +- slice_modules.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index cf155212154b..4ec8aab8855a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -15,7 +15,7 @@ pool: jobs: - job: Build strategy: - parallel: 2 + parallel: 3 displayName: Build Hapi timeoutInMinutes: 360 container: maven:3-jdk-11 diff --git a/slice_modules.sh b/slice_modules.sh index d624be25b384..b3251741736a 100644 --- a/slice_modules.sh +++ b/slice_modules.sh @@ -19,7 +19,7 @@ modulesToTest="" if [ $agentNumber -eq 1 ]; then modulesToTest="hapi-fhir-jpaserver-base"; fi -responsibleAgentCounter=1 +responsibleAgentCounter=2 for i in $modules; do echo Counter is $responsibleAgentCounter From 1ea0f4953cf5333fede2398e7ce0ef411406b83d Mon Sep 17 00:00:00 2001 From: Tadgh Date: Thu, 10 Dec 2020 19:37:01 -0500 Subject: [PATCH 07/58] Add second job for reporting --- azure-pipelines.yml | 22 +++++++++++++++------- slice_modules.sh | 15 +++++++-------- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 4ec8aab8855a..6f3b3eb9793d 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -44,14 +44,22 @@ jobs: # These are JVM options (and don't show up in the build logs) mavenOptions: '-Xmx1024m $(MAVEN_OPTS) -Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss,SSS -Duser.timezone=America/Toronto' jdkVersionOption: 1.11 - - script: bash <(curl https://codecov.io/bash) -t $(CODECOV_TOKEN) - displayName: 'codecov' - - task: PublishCodeCoverageResults@1 +# - script: bash <(curl https://codecov.io/bash) -t $(CODECOV_TOKEN) +# displayName: 'codecov' + - job: Report + displayName: Report Results + container: maven:3-jdk-11 + - task: DownloadPipelineArtifact@2 inputs: - codeCoverageTool: 'JaCoCo' - summaryFileLocation: $(System.DefaultWorkingDirectory)/hapi-fhir-jacoco/target/site/jacoco-report/jacoco.xml - reportDirectory: $(System.DefaultWorkingDirectory)/hapi-fhir-jacoco/target/site/jacoco-report/ - failIfCoverageEmpty: false + patterns: "**" + - task: PublishCodeCoverageResults@1 + inputs: + codeCoverageTool: 'JaCoCo' + summaryFileLocation: $(System.DefaultWorkingDirectory)/hapi-fhir-jacoco/target/site/jacoco-report/jacoco.xml + reportDirectory: $(System.DefaultWorkingDirectory)/hapi-fhir-jacoco/target/site/jacoco-report/ + failIfCoverageEmpty: false + steps: + - task: # Potential Additional Maven3 Options: #publishJUnitResults: true diff --git a/slice_modules.sh b/slice_modules.sh index b3251741736a..1b39a1f96db9 100644 --- a/slice_modules.sh +++ b/slice_modules.sh @@ -13,11 +13,14 @@ echo $totalAgents echo $agentNumber # Find all directories that have hapi- in the name, assuming they are all modules. -modules=$(ls | grep "hapi-" | grep -v "\." | grep -v "hapi-fhir-jpaserver-base" | grep -v "hapi-fhir-android-realm" | grep -v "hapi-fhir-narrativegenerator" | grep -v "hapi-fhir-oauth2" | grep -v "hapi-fhir-testpage-interceptor" | grep -v "hapi-fhir-structures-dstu") +modules=$(ls | grep "hapi-" | grep -v "\." | grep -v "hapi-fhir-jpaserver-base" | grep -v "hapi-fhir-android-realm" | grep -v "hapi-fhir-narrativegenerator" | grep -v "hapi-fhir-oauth2" | grep -v "hapi-fhir-testpage-interceptor" | grep -v "hapi-fhir-structures-dstu" | grep -v "hapi-fhir-jacoco") -modulesToTest="" -if [ $agentNumber -eq 1 ]; then modulesToTest="hapi-fhir-jpaserver-base"; fi +# Every slice needs jacoco +modulesToTest="hapi-fhir-jacoco" + +# Assign the +if [ $agentNumber -eq 1 ]; then modulesToTest="$modulesToTest,hapi-fhir-jpaserver-base"; fi responsibleAgentCounter=2 @@ -25,11 +28,7 @@ for i in $modules; do echo Counter is $responsibleAgentCounter if [[ $responsibleAgentCounter -eq $agentNumber ]]; then echo "adding $i to modules to test!"; - if [[ $modulesToTest == "" ]]; then - modulesToTest=$i - else - modulesToTest=$modulesToTest,$i; - fi; + modulesToTest=$modulesToTest,$i; fi responsibleAgentCounter=$((responsibleAgentCounter+1)) From 339004c7d132e6d82e7946f533d0dc9c27f9e27e Mon Sep 17 00:00:00 2001 From: Tadgh Date: Thu, 10 Dec 2020 19:39:45 -0500 Subject: [PATCH 08/58] wip --- azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 6f3b3eb9793d..78eac652afc0 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -46,6 +46,7 @@ jobs: jdkVersionOption: 1.11 # - script: bash <(curl https://codecov.io/bash) -t $(CODECOV_TOKEN) # displayName: 'codecov' + -task: - job: Report displayName: Report Results container: maven:3-jdk-11 From 266fd56f6ab4cdc8b30c789d5847cdf639ef4eaf Mon Sep 17 00:00:00 2001 From: Tadgh Date: Thu, 10 Dec 2020 20:00:32 -0500 Subject: [PATCH 09/58] Try to aggregate logs --- azure-pipelines.yml | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 78eac652afc0..1c8b8847b7ae 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -46,21 +46,42 @@ jobs: jdkVersionOption: 1.11 # - script: bash <(curl https://codecov.io/bash) -t $(CODECOV_TOKEN) # displayName: 'codecov' - -task: + + # Copy test results into a sane location + - task: CopyFiles@2 + condition: always() + inputs: + sourceFolder: '$(System.DefaultWorkingDirectory)/' + contents: '**/*output.txt' + targetFolder: '$(Build.ArtifactStagingDirectory)' + + # Publish artifact containing test results. + - task: PublishPipelineArtifact@1 + displayName: 'Store Test Output' + condition: always() + inputs: + targetPath: '$(Build.ArtifactStagingDirectory)/' + artifactName: 'logs' + + # Amalgamate the test results, and report them. - job: Report displayName: Report Results container: maven:3-jdk-11 + steps: - task: DownloadPipelineArtifact@2 inputs: - patterns: "**" + artifact: 'logs' + - task: Bash@3 + displayName: PWD + inputs: + targetType: 'inline' + script: pwd; ls -al $(Pipeline.Workspace) - task: PublishCodeCoverageResults@1 inputs: codeCoverageTool: 'JaCoCo' summaryFileLocation: $(System.DefaultWorkingDirectory)/hapi-fhir-jacoco/target/site/jacoco-report/jacoco.xml reportDirectory: $(System.DefaultWorkingDirectory)/hapi-fhir-jacoco/target/site/jacoco-report/ failIfCoverageEmpty: false - steps: - - task: # Potential Additional Maven3 Options: #publishJUnitResults: true From d1d0fef969124833321ba4882c566332c732f72b Mon Sep 17 00:00:00 2001 From: Tadgh Date: Thu, 10 Dec 2020 21:26:15 -0500 Subject: [PATCH 10/58] woo yaml --- azure-pipelines.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 1c8b8847b7ae..c73e40dac989 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -77,11 +77,11 @@ jobs: targetType: 'inline' script: pwd; ls -al $(Pipeline.Workspace) - task: PublishCodeCoverageResults@1 - inputs: - codeCoverageTool: 'JaCoCo' - summaryFileLocation: $(System.DefaultWorkingDirectory)/hapi-fhir-jacoco/target/site/jacoco-report/jacoco.xml - reportDirectory: $(System.DefaultWorkingDirectory)/hapi-fhir-jacoco/target/site/jacoco-report/ - failIfCoverageEmpty: false + inputs: + codeCoverageTool: 'JaCoCo' + summaryFileLocation: $(System.DefaultWorkingDirectory)/hapi-fhir-jacoco/target/site/jacoco-report/jacoco.xml + reportDirectory: $(System.DefaultWorkingDirectory)/hapi-fhir-jacoco/target/site/jacoco-report/ + failIfCoverageEmpty: false # Potential Additional Maven3 Options: #publishJUnitResults: true From 315f0675597d2d34770c339138ab31be4ca6c479 Mon Sep 17 00:00:00 2001 From: Tadgh Date: Thu, 10 Dec 2020 21:36:43 -0500 Subject: [PATCH 11/58] Add a dependency --- azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c73e40dac989..b04f5ec4e302 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -65,6 +65,7 @@ jobs: # Amalgamate the test results, and report them. - job: Report + dependsOn: Build displayName: Report Results container: maven:3-jdk-11 steps: From 45d305ff8cf338d2d1271246739cba1d35d2382c Mon Sep 17 00:00:00 2001 From: Tadgh Date: Thu, 10 Dec 2020 22:42:13 -0500 Subject: [PATCH 12/58] Add naming of logs --- azure-pipelines.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b04f5ec4e302..07431ba0704f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -52,7 +52,9 @@ jobs: condition: always() inputs: sourceFolder: '$(System.DefaultWorkingDirectory)/' - contents: '**/*output.txt' + contents: | + **/surefire-reports/** + **/failsafe-reports/** targetFolder: '$(Build.ArtifactStagingDirectory)' # Publish artifact containing test results. @@ -61,7 +63,7 @@ jobs: condition: always() inputs: targetPath: '$(Build.ArtifactStagingDirectory)/' - artifactName: 'logs' + artifactName: 'logs-$(system.jobpositioninphase)' # Amalgamate the test results, and report them. - job: Report From 10c4561bc3e1d85e1e01ba6eac6dd2b2a1c100ae Mon Sep 17 00:00:00 2001 From: Tadgh Date: Fri, 11 Dec 2020 09:03:30 -0500 Subject: [PATCH 13/58] Pull all logs, ensure jpaserver is only thing running on its machine --- azure-pipelines.yml | 3 +-- slice_modules.sh | 6 +++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 07431ba0704f..e919ccc249b4 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -72,8 +72,7 @@ jobs: container: maven:3-jdk-11 steps: - task: DownloadPipelineArtifact@2 - inputs: - artifact: 'logs' + displayName: Download logs - task: Bash@3 displayName: PWD inputs: diff --git a/slice_modules.sh b/slice_modules.sh index 1b39a1f96db9..2e04857aef4e 100644 --- a/slice_modules.sh +++ b/slice_modules.sh @@ -24,6 +24,7 @@ if [ $agentNumber -eq 1 ]; then modulesToTest="$modulesToTest,hapi-fhir-jpaserve responsibleAgentCounter=2 +# For each parallel agent that _isnt_ the first, evenly split the remaining modules between them for i in $modules; do echo Counter is $responsibleAgentCounter if [[ $responsibleAgentCounter -eq $agentNumber ]]; then @@ -32,8 +33,11 @@ for i in $modules; do fi responsibleAgentCounter=$((responsibleAgentCounter+1)) - if [[ $responsibleAgentCounter -gt $totalAgents ]]; then responsibleAgentCounter=1; fi + if [[ $responsibleAgentCounter -gt $totalAgents ]]; then responsibleAgentCounter=2; fi done echo This agent \[\#$agentNumber\] is responsible for these modules: $modulesToTest + +# Set an Azure environment variable via this janky vso echo. +# This variable represents which projects this particular agent is responsible for testing. echo "##vso[task.setvariable variable=slicedModules]$modulesToTest" From 67e06caed6a844644bc8f18a7996dc149119dbbc Mon Sep 17 00:00:00 2001 From: Tadgh Date: Fri, 11 Dec 2020 09:37:21 -0500 Subject: [PATCH 14/58] remove verbose logs --- slice_modules.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/slice_modules.sh b/slice_modules.sh index 2e04857aef4e..60f2182e1781 100644 --- a/slice_modules.sh +++ b/slice_modules.sh @@ -28,7 +28,6 @@ responsibleAgentCounter=2 for i in $modules; do echo Counter is $responsibleAgentCounter if [[ $responsibleAgentCounter -eq $agentNumber ]]; then - echo "adding $i to modules to test!"; modulesToTest=$modulesToTest,$i; fi From 9d53f07ad845b0fdf532be56609aa9f09404632b Mon Sep 17 00:00:00 2001 From: Tadgh Date: Fri, 11 Dec 2020 10:15:24 -0500 Subject: [PATCH 15/58] Always report even if a build fails --- azure-pipelines.yml | 1 + .../java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4UpdateTest.java | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index e919ccc249b4..b455c3acdc70 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -68,6 +68,7 @@ jobs: # Amalgamate the test results, and report them. - job: Report dependsOn: Build + condition: always() displayName: Report Results container: maven:3-jdk-11 steps: diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4UpdateTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4UpdateTest.java index de716ee073d9..cb668f536207 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4UpdateTest.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4UpdateTest.java @@ -136,7 +136,6 @@ public void testUpdateConditionalOnEmailParameterWithPlusSymbol() { outcome = myPatientDao.search(SearchParameterMap.newSynchronous()); assertEquals(1, outcome.sizeOrThrowNpe()); - } @Test From d3df8d783da897c6e1cd1a03900a5f459ca1cafd Mon Sep 17 00:00:00 2001 From: Tadgh Date: Fri, 11 Dec 2020 11:11:24 -0500 Subject: [PATCH 16/58] Rework so full build occurs first --- azure-pipelines.yml | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b455c3acdc70..ffbf52993b81 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -14,6 +14,36 @@ pool: jobs: - job: Build + steps: + # Grab the previous cache + - task: Cache@2 + displayName: Get Maven Cache + inputs: + key: 'maven | "$(Agent.OS)" | ./pom.xml' + path: $(MAVEN_CACHE_FOLDER) + + # Build the project fully without tests. At the end of this job, this should be auto-stored in the cache, for future retrieval by subsequent jobs + - task: Maven@3 + displayName: Build Project + env: + JAVA_HOME_11_X64: /usr/local/openjdk-11 + inputs: + goals: 'clean install' + # These are Maven CLI options (and show up in the build logs) - "-nsu"=Don't update snapshots. We can remove this when Maven OSS is more healthy + options: "-P ALLMODULES,ERRORPRONE -e -B -Dmaven.repo.local=$(MAVEN_CACHE_FOLDER) -Dmaven.test.skip" + # These are JVM options (and don't show up in the build logs) + mavenOptions: '-Xmx1024m $(MAVEN_OPTS) -Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss,SSS -Duser.timezone=America/Toronto' + jdkVersionOption: 1.11 + + # Store this build + - task: PublishPipelineArtifact@1 + displayName: 'Store Test Output' + inputs: + targetPath: '$(Build.ArtifactStagingDirectory)/' + artifactName: 'logs-$(system.jobpositioninphase)' + + - job: Test + dependsOn: Build strategy: parallel: 3 displayName: Build Hapi @@ -67,7 +97,7 @@ jobs: # Amalgamate the test results, and report them. - job: Report - dependsOn: Build + dependsOn: Test condition: always() displayName: Report Results container: maven:3-jdk-11 From e404b238bef2b2676ba0ba6de25d9695d2fcd424 Mon Sep 17 00:00:00 2001 From: Tadgh Date: Fri, 11 Dec 2020 11:17:41 -0500 Subject: [PATCH 17/58] Typo --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ffbf52993b81..706f55e7e071 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -40,7 +40,7 @@ jobs: displayName: 'Store Test Output' inputs: targetPath: '$(Build.ArtifactStagingDirectory)/' - artifactName: 'logs-$(system.jobpositioninphase)' + artifactName: 'logs-$(system.jobpositioninphase)' - job: Test dependsOn: Build From aa05bc7b02fed29362a06b26292f50e8fc2b1c7a Mon Sep 17 00:00:00 2001 From: Tadgh Date: Fri, 11 Dec 2020 11:18:19 -0500 Subject: [PATCH 18/58] Rename build job --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 706f55e7e071..ebbce14c1b9f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -46,7 +46,7 @@ jobs: dependsOn: Build strategy: parallel: 3 - displayName: Build Hapi + displayName: Run Tests timeoutInMinutes: 360 container: maven:3-jdk-11 steps: From 9a8a6b962014a83e91c0ded1172f2c5fba527a83 Mon Sep 17 00:00:00 2001 From: Tadgh Date: Fri, 11 Dec 2020 11:24:14 -0500 Subject: [PATCH 19/58] Add container type to build --- azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ebbce14c1b9f..8e1a83c5dc1c 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -14,6 +14,7 @@ pool: jobs: - job: Build + container: maven:3-jdk-11 steps: # Grab the previous cache - task: Cache@2 From 1ce06731234f7d6156e48dfe2ace068d55addf4f Mon Sep 17 00:00:00 2001 From: Tadgh Date: Fri, 11 Dec 2020 12:19:36 -0500 Subject: [PATCH 20/58] force tests to run offline and use local repo --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 8e1a83c5dc1c..e11ce832189f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -71,7 +71,7 @@ jobs: inputs: goals: 'clean install' # These are Maven CLI options (and show up in the build logs) - "-nsu"=Don't update snapshots. We can remove this when Maven OSS is more healthy - options: "-P ALLMODULES,JACOCO,CI,ERRORPRONE -e -B -Dmaven.repo.local=$(MAVEN_CACHE_FOLDER) -pl :$(slicedModules)" + options: "-P ALLMODULES,JACOCO,CI,ERRORPRONE -o -e -B -Dmaven.repo.local=$(MAVEN_CACHE_FOLDER) -pl :$(slicedModules)" # These are JVM options (and don't show up in the build logs) mavenOptions: '-Xmx1024m $(MAVEN_OPTS) -Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss,SSS -Duser.timezone=America/Toronto' jdkVersionOption: 1.11 From 37b377318bd4de8477ed45d91625a27cfa0a3947 Mon Sep 17 00:00:00 2001 From: Tadgh Date: Fri, 11 Dec 2020 12:36:13 -0500 Subject: [PATCH 21/58] See if cache is actually working --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index e11ce832189f..abad4cf42da7 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -20,7 +20,7 @@ jobs: - task: Cache@2 displayName: Get Maven Cache inputs: - key: 'maven | "$(Agent.OS)" | ./pom.xml' + key: 'maven | "$(Agent.OS)" | ./pom.xml | "1"' path: $(MAVEN_CACHE_FOLDER) # Build the project fully without tests. At the end of this job, this should be auto-stored in the cache, for future retrieval by subsequent jobs @@ -53,7 +53,7 @@ jobs: steps: - task: Cache@2 inputs: - key: 'maven | "$(Agent.OS)" | ./pom.xml' + key: 'maven | "$(Agent.OS)" | ./pom.xml | "1"' path: $(MAVEN_CACHE_FOLDER) - task: Bash@3 displayName: Create Maven Cache From b1b43f5d6cf40ad9f1f5abe2533a1b761b257111 Mon Sep 17 00:00:00 2001 From: Tadgh Date: Fri, 11 Dec 2020 13:38:23 -0500 Subject: [PATCH 22/58] Add CI profile to initial build --- azure-pipelines.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index abad4cf42da7..6387ff027e38 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -20,7 +20,7 @@ jobs: - task: Cache@2 displayName: Get Maven Cache inputs: - key: 'maven | "$(Agent.OS)" | ./pom.xml | "1"' + key: 'maven | "$(Agent.OS)" | ./pom.xml | "2"' path: $(MAVEN_CACHE_FOLDER) # Build the project fully without tests. At the end of this job, this should be auto-stored in the cache, for future retrieval by subsequent jobs @@ -31,7 +31,7 @@ jobs: inputs: goals: 'clean install' # These are Maven CLI options (and show up in the build logs) - "-nsu"=Don't update snapshots. We can remove this when Maven OSS is more healthy - options: "-P ALLMODULES,ERRORPRONE -e -B -Dmaven.repo.local=$(MAVEN_CACHE_FOLDER) -Dmaven.test.skip" + options: "-P ALLMODULES,JACOCO,ERRORPRONE,CI -e -B -Dmaven.repo.local=$(MAVEN_CACHE_FOLDER) -Dmaven.test.skip" # These are JVM options (and don't show up in the build logs) mavenOptions: '-Xmx1024m $(MAVEN_OPTS) -Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss,SSS -Duser.timezone=America/Toronto' jdkVersionOption: 1.11 @@ -53,7 +53,7 @@ jobs: steps: - task: Cache@2 inputs: - key: 'maven | "$(Agent.OS)" | ./pom.xml | "1"' + key: 'maven | "$(Agent.OS)" | ./pom.xml | "2"' path: $(MAVEN_CACHE_FOLDER) - task: Bash@3 displayName: Create Maven Cache From 99e6f30686975e95ac26c4e98b9b629052aa340b Mon Sep 17 00:00:00 2001 From: Tadgh Date: Fri, 11 Dec 2020 14:00:20 -0500 Subject: [PATCH 23/58] Add -am flag --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 6387ff027e38..e960050f0b12 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -71,7 +71,7 @@ jobs: inputs: goals: 'clean install' # These are Maven CLI options (and show up in the build logs) - "-nsu"=Don't update snapshots. We can remove this when Maven OSS is more healthy - options: "-P ALLMODULES,JACOCO,CI,ERRORPRONE -o -e -B -Dmaven.repo.local=$(MAVEN_CACHE_FOLDER) -pl :$(slicedModules)" + options: "-P ALLMODULES,JACOCO,CI,ERRORPRONE -e -B -Dmaven.repo.local=$(MAVEN_CACHE_FOLDER) -am -pl :$(slicedModules)" # These are JVM options (and don't show up in the build logs) mavenOptions: '-Xmx1024m $(MAVEN_OPTS) -Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss,SSS -Duser.timezone=America/Toronto' jdkVersionOption: 1.11 From e0a8680ae87a4af712ec0f111f2d7f4cf75a5db3 Mon Sep 17 00:00:00 2001 From: Tadgh Date: Fri, 11 Dec 2020 18:02:53 -0500 Subject: [PATCH 24/58] strip -am run --- azure-pipelines.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index e960050f0b12..5e342fc6ec59 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -20,7 +20,7 @@ jobs: - task: Cache@2 displayName: Get Maven Cache inputs: - key: 'maven | "$(Agent.OS)" | ./pom.xml | "2"' + key: 'maven | "$(Agent.OS)" | ./pom.xml | "4"' path: $(MAVEN_CACHE_FOLDER) # Build the project fully without tests. At the end of this job, this should be auto-stored in the cache, for future retrieval by subsequent jobs @@ -53,7 +53,7 @@ jobs: steps: - task: Cache@2 inputs: - key: 'maven | "$(Agent.OS)" | ./pom.xml | "2"' + key: 'maven | "$(Agent.OS)" | ./pom.xml | "4"' path: $(MAVEN_CACHE_FOLDER) - task: Bash@3 displayName: Create Maven Cache @@ -71,7 +71,7 @@ jobs: inputs: goals: 'clean install' # These are Maven CLI options (and show up in the build logs) - "-nsu"=Don't update snapshots. We can remove this when Maven OSS is more healthy - options: "-P ALLMODULES,JACOCO,CI,ERRORPRONE -e -B -Dmaven.repo.local=$(MAVEN_CACHE_FOLDER) -am -pl :$(slicedModules)" + options: "-P ALLMODULES,JACOCO,CI,ERRORPRONE -e -B -Dmaven.repo.local=$(MAVEN_CACHE_FOLDER) -pl :$(slicedModules)" # These are JVM options (and don't show up in the build logs) mavenOptions: '-Xmx1024m $(MAVEN_OPTS) -Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss,SSS -Duser.timezone=America/Toronto' jdkVersionOption: 1.11 From 22f575c8c82c93bc53accb8b65613c45bb3c902e Mon Sep 17 00:00:00 2001 From: Tadgh Date: Wed, 16 Dec 2020 21:14:48 -0500 Subject: [PATCH 25/58] test jacoco --- azure-pipelines.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 5e342fc6ec59..36c2ca1c753b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -113,8 +113,10 @@ jobs: - task: PublishCodeCoverageResults@1 inputs: codeCoverageTool: 'JaCoCo' - summaryFileLocation: $(System.DefaultWorkingDirectory)/hapi-fhir-jacoco/target/site/jacoco-report/jacoco.xml - reportDirectory: $(System.DefaultWorkingDirectory)/hapi-fhir-jacoco/target/site/jacoco-report/ + summaryFileLocation: $(Pipeline.Workspace) + reportDirectory: $(Pipeline.Workspace) + # summaryFileLocation: $(System.DefaultWorkingDirectory)/hapi-fhir-jacoco/target/site/jacoco-report/jacoco.xml + # reportDirectory: $(System.DefaultWorkingDirectory)/hapi-fhir-jacoco/target/site/jacoco-report/ failIfCoverageEmpty: false # Potential Additional Maven3 Options: From ab3a8f69506490cdb6f50e4de3f033a47bf33ec9 Mon Sep 17 00:00:00 2001 From: Tadgh Date: Wed, 16 Dec 2020 22:17:47 -0500 Subject: [PATCH 26/58] rename logs --- azure-pipelines.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 36c2ca1c753b..161c42729df4 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -94,7 +94,8 @@ jobs: condition: always() inputs: targetPath: '$(Build.ArtifactStagingDirectory)/' - artifactName: 'logs-$(system.jobpositioninphase)' +# artifactName: 'logs-$(system.jobpositioninphase)' + artifactName: 'logs-$(Agent.id)' # Amalgamate the test results, and report them. - job: Report From e10dbbaff3536e623d52660287709590875c8918 Mon Sep 17 00:00:00 2001 From: Tadgh Date: Wed, 16 Dec 2020 22:26:17 -0500 Subject: [PATCH 27/58] fix typo --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 161c42729df4..85e2a5c99833 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -95,7 +95,7 @@ jobs: inputs: targetPath: '$(Build.ArtifactStagingDirectory)/' # artifactName: 'logs-$(system.jobpositioninphase)' - artifactName: 'logs-$(Agent.id)' + artifactName: 'logs-$(Agent.id)' # Amalgamate the test results, and report them. - job: Report From 5b9d7e9fd34e2105fd7fa93f2a9256674618ffe2 Mon Sep 17 00:00:00 2001 From: Tadgh Date: Thu, 17 Dec 2020 11:56:56 -0500 Subject: [PATCH 28/58] Try to get jacoco working --- azure-pipelines.yml | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 85e2a5c99833..f1d6ffb03936 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -56,10 +56,10 @@ jobs: key: 'maven | "$(Agent.OS)" | ./pom.xml | "4"' path: $(MAVEN_CACHE_FOLDER) - task: Bash@3 - displayName: Create Maven Cache + displayName: Create Directories inputs: targetType: 'inline' - script: mkdir -p $(MAVEN_CACHE_FOLDER); pwd; ls -al $(MAVEN_CACHE_FOLDER) + script: mkdir -p $(MAVEN_CACHE_FOLDER); pwd; ls -al $(MAVEN_CACHE_FOLDER); mkdir $(Build.ArtifactStagingDirectory)/jacoco-output; mkdir $(Build.ArtifactStagingDirectory)/test-output; - task: Bash@3 displayName: Determine Target Modules inputs: @@ -81,22 +81,40 @@ jobs: # Copy test results into a sane location - task: CopyFiles@2 condition: always() + displayName: Move Test Outputs inputs: sourceFolder: '$(System.DefaultWorkingDirectory)/' contents: | **/surefire-reports/** **/failsafe-reports/** - targetFolder: '$(Build.ArtifactStagingDirectory)' + targetFolder: '$(Build.ArtifactStagingDirectory)/test-output' + + # Copy Jacoco results into a sane location + - task: CopyFiles@2 + condition: always() + displayName: Move JaCoCo Outputs + inputs: + sourceFolder: '$(System.DefaultWorkingDirectory)/hapi-fhir-jacoco/target/site/jacoco-report/' + contents: | + ** + targetFolder: '$(Build.ArtifactStagingDirectory)/jacoco-output' # Publish artifact containing test results. - task: PublishPipelineArtifact@1 displayName: 'Store Test Output' condition: always() inputs: - targetPath: '$(Build.ArtifactStagingDirectory)/' -# artifactName: 'logs-$(system.jobpositioninphase)' + targetPath: '$(Build.ArtifactStagingDirectory)/test-output' artifactName: 'logs-$(Agent.id)' + # Publish artifact containing test results. + - task: PublishPipelineArtifact@1 + displayName: 'Store Jacoco Output' + condition: always() + inputs: + targetPath: '$(Build.ArtifactStagingDirectory)/jacoco-output' + artifactName: 'jacoco-$(Agent.id)' + # Amalgamate the test results, and report them. - job: Report dependsOn: Test @@ -105,17 +123,18 @@ jobs: container: maven:3-jdk-11 steps: - task: DownloadPipelineArtifact@2 - displayName: Download logs + displayName: Download Artifacts - task: Bash@3 displayName: PWD inputs: targetType: 'inline' script: pwd; ls -al $(Pipeline.Workspace) + - script: mkdir jacoco-combined; cp jacoco-*/* jacoco-combined - task: PublishCodeCoverageResults@1 inputs: codeCoverageTool: 'JaCoCo' - summaryFileLocation: $(Pipeline.Workspace) - reportDirectory: $(Pipeline.Workspace) + summaryFileLocation: $(Pipeline.Workspace)/jacoco-combined/jacoco.xml + reportDirectory: $(Pipeline.Workspace)/jacoco-combined # summaryFileLocation: $(System.DefaultWorkingDirectory)/hapi-fhir-jacoco/target/site/jacoco-report/jacoco.xml # reportDirectory: $(System.DefaultWorkingDirectory)/hapi-fhir-jacoco/target/site/jacoco-report/ failIfCoverageEmpty: false From fa6876d193eceb68d33b10b4983cc7e551f128ba Mon Sep 17 00:00:00 2001 From: Tadgh Date: Thu, 17 Dec 2020 13:56:45 -0500 Subject: [PATCH 29/58] working out jacoco.. --- azure-pipelines.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index f1d6ffb03936..aa204b4f4788 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -129,7 +129,15 @@ jobs: inputs: targetType: 'inline' script: pwd; ls -al $(Pipeline.Workspace) - - script: mkdir jacoco-combined; cp jacoco-*/* jacoco-combined + - script: mkdir jacoco-combined + - task: CopyFiles@2 + condition: always() + displayName: Move JaCoCo Outputs + inputs: + sourceFolder: '$(Pipeline.Workspace)' + contents: | + jacoco-*/** + targetFolder: '$(Pipeline.Workspace)/jacoco-combined' - task: PublishCodeCoverageResults@1 inputs: codeCoverageTool: 'JaCoCo' From 16c6828e5fbbc429406ec8d187f4c1423dfcc48a Mon Sep 17 00:00:00 2001 From: Tadgh Date: Fri, 18 Dec 2020 14:51:11 -0500 Subject: [PATCH 30/58] Explore removing name --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index aa204b4f4788..80b931c322fe 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -41,7 +41,7 @@ jobs: displayName: 'Store Test Output' inputs: targetPath: '$(Build.ArtifactStagingDirectory)/' - artifactName: 'logs-$(system.jobpositioninphase)' +# artifactName: 'logs-$(system.jobpositioninphase)' - job: Test dependsOn: Build From 728ed8ea424d99a6b254d7fb7a2144fb2866371d Mon Sep 17 00:00:00 2001 From: Tadgh Date: Sun, 20 Dec 2020 10:55:47 -0500 Subject: [PATCH 31/58] Flatten files --- azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 80b931c322fe..11366ec38cf8 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -137,6 +137,7 @@ jobs: sourceFolder: '$(Pipeline.Workspace)' contents: | jacoco-*/** + flattenFolders: true targetFolder: '$(Pipeline.Workspace)/jacoco-combined' - task: PublishCodeCoverageResults@1 inputs: From 0e03c69477cc6f1d3677bbde23c3f3dbca692f12 Mon Sep 17 00:00:00 2001 From: Tadgh Date: Mon, 4 Jan 2021 10:56:54 -0500 Subject: [PATCH 32/58] Update to using reportgenerator --- azure-pipelines.yml | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 11366ec38cf8..69186bbfe2f2 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -124,28 +124,38 @@ jobs: steps: - task: DownloadPipelineArtifact@2 displayName: Download Artifacts + - script: mkdir jacoco-combined + - script: mkdir coveragereport - task: Bash@3 displayName: PWD inputs: targetType: 'inline' script: pwd; ls -al $(Pipeline.Workspace) - - script: mkdir jacoco-combined - - task: CopyFiles@2 - condition: always() - displayName: Move JaCoCo Outputs - inputs: - sourceFolder: '$(Pipeline.Workspace)' - contents: | - jacoco-*/** - flattenFolders: true - targetFolder: '$(Pipeline.Workspace)/jacoco-combined' +# - task: CopyFiles@2 +# condition: always() +# displayName: Move JaCoCo Outputs +# inputs: +# sourceFolder: '$(Pipeline.Workspace)' +# contents: | +# jacoco-*/** +# flattenFolders: true +# targetFolder: '$(Pipeline.Workspace)/jacoco-combined' + - task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@4 + displayName: Generate Reports + inputs: + reports: 'jacoco-*/jacoco.xml' # REQUIRED # The coverage reports that should be parsed (separated by semicolon). Globbing is supported. + targetdir: '$(Pipeline.Workspace)/coveragereport' # REQUIRED # The directory where the generated report should be saved. + reporttypes: 'HtmlInline_AzurePipelines;Xml;XmlSummary' # The output formats and scope (separated by semicolon) Values: Badges, Clover, Cobertura, CsvSummary, Html, HtmlChart, HtmlInline, HtmlInline_AzurePipelines, HtmlInline_AzurePipelines_Dark, HtmlSummary, JsonSummary, Latex, LatexSummary, lcov, MHtml, PngChart, SonarQube, TeamCitySummary, TextSummary, Xml, XmlSummary + verbosity: 'Verbose' # The verbosity level of the log messages. Values: Verbose, Info, Warning, Error, Off + title: 'jacoco.xml' # Optional title. + tag: '$(build.buildnumber)_#$(build.buildid)' # Optional tag or build version. + + - script: ls -al coveragereport - task: PublishCodeCoverageResults@1 inputs: codeCoverageTool: 'JaCoCo' - summaryFileLocation: $(Pipeline.Workspace)/jacoco-combined/jacoco.xml - reportDirectory: $(Pipeline.Workspace)/jacoco-combined - # summaryFileLocation: $(System.DefaultWorkingDirectory)/hapi-fhir-jacoco/target/site/jacoco-report/jacoco.xml - # reportDirectory: $(System.DefaultWorkingDirectory)/hapi-fhir-jacoco/target/site/jacoco-report/ + summaryFileLocation: $(Pipeline.Workspace)/coveragereport/jacoco.xml + reportDirectory: $(Pipeline.Workspace)/coveragereport failIfCoverageEmpty: false # Potential Additional Maven3 Options: From 200616001d0a125818fb5bac9f18d7863a8bf6b5 Mon Sep 17 00:00:00 2001 From: Tadgh Date: Mon, 4 Jan 2021 12:04:41 -0500 Subject: [PATCH 33/58] Add dotnet core for reportgenerator --- azure-pipelines.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 69186bbfe2f2..3831a76de227 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -122,6 +122,11 @@ jobs: displayName: Report Results container: maven:3-jdk-11 steps: + - task: UseDotNet@2 + displayName: Setup Dotnet Core + inputs: + packageType: 'sdk' + version: '2.X' - task: DownloadPipelineArtifact@2 displayName: Download Artifacts - script: mkdir jacoco-combined @@ -140,7 +145,7 @@ jobs: # jacoco-*/** # flattenFolders: true # targetFolder: '$(Pipeline.Workspace)/jacoco-combined' - - task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@4 + - task: reportgenerator@4 displayName: Generate Reports inputs: reports: 'jacoco-*/jacoco.xml' # REQUIRED # The coverage reports that should be parsed (separated by semicolon). Globbing is supported. From 4088193c2fd9f414e8e3c25d2bb4966aa5eb8898 Mon Sep 17 00:00:00 2001 From: Tadgh Date: Mon, 4 Jan 2021 13:36:12 -0500 Subject: [PATCH 34/58] apparently case sensitive --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 3831a76de227..187f7b029ec8 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -126,7 +126,7 @@ jobs: displayName: Setup Dotnet Core inputs: packageType: 'sdk' - version: '2.X' + version: '2.x' - task: DownloadPipelineArtifact@2 displayName: Download Artifacts - script: mkdir jacoco-combined From b5d39b2489f98b707dc4378d68515f8be33e1d58 Mon Sep 17 00:00:00 2001 From: Tadgh Date: Mon, 4 Jan 2021 14:35:49 -0500 Subject: [PATCH 35/58] chagne container of reporting job --- azure-pipelines.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 187f7b029ec8..25787d0eefbd 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -120,7 +120,6 @@ jobs: dependsOn: Test condition: always() displayName: Report Results - container: maven:3-jdk-11 steps: - task: UseDotNet@2 displayName: Setup Dotnet Core From dd514f1b4327805ef8e5ca4a3f4925e60eb26c88 Mon Sep 17 00:00:00 2001 From: Tadgh Date: Mon, 4 Jan 2021 15:30:52 -0500 Subject: [PATCH 36/58] Fix globbing --- azure-pipelines.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 25787d0eefbd..09dfdba3b909 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -147,12 +147,11 @@ jobs: - task: reportgenerator@4 displayName: Generate Reports inputs: - reports: 'jacoco-*/jacoco.xml' # REQUIRED # The coverage reports that should be parsed (separated by semicolon). Globbing is supported. + reports: "$(Pipeline.Workspace)/**/jacoco.xml" # REQUIRED # The coverage reports that should be parsed (separated by semicolon). Globbing is supported. targetdir: '$(Pipeline.Workspace)/coveragereport' # REQUIRED # The directory where the generated report should be saved. reporttypes: 'HtmlInline_AzurePipelines;Xml;XmlSummary' # The output formats and scope (separated by semicolon) Values: Badges, Clover, Cobertura, CsvSummary, Html, HtmlChart, HtmlInline, HtmlInline_AzurePipelines, HtmlInline_AzurePipelines_Dark, HtmlSummary, JsonSummary, Latex, LatexSummary, lcov, MHtml, PngChart, SonarQube, TeamCitySummary, TextSummary, Xml, XmlSummary verbosity: 'Verbose' # The verbosity level of the log messages. Values: Verbose, Info, Warning, Error, Off title: 'jacoco.xml' # Optional title. - tag: '$(build.buildnumber)_#$(build.buildid)' # Optional tag or build version. - script: ls -al coveragereport - task: PublishCodeCoverageResults@1 From 93f862a8f28256118a92c12211f38dadf5addfbc Mon Sep 17 00:00:00 2001 From: Tadgh Date: Mon, 4 Jan 2021 17:22:29 -0500 Subject: [PATCH 37/58] Find test coverage results --- azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 09dfdba3b909..a225247ce7b1 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -153,11 +153,11 @@ jobs: verbosity: 'Verbose' # The verbosity level of the log messages. Values: Verbose, Info, Warning, Error, Off title: 'jacoco.xml' # Optional title. - - script: ls -al coveragereport + - script: ls -al $(Pipeline.Workspace)/coveragereport - task: PublishCodeCoverageResults@1 inputs: codeCoverageTool: 'JaCoCo' - summaryFileLocation: $(Pipeline.Workspace)/coveragereport/jacoco.xml + summaryFileLocation: $(Pipeline.Workspace)/coveragereport/Summary.xml reportDirectory: $(Pipeline.Workspace)/coveragereport failIfCoverageEmpty: false From df827c80ebffbf914a9d83ce40e2828f1666e62a Mon Sep 17 00:00:00 2001 From: Tadgh Date: Mon, 4 Jan 2021 18:43:07 -0500 Subject: [PATCH 38/58] Re-add codecov --- azure-pipelines.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index a225247ce7b1..fdb28071a0f7 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -5,6 +5,7 @@ variables: #MAVEN_CACHE_FOLDER: $(Agent.TempDirectory)/.m2/repository #MAVEN_OPTS: '-Dmaven.repo.local=$(MAVEN_CACHE_FOLDER)' MAVEN_OPTS: '' + disable.coverage.autogenerate: 'true' trigger: - master @@ -149,14 +150,16 @@ jobs: inputs: reports: "$(Pipeline.Workspace)/**/jacoco.xml" # REQUIRED # The coverage reports that should be parsed (separated by semicolon). Globbing is supported. targetdir: '$(Pipeline.Workspace)/coveragereport' # REQUIRED # The directory where the generated report should be saved. - reporttypes: 'HtmlInline_AzurePipelines;Xml;XmlSummary' # The output formats and scope (separated by semicolon) Values: Badges, Clover, Cobertura, CsvSummary, Html, HtmlChart, HtmlInline, HtmlInline_AzurePipelines, HtmlInline_AzurePipelines_Dark, HtmlSummary, JsonSummary, Latex, LatexSummary, lcov, MHtml, PngChart, SonarQube, TeamCitySummary, TextSummary, Xml, XmlSummary + reporttypes: 'HtmlInline_AzurePipelines;Xml;Cobertura' # The output formats and scope (separated by semicolon) Values: Badges, Clover, Cobertura, CsvSummary, Html, HtmlChart, HtmlInline, HtmlInline_AzurePipelines, HtmlInline_AzurePipelines_Dark, HtmlSummary, JsonSummary, Latex, LatexSummary, lcov, MHtml, PngChart, SonarQube, TeamCitySummary, TextSummary, Xml, XmlSummary verbosity: 'Verbose' # The verbosity level of the log messages. Values: Verbose, Info, Warning, Error, Off title: 'jacoco.xml' # Optional title. - script: ls -al $(Pipeline.Workspace)/coveragereport + - script: bash <(curl https://codecov.io/bash) -t $(CODECOV_TOKEN) + displayName: 'codecov' - task: PublishCodeCoverageResults@1 inputs: - codeCoverageTool: 'JaCoCo' + codeCoverageTool: 'Cobertura' summaryFileLocation: $(Pipeline.Workspace)/coveragereport/Summary.xml reportDirectory: $(Pipeline.Workspace)/coveragereport failIfCoverageEmpty: false From c9a663a6a2afd273292e238bf93724f207ed78e6 Mon Sep 17 00:00:00 2001 From: Tadgh Date: Mon, 4 Jan 2021 18:46:12 -0500 Subject: [PATCH 39/58] Fix spacing --- azure-pipelines.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index fdb28071a0f7..a06572d70f01 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -152,11 +152,9 @@ jobs: targetdir: '$(Pipeline.Workspace)/coveragereport' # REQUIRED # The directory where the generated report should be saved. reporttypes: 'HtmlInline_AzurePipelines;Xml;Cobertura' # The output formats and scope (separated by semicolon) Values: Badges, Clover, Cobertura, CsvSummary, Html, HtmlChart, HtmlInline, HtmlInline_AzurePipelines, HtmlInline_AzurePipelines_Dark, HtmlSummary, JsonSummary, Latex, LatexSummary, lcov, MHtml, PngChart, SonarQube, TeamCitySummary, TextSummary, Xml, XmlSummary verbosity: 'Verbose' # The verbosity level of the log messages. Values: Verbose, Info, Warning, Error, Off - title: 'jacoco.xml' # Optional title. - - script: ls -al $(Pipeline.Workspace)/coveragereport - - script: bash <(curl https://codecov.io/bash) -t $(CODECOV_TOKEN) - displayName: 'codecov' + - script: bash <(curl https://codecov.io/bash) -t $(CODECOV_TOKEN) + displayName: 'codecov' - task: PublishCodeCoverageResults@1 inputs: codeCoverageTool: 'Cobertura' From c3a2666183027652c74454aed817f9dd1bd54bbd Mon Sep 17 00:00:00 2001 From: Tadgh Date: Mon, 4 Jan 2021 20:34:37 -0500 Subject: [PATCH 40/58] Update file --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index a06572d70f01..ca5e4d2dd30e 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -158,7 +158,7 @@ jobs: - task: PublishCodeCoverageResults@1 inputs: codeCoverageTool: 'Cobertura' - summaryFileLocation: $(Pipeline.Workspace)/coveragereport/Summary.xml + summaryFileLocation: $(Pipeline.Workspace)/coveragereport/Cobertura.xml reportDirectory: $(Pipeline.Workspace)/coveragereport failIfCoverageEmpty: false From 2c334578a510731e3a723a236022193658c337f5 Mon Sep 17 00:00:00 2001 From: Tadgh Date: Tue, 5 Jan 2021 08:50:15 -0500 Subject: [PATCH 41/58] Change test skipping method --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ca5e4d2dd30e..ddb987b8bf44 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -32,7 +32,7 @@ jobs: inputs: goals: 'clean install' # These are Maven CLI options (and show up in the build logs) - "-nsu"=Don't update snapshots. We can remove this when Maven OSS is more healthy - options: "-P ALLMODULES,JACOCO,ERRORPRONE,CI -e -B -Dmaven.repo.local=$(MAVEN_CACHE_FOLDER) -Dmaven.test.skip" + options: "-P ALLMODULES,JACOCO,ERRORPRONE,CI -e -B -Dmaven.repo.local=$(MAVEN_CACHE_FOLDER) -DskipTests" # These are JVM options (and don't show up in the build logs) mavenOptions: '-Xmx1024m $(MAVEN_OPTS) -Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss,SSS -Duser.timezone=America/Toronto' jdkVersionOption: 1.11 From 6bcaea7fc32b23083ede19a3d983e0a2eeb82646 Mon Sep 17 00:00:00 2001 From: Tadgh Date: Tue, 5 Jan 2021 09:06:55 -0500 Subject: [PATCH 42/58] Add secret var for codecov token --- azure-pipelines.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ddb987b8bf44..59d73fbdbed9 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -5,6 +5,7 @@ variables: #MAVEN_CACHE_FOLDER: $(Agent.TempDirectory)/.m2/repository #MAVEN_OPTS: '-Dmaven.repo.local=$(MAVEN_CACHE_FOLDER)' MAVEN_OPTS: '' + disable.coverage.autogenerate: 'true' trigger: @@ -153,7 +154,7 @@ jobs: reporttypes: 'HtmlInline_AzurePipelines;Xml;Cobertura' # The output formats and scope (separated by semicolon) Values: Badges, Clover, Cobertura, CsvSummary, Html, HtmlChart, HtmlInline, HtmlInline_AzurePipelines, HtmlInline_AzurePipelines_Dark, HtmlSummary, JsonSummary, Latex, LatexSummary, lcov, MHtml, PngChart, SonarQube, TeamCitySummary, TextSummary, Xml, XmlSummary verbosity: 'Verbose' # The verbosity level of the log messages. Values: Verbose, Info, Warning, Error, Off - script: ls -al $(Pipeline.Workspace)/coveragereport - - script: bash <(curl https://codecov.io/bash) -t $(CODECOV_TOKEN) + - script: bash <(curl https://codecov.io/bash) -t $(CC_TOKEN) displayName: 'codecov' - task: PublishCodeCoverageResults@1 inputs: From b41ceffd09eb858e9caf91857876f948033af590 Mon Sep 17 00:00:00 2001 From: Tadgh Date: Fri, 26 Feb 2021 11:07:44 -0500 Subject: [PATCH 43/58] Write test slicing excluder --- azure-pipelines.yml | 5 +++++ generate_test_exclusions.sh | 45 +++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 generate_test_exclusions.sh diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ffc8db476b7b..07e4e6d9fb73 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -72,6 +72,11 @@ jobs: inputs: targetType: 'filePath' filePath: 'slice_modules.sh' + - task: Bash@3 + displayName: Generate Test Exclusions + inputs: + targetType: 'filePath' + filePath: 'generate_test_exclusions.sh - task: Maven@3 env: JAVA_HOME_11_X64: /usr/java/openjdk-15 diff --git a/generate_test_exclusions.sh b/generate_test_exclusions.sh new file mode 100644 index 000000000000..d501dab2ecce --- /dev/null +++ b/generate_test_exclusions.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +totalAgents=$SYSTEM_TOTALJOBSINPHASE +agentNumber=$SYSTEM_JOBPOSITIONINPHASE + +totalAgents=4 +agentNumber=2 + +if [[ $totalAgents -eq 0 ]]; then totalAgents=1; fi +if [ -z "$agentNumber" ]; then agentNumber=1; fi + +echo $totalAgents +echo $agentNumber + +tests_to_skip=$(find . -name "*Test.java" | sed -e 's#^.*src/test/java/\(.*\)\.java#\1#' | tr "/" ".") +its_to_skip=$(find . -name "*IT.java" | sed -e 's#^.*src/test/java/\(.*\)\.java#\1#' | tr "/" "." ) + +tests_to_skip_filename="tests_to_skip.txt" +ITs_to_skip_filename="ITs_to_skip.txt" + +tests_to_skip_file=$(Pipeline.Workspace)/$tests_to_skip_filename +ITs_to_skip_file=$(Pipeline.Workspace)/$ITs_to_skip_filename + +counter=0; +for i in $tests_to_skip; do + echo Counter is $counter + if [[ $counter -ne $agentNumber ]]; then + echo "$i"\n >> $tests_to_skip_file + fi + counter=$((counter+1)) + if [[ $counter -gt $totalAgents ]]; then counter=1; fi +done + +counter=0; +for i in $tests_to_skip; do + echo Counter is $counter + if [[ $counter -ne $agentNumber ]]; then + echo "$i"\n >> $ITs_to_skip_file + fi + counter=$((counter+1)) + if [[ $counter -gt $totalAgents ]]; then counter=1; fi +done + +echo "##vso[task.setvariable variable=testExclusionFile]$tests_to_skip_file" +echo "##vso[task.setvariable variable=itExclusionFile]$ITs_to_skip_file" From 09cd3b2320757bdd8c74938b33fad5ce80b12d12 Mon Sep 17 00:00:00 2001 From: Tadgh Date: Fri, 26 Feb 2021 11:09:32 -0500 Subject: [PATCH 44/58] Tidy script --- generate_test_exclusions.sh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/generate_test_exclusions.sh b/generate_test_exclusions.sh index d501dab2ecce..39003c03db5a 100644 --- a/generate_test_exclusions.sh +++ b/generate_test_exclusions.sh @@ -3,14 +3,11 @@ totalAgents=$SYSTEM_TOTALJOBSINPHASE agentNumber=$SYSTEM_JOBPOSITIONINPHASE -totalAgents=4 -agentNumber=2 - if [[ $totalAgents -eq 0 ]]; then totalAgents=1; fi if [ -z "$agentNumber" ]; then agentNumber=1; fi -echo $totalAgents -echo $agentNumber +echo Total agents: $totalAgents +echo Agent Number: $agentNumber tests_to_skip=$(find . -name "*Test.java" | sed -e 's#^.*src/test/java/\(.*\)\.java#\1#' | tr "/" ".") its_to_skip=$(find . -name "*IT.java" | sed -e 's#^.*src/test/java/\(.*\)\.java#\1#' | tr "/" "." ) From 661d7a5b955f59fada4a6d5c96c3c04f345699bb Mon Sep 17 00:00:00 2001 From: Tadgh Date: Fri, 26 Feb 2021 11:09:58 -0500 Subject: [PATCH 45/58] Fix typo --- generate_test_exclusions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generate_test_exclusions.sh b/generate_test_exclusions.sh index 39003c03db5a..e6d8adf2b39b 100644 --- a/generate_test_exclusions.sh +++ b/generate_test_exclusions.sh @@ -29,7 +29,7 @@ for i in $tests_to_skip; do done counter=0; -for i in $tests_to_skip; do +for i in $its_to_skip; do echo Counter is $counter if [[ $counter -ne $agentNumber ]]; then echo "$i"\n >> $ITs_to_skip_file From 01890f6a3121b485836fc92b8691fe98dc5e52fe Mon Sep 17 00:00:00 2001 From: Tadgh Date: Fri, 26 Feb 2021 11:24:13 -0500 Subject: [PATCH 46/58] Improve script --- azure-pipelines.yml | 2 +- generate_test_exclusions.sh | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 07e4e6d9fb73..ae0834fd3172 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -83,7 +83,7 @@ jobs: inputs: goals: 'clean install' # These are Maven CLI options (and show up in the build logs) - "-nsu"=Don't update snapshots. We can remove this when Maven OSS is more healthy - options: "-P ALLMODULES,JACOCO,CI,ERRORPRONE -e -B -Dmaven.repo.local=$(MAVEN_CACHE_FOLDER) -pl :$(slicedModules)" + options: "-P ALLMODULES,JACOCO,CI,ERRORPRONE -e -B -Dmaven.repo.local=$(MAVEN_CACHE_FOLDER) -pl :$(slicedModules) -Dsurefire.excludesFile=$(testExclusionFile) -Dfailsafe.excludesFile=$(itExclusionFile)" # These are JVM options (and don't show up in the build logs) mavenOptions: '-Xmx1024m $(MAVEN_OPTS) -Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss,SSS -Duser.timezone=America/Toronto' jdkVersionOption: 1.11 diff --git a/generate_test_exclusions.sh b/generate_test_exclusions.sh index e6d8adf2b39b..95306cdb7e70 100644 --- a/generate_test_exclusions.sh +++ b/generate_test_exclusions.sh @@ -37,6 +37,8 @@ for i in $its_to_skip; do counter=$((counter+1)) if [[ $counter -gt $totalAgents ]]; then counter=1; fi done - +testCount=$(cat $tests_to_skip_file | wc -l) +itCount=$(cat $ITs_to_skip_file | wc -l) +echo "Agent [$agentNumber] is responsible for [$testCount] tests and [$itCount] ITs" echo "##vso[task.setvariable variable=testExclusionFile]$tests_to_skip_file" echo "##vso[task.setvariable variable=itExclusionFile]$ITs_to_skip_file" From 237c9e54a25aafadd8ff82674a9f6096432dae17 Mon Sep 17 00:00:00 2001 From: Tadgh Date: Fri, 26 Feb 2021 11:24:38 -0500 Subject: [PATCH 47/58] Flip top-level script to parallelize --- azure-pipelines.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ae0834fd3172..859333d18600 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -67,11 +67,11 @@ jobs: inputs: targetType: 'inline' script: mkdir -p $(MAVEN_CACHE_FOLDER); pwd; ls -al $(MAVEN_CACHE_FOLDER); mkdir $(Build.ArtifactStagingDirectory)/jacoco-output; mkdir $(Build.ArtifactStagingDirectory)/test-output; - - task: Bash@3 - displayName: Determine Target Modules - inputs: - targetType: 'filePath' - filePath: 'slice_modules.sh' +# - task: Bash@3 +# displayName: Determine Target Modules +# inputs: +# targetType: 'filePath' +# filePath: 'slice_modules.sh' - task: Bash@3 displayName: Generate Test Exclusions inputs: From 4ee4ca7cafe4dc91845ded5e96aefbc95707cc7b Mon Sep 17 00:00:00 2001 From: Tadgh Date: Fri, 26 Feb 2021 11:40:37 -0500 Subject: [PATCH 48/58] Fix typo in script --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 859333d18600..4c3697df3627 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -76,7 +76,7 @@ jobs: displayName: Generate Test Exclusions inputs: targetType: 'filePath' - filePath: 'generate_test_exclusions.sh + filePath: 'generate_test_exclusions.sh' - task: Maven@3 env: JAVA_HOME_11_X64: /usr/java/openjdk-15 From 1d41931e1845215901dfdd105c9cbda485a62e7a Mon Sep 17 00:00:00 2001 From: Tadgh Date: Fri, 26 Feb 2021 12:02:22 -0500 Subject: [PATCH 49/58] Remove test slicing by module --- azure-pipelines.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 4c3697df3627..523efc64052f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -67,11 +67,6 @@ jobs: inputs: targetType: 'inline' script: mkdir -p $(MAVEN_CACHE_FOLDER); pwd; ls -al $(MAVEN_CACHE_FOLDER); mkdir $(Build.ArtifactStagingDirectory)/jacoco-output; mkdir $(Build.ArtifactStagingDirectory)/test-output; -# - task: Bash@3 -# displayName: Determine Target Modules -# inputs: -# targetType: 'filePath' -# filePath: 'slice_modules.sh' - task: Bash@3 displayName: Generate Test Exclusions inputs: @@ -83,7 +78,7 @@ jobs: inputs: goals: 'clean install' # These are Maven CLI options (and show up in the build logs) - "-nsu"=Don't update snapshots. We can remove this when Maven OSS is more healthy - options: "-P ALLMODULES,JACOCO,CI,ERRORPRONE -e -B -Dmaven.repo.local=$(MAVEN_CACHE_FOLDER) -pl :$(slicedModules) -Dsurefire.excludesFile=$(testExclusionFile) -Dfailsafe.excludesFile=$(itExclusionFile)" + options: "-P ALLMODULES,JACOCO,CI,ERRORPRONE -e -B -Dmaven.repo.local=$(MAVEN_CACHE_FOLDER) -Dsurefire.excludesFile=$(testExclusionFile) -Dfailsafe.excludesFile=$(itExclusionFile)" # These are JVM options (and don't show up in the build logs) mavenOptions: '-Xmx1024m $(MAVEN_OPTS) -Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss,SSS -Duser.timezone=America/Toronto' jdkVersionOption: 1.11 From faa6453f33ca0092415a1058072edf66c5211740 Mon Sep 17 00:00:00 2001 From: Tadgh Date: Fri, 26 Feb 2021 13:11:29 -0500 Subject: [PATCH 50/58] weee --- azure-pipelines.yml | 30 ------------------------------ generate_test_exclusions.sh | 11 +++++++---- slice_modules.sh | 2 +- 3 files changed, 8 insertions(+), 35 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 523efc64052f..93c2bbebfbe0 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -15,36 +15,6 @@ pool: vmImage: 'ubuntu-latest' jobs: - - job: Build - container: maven:3-jdk-11 - steps: - # Grab the previous cache - - task: Cache@2 - displayName: Get Maven Cache - inputs: - key: 'maven | "$(Agent.OS)" | ./pom.xml | "4"' - path: $(MAVEN_CACHE_FOLDER) - - # Build the project fully without tests. At the end of this job, this should be auto-stored in the cache, for future retrieval by subsequent jobs - - task: Maven@3 - displayName: Build Project - env: - JAVA_HOME_11_X64: /usr/local/openjdk-11 - inputs: - goals: 'clean install' - # These are Maven CLI options (and show up in the build logs) - "-nsu"=Don't update snapshots. We can remove this when Maven OSS is more healthy - options: "-P ALLMODULES,JACOCO,ERRORPRONE,CI -e -B -Dmaven.repo.local=$(MAVEN_CACHE_FOLDER) -DskipTests" - # These are JVM options (and don't show up in the build logs) - mavenOptions: '-Xmx1024m $(MAVEN_OPTS) -Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss,SSS -Duser.timezone=America/Toronto' - jdkVersionOption: 1.11 - - # Store this build - - task: PublishPipelineArtifact@1 - displayName: 'Store Test Output' - inputs: - targetPath: '$(Build.ArtifactStagingDirectory)/' -# artifactName: 'logs-$(system.jobpositioninphase)' - - job: Test dependsOn: Build strategy: diff --git a/generate_test_exclusions.sh b/generate_test_exclusions.sh index 95306cdb7e70..6fad4c626a1b 100644 --- a/generate_test_exclusions.sh +++ b/generate_test_exclusions.sh @@ -8,6 +8,8 @@ if [ -z "$agentNumber" ]; then agentNumber=1; fi echo Total agents: $totalAgents echo Agent Number: $agentNumber +echo workspace is "$(Agent.BuildDirectory)" +echo workspace2 is $AGENT_BUILDDIRECTORY tests_to_skip=$(find . -name "*Test.java" | sed -e 's#^.*src/test/java/\(.*\)\.java#\1#' | tr "/" ".") its_to_skip=$(find . -name "*IT.java" | sed -e 's#^.*src/test/java/\(.*\)\.java#\1#' | tr "/" "." ) @@ -15,12 +17,14 @@ its_to_skip=$(find . -name "*IT.java" | sed -e 's#^.*src/test/java/\(.*\)\.java# tests_to_skip_filename="tests_to_skip.txt" ITs_to_skip_filename="ITs_to_skip.txt" -tests_to_skip_file=$(Pipeline.Workspace)/$tests_to_skip_filename -ITs_to_skip_file=$(Pipeline.Workspace)/$ITs_to_skip_filename +tests_to_skip_file=$AGENT_BUILDDIRECTORY/$tests_to_skip_filename +ITs_to_skip_file=$AGENT_BUILDDIRECTORY/$ITs_to_skip_filename + +echo Absolute path of test exclusion is $tests_to_skip_file +echo Absolute path of IT exclusion is $ITs_to_skip_file counter=0; for i in $tests_to_skip; do - echo Counter is $counter if [[ $counter -ne $agentNumber ]]; then echo "$i"\n >> $tests_to_skip_file fi @@ -30,7 +34,6 @@ done counter=0; for i in $its_to_skip; do - echo Counter is $counter if [[ $counter -ne $agentNumber ]]; then echo "$i"\n >> $ITs_to_skip_file fi diff --git a/slice_modules.sh b/slice_modules.sh index 60f2182e1781..42b9f786ca8f 100644 --- a/slice_modules.sh +++ b/slice_modules.sh @@ -38,5 +38,5 @@ done echo This agent \[\#$agentNumber\] is responsible for these modules: $modulesToTest # Set an Azure environment variable via this janky vso echo. -# This variable represents which projects this particular agent is responsible for testing. +# This variable represents which projects echo "##vso[task.setvariable variable=slicedModules]$modulesToTest" From 4854a6d2ff249746bd982434722028f4d9dbb79b Mon Sep 17 00:00:00 2001 From: Tadgh Date: Fri, 26 Feb 2021 13:15:24 -0500 Subject: [PATCH 51/58] Remove dependency --- azure-pipelines.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 93c2bbebfbe0..8a87a15e9aca 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -16,7 +16,6 @@ pool: jobs: - job: Test - dependsOn: Build strategy: parallel: 3 displayName: Run Tests From 718c4494640e233e34bbf1fd84471707dfa69bea Mon Sep 17 00:00:00 2001 From: Tadgh Date: Fri, 26 Feb 2021 14:24:20 -0500 Subject: [PATCH 52/58] Find out why tests aren't skipping --- generate_test_exclusions.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/generate_test_exclusions.sh b/generate_test_exclusions.sh index 6fad4c626a1b..ca41ca64f6f6 100644 --- a/generate_test_exclusions.sh +++ b/generate_test_exclusions.sh @@ -42,6 +42,11 @@ for i in $its_to_skip; do done testCount=$(cat $tests_to_skip_file | wc -l) itCount=$(cat $ITs_to_skip_file | wc -l) -echo "Agent [$agentNumber] is responsible for [$testCount] tests and [$itCount] ITs" + +echo "TESTS" +echo $(cat $tests_to_skip_file) +echo "ITS" +echo $(cat $tests_to_skip_file) +echo "Agent [$agentNumber] is skipping [$testCount] tests and [$itCount] ITs" echo "##vso[task.setvariable variable=testExclusionFile]$tests_to_skip_file" echo "##vso[task.setvariable variable=itExclusionFile]$ITs_to_skip_file" From afdcc0df2f54e51d0cc8fdf1a78ff600b0180f84 Mon Sep 17 00:00:00 2001 From: Tadgh Date: Fri, 26 Feb 2021 14:29:48 -0500 Subject: [PATCH 53/58] more logging --- generate_test_exclusions.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/generate_test_exclusions.sh b/generate_test_exclusions.sh index ca41ca64f6f6..b89189779da3 100644 --- a/generate_test_exclusions.sh +++ b/generate_test_exclusions.sh @@ -8,12 +8,14 @@ if [ -z "$agentNumber" ]; then agentNumber=1; fi echo Total agents: $totalAgents echo Agent Number: $agentNumber -echo workspace is "$(Agent.BuildDirectory)" echo workspace2 is $AGENT_BUILDDIRECTORY tests_to_skip=$(find . -name "*Test.java" | sed -e 's#^.*src/test/java/\(.*\)\.java#\1#' | tr "/" ".") its_to_skip=$(find . -name "*IT.java" | sed -e 's#^.*src/test/java/\(.*\)\.java#\1#' | tr "/" "." ) +echo "Tests to skip $tests_to_skip" +echo "ITs to skip $its_to_skip" + tests_to_skip_filename="tests_to_skip.txt" ITs_to_skip_filename="ITs_to_skip.txt" From 5a756637f469b57bf0d892eb8bcae312d5e4837a Mon Sep 17 00:00:00 2001 From: Tadgh Date: Fri, 26 Feb 2021 14:47:31 -0500 Subject: [PATCH 54/58] wip --- generate_test_exclusions.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/generate_test_exclusions.sh b/generate_test_exclusions.sh index b89189779da3..8bf94643efe4 100644 --- a/generate_test_exclusions.sh +++ b/generate_test_exclusions.sh @@ -3,6 +3,8 @@ totalAgents=$SYSTEM_TOTALJOBSINPHASE agentNumber=$SYSTEM_JOBPOSITIONINPHASE +totalAgents=2 +agentNumber=1 if [[ $totalAgents -eq 0 ]]; then totalAgents=1; fi if [ -z "$agentNumber" ]; then agentNumber=1; fi @@ -28,7 +30,7 @@ echo Absolute path of IT exclusion is $ITs_to_skip_file counter=0; for i in $tests_to_skip; do if [[ $counter -ne $agentNumber ]]; then - echo "$i"\n >> $tests_to_skip_file + echo "$i" >> $tests_to_skip_file fi counter=$((counter+1)) if [[ $counter -gt $totalAgents ]]; then counter=1; fi @@ -37,7 +39,7 @@ done counter=0; for i in $its_to_skip; do if [[ $counter -ne $agentNumber ]]; then - echo "$i"\n >> $ITs_to_skip_file + echo "$i" >> $ITs_to_skip_file fi counter=$((counter+1)) if [[ $counter -gt $totalAgents ]]; then counter=1; fi @@ -46,9 +48,9 @@ testCount=$(cat $tests_to_skip_file | wc -l) itCount=$(cat $ITs_to_skip_file | wc -l) echo "TESTS" -echo $(cat $tests_to_skip_file) +cat $tests_to_skip_file echo "ITS" -echo $(cat $tests_to_skip_file) +cat $tests_to_skip_file echo "Agent [$agentNumber] is skipping [$testCount] tests and [$itCount] ITs" echo "##vso[task.setvariable variable=testExclusionFile]$tests_to_skip_file" echo "##vso[task.setvariable variable=itExclusionFile]$ITs_to_skip_file" From 38f79a16029d855cda31560e23adbcc365d262ad Mon Sep 17 00:00:00 2001 From: Tadgh Date: Fri, 26 Feb 2021 15:22:53 -0500 Subject: [PATCH 55/58] Remove hardcoded filter --- generate_test_exclusions.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/generate_test_exclusions.sh b/generate_test_exclusions.sh index 8bf94643efe4..39e69e42af6c 100644 --- a/generate_test_exclusions.sh +++ b/generate_test_exclusions.sh @@ -3,8 +3,6 @@ totalAgents=$SYSTEM_TOTALJOBSINPHASE agentNumber=$SYSTEM_JOBPOSITIONINPHASE -totalAgents=2 -agentNumber=1 if [[ $totalAgents -eq 0 ]]; then totalAgents=1; fi if [ -z "$agentNumber" ]; then agentNumber=1; fi From ef1006430bd55565dd192dcbc5616ba6fb2594fc Mon Sep 17 00:00:00 2001 From: Tadgh Date: Fri, 26 Feb 2021 15:23:38 -0500 Subject: [PATCH 56/58] Fix logging --- generate_test_exclusions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generate_test_exclusions.sh b/generate_test_exclusions.sh index 39e69e42af6c..83f1dbfb4ed7 100644 --- a/generate_test_exclusions.sh +++ b/generate_test_exclusions.sh @@ -48,7 +48,7 @@ itCount=$(cat $ITs_to_skip_file | wc -l) echo "TESTS" cat $tests_to_skip_file echo "ITS" -cat $tests_to_skip_file +cat $ITs_to_skip_file echo "Agent [$agentNumber] is skipping [$testCount] tests and [$itCount] ITs" echo "##vso[task.setvariable variable=testExclusionFile]$tests_to_skip_file" echo "##vso[task.setvariable variable=itExclusionFile]$ITs_to_skip_file" From 3b859896143d65f7f8cf6dd42106c97d7893f9b1 Mon Sep 17 00:00:00 2001 From: Tadgh Date: Fri, 26 Feb 2021 15:31:21 -0500 Subject: [PATCH 57/58] Off by 1 error --- generate_test_exclusions.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/generate_test_exclusions.sh b/generate_test_exclusions.sh index 83f1dbfb4ed7..c1cd08cbe260 100644 --- a/generate_test_exclusions.sh +++ b/generate_test_exclusions.sh @@ -25,7 +25,7 @@ ITs_to_skip_file=$AGENT_BUILDDIRECTORY/$ITs_to_skip_filename echo Absolute path of test exclusion is $tests_to_skip_file echo Absolute path of IT exclusion is $ITs_to_skip_file -counter=0; +counter=1; for i in $tests_to_skip; do if [[ $counter -ne $agentNumber ]]; then echo "$i" >> $tests_to_skip_file @@ -34,7 +34,7 @@ for i in $tests_to_skip; do if [[ $counter -gt $totalAgents ]]; then counter=1; fi done -counter=0; +counter=1; for i in $its_to_skip; do if [[ $counter -ne $agentNumber ]]; then echo "$i" >> $ITs_to_skip_file From d1c9abeea14f919893e21b1d597fc5d1ffe004ad Mon Sep 17 00:00:00 2001 From: Tadgh Date: Fri, 26 Feb 2021 16:18:17 -0500 Subject: [PATCH 58/58] Increase to parallelism 5 --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 8a87a15e9aca..3327f2c313d3 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -17,7 +17,7 @@ pool: jobs: - job: Test strategy: - parallel: 3 + parallel: 5 displayName: Run Tests timeoutInMinutes: 360 container: maven:3-openjdk-15