Azure Pipelines Overhaul (#3948)

This PR changes the way HAPI is built by Azure pipelines. Instead of a FIFO queue for all tests in the project, the entire project is quickly built and cached without testing, then the individual modules are built and tested in separate jobs which can be run in parallel from each other. Each of these jobs then uploads the test coverage for that module as a build artifact. Finally, a last stage downloads all the archived tests results and aggregates them using jacoco so they can be uploaded to codecov.

This has two key benefits:

    If there is a failing test because of an intermittent, the individual failing module can be re-run instead of having to re-run the whole project build.
    The build time is decreased substantially (90min -> 45min).

This is the first run at this, I will be iterating to further reduce build times going forward.
This commit is contained in:
Mark Iantorno 2022-08-24 12:55:00 -04:00 committed by GitHub
parent b5f5cd3e75
commit caf370da31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
27 changed files with 271 additions and 471 deletions

View File

@ -2,100 +2,132 @@
variables: variables:
MAVEN_CACHE_FOLDER: $(Pipeline.Workspace)/.m2/repository MAVEN_CACHE_FOLDER: $(Pipeline.Workspace)/.m2/repository
#MAVEN_CACHE_FOLDER: $(Agent.TempDirectory)/.m2/repository
#MAVEN_OPTS: '-Dmaven.repo.local=$(MAVEN_CACHE_FOLDER)'
MAVEN_OPTS: '' MAVEN_OPTS: ''
NEW_RELEASE_VERSION:
BRANCH:
trigger: trigger: none
- master
pool: pool:
vmImage: 'ubuntu-latest' vmImage: ubuntu-latest
stages:
- stage:
displayName: "module-tests"
jobs: jobs:
- job: Build - template: test-job-template.yml
timeoutInMinutes: 360 parameters:
container: maven:3.8-openjdk-17 modules:
steps: - name: hapi_fhir_jpaserver_test_utilities
- task: Cache@2 module: hapi-fhir-jpaserver-test-utilities
inputs: - name: hapi_fhir_structures_r4
key: 'maven | "$(Agent.OS)" | ./pom.xml' module: hapi-fhir-structures-r4
path: $(MAVEN_CACHE_FOLDER) - name: hapi_fhir_jpaserver_base
- task: Maven@3 module: hapi-fhir-jpaserver-base
env: - name: hapi_deployable_pom
JAVA_HOME_11_X64: /usr/java/openjdk-17 module: hapi-deployable-pom
displayName: Checkstyle Build - name: hapi_fhir_android
inputs: module: hapi-fhir-android
mavenPomFile: 'hapi-fhir-checkstyle/pom.xml' - name: hapi_fhir_base
goals: 'clean install' module: hapi-fhir-base
options: '-Dmaven.repo.local=$(MAVEN_CACHE_FOLDER)' - name: hapi_fhir_batch
jdkVersionOption: 1.11 module: hapi-fhir-batch
- task: DockerInstaller@0 - name: hapi_fhir_bom
displayName: Docker Installer module: hapi-fhir-bom
inputs: - name: hapi_fhir_checkstyle
dockerVersion: 17.09.0-ce module: hapi-fhir-checkstyle
releaseType: stable - name: hapi_fhir_cli
- task: Bash@3 module: hapi-fhir-cli
inputs: - name: hapi_fhir_client
targetType: 'inline' module: hapi-fhir-client
script: mkdir -p $(MAVEN_CACHE_FOLDER); pwd; ls -al $(MAVEN_CACHE_FOLDER) - name: hapi_fhir_client_okhttp
- task: Maven@3 module: hapi-fhir-client-okhttp
env: - name: hapi_fhir_converter
JAVA_HOME_11_X64: /usr/java/openjdk-17 module: hapi-fhir-converter
inputs: - name: hapi_fhir_dist
goals: 'clean install' module: hapi-fhir-dist
# 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 - name: hapi_fhir_docs
options: '-P ALLMODULES,JACOCO,CI,ERRORPRONE -e -B -Dmaven.repo.local=$(MAVEN_CACHE_FOLDER) -Dmaven.wagon.http.pool=false -Dhttp.keepAlive=false -Dstyle.color=always -Djansi.force=true' module: hapi-fhir-docs
# These are JVM options (and don't show up in the build logs) - name: hapi_fhir_jaxrsserver_base
mavenOptions: '-Xmx2048m $(MAVEN_OPTS) -Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss,SSS -Duser.timezone=America/Toronto' module: hapi-fhir-jaxrsserver-base
jdkVersionOption: 1.11 - name: hapi_fhir_jpa
- task: CopyFiles@2 module: hapi-fhir-jpa
condition: always() # Put to top, but kept in order here
inputs: # - name: hapi_fhir_jpaserver_base
sourceFolder: '$(System.DefaultWorkingDirectory)/' # module: hapi-fhir-jpaserver-base
contents: '**/target/*-reports/*.txt' - name: hapi_fhir_jpaserver_cql
targetFolder: '$(Build.ArtifactStagingDirectory)' module: hapi-fhir-jpaserver-cql
- task: PublishPipelineArtifact@1 - name: hapi_fhir_jpaserver_elastic_test_utilities
displayName: 'Publish Full Test Output' module: hapi-fhir-jpaserver-elastic-test-utilities
condition: always() - name: hapi_fhir_jpaserver_mdm
inputs: module: hapi-fhir-jpaserver-mdm
targetPath: '$(Build.ArtifactStagingDirectory)/' - name: hapi_fhir_jpaserver_model
artifactName: 'full_logs_$(Build.BuildId)_$(Build.BuildNumber)_$(System.JobId).zip' module: hapi-fhir-jpaserver-model
- script: bash <(curl https://codecov.io/bash) -t $(CODECOV_TOKEN) - name: hapi_fhir_jpaserver_searchparam
displayName: 'codecov' module: hapi-fhir-jpaserver-searchparam
- task: PublishTestResults@2 - name: hapi_fhir_jpaserver_subscription
inputs: module: hapi-fhir-jpaserver-subscription
testResultsFormat: 'JUnit' # Put to top, but kept in order here
testResultsFiles: '**/TEST-*.xml' # - name: hapi_fhir_jpaserver_test_utilities
- task: PublishCodeCoverageResults@1 # module: hapi-fhir-jpaserver-test-utilities
inputs: - name: hapi_fhir_jpaserver_uhnfhirtest
codeCoverageTool: 'JaCoCo' module: hapi-fhir-jpaserver-uhnfhirtest
summaryFileLocation: $(System.DefaultWorkingDirectory)/hapi-fhir-jacoco/target/site/jacoco-report/jacoco.xml - name: hapi_fhir_server
reportDirectory: $(System.DefaultWorkingDirectory)/hapi-fhir-jacoco/target/site/jacoco-report/ module: hapi-fhir-server
failIfCoverageEmpty: false - name: hapi_fhir_server_mdm
module: hapi-fhir-server-mdm
# Potential Additional Maven3 Options: - name: hapi_fhir_server_openapi
#publishJUnitResults: true module: hapi-fhir-server-openapi
#testResultsFiles: '**/surefire-reports/TEST-*.xml' # Required when publishJUnitResults == True - name: hapi_fhir_spring_boot
#testRunTitle: # Optional module: hapi-fhir-spring-boot
#codeCoverageToolOption: 'None' # Optional. Options: none, cobertura, jaCoCo. Enabling code coverage inserts the `clean` goal into the Maven goals list when Maven runs. - name: hapi_fhir_sql_migrate
#codeCoverageClassFilter: # Optional. Comma-separated list of filters to include or exclude classes from collecting code coverage. For example: +:com.*,+:org.*,-:my.app*.* module: hapi-fhir-sql-migrate
#codeCoverageClassFilesDirectories: # Optional - name: hapi_fhir_storage
#codeCoverageSourceDirectories: # Optional module: hapi-fhir-storage
#codeCoverageFailIfEmpty: false # Optional - name: hapi_fhir_storage_batch2
#javaHomeOption: 'JDKVersion' # Options: jDKVersion, path module: hapi-fhir-storage-batch2
#jdkVersionOption: 'default' # Optional. Options: default, 1.11, 1.10, 1.9, 1.8, 1.7, 1.6 - name: hapi_fhir_storage_batch2_jobs
#jdkDirectory: # Required when javaHomeOption == Path module: hapi-fhir-storage-batch2-jobs
#jdkArchitectureOption: 'x64' # Optional. Options: x86, x64 - name: hapi_fhir_storage_mdm
#mavenVersionOption: 'Default' # Options: default, path module: hapi-fhir-storage-mdm
#mavenDirectory: # Required when mavenVersionOption == Path - name: hapi_fhir_storage_test_utilities
#mavenSetM2Home: false # Required when mavenVersionOption == Path module: hapi-fhir-storage-test-utilities
#mavenAuthenticateFeed: false - name: hapi_fhir_structures_dstu2
#effectivePomSkip: false module: hapi-fhir-structures-dstu2
#sonarQubeRunAnalysis: false - name: hapi_fhir_structures_dstu2_1
#sqMavenPluginVersionChoice: 'latest' # Required when sonarQubeRunAnalysis == True# Options: latest, pom module: hapi-fhir-structures-dstu2.1
#checkStyleRunAnalysis: false # Optional - name: hapi_fhir_structures_dstu3
#pmdRunAnalysis: false # Optional module: hapi-fhir-structures-dstu3
#findBugsRunAnalysis: false # Optional - name: hapi_fhir_structures_hl7org_dstu2
module: hapi-fhir-structures-hl7org-dstu2
# Put to top, but kept in order here
# - name: hapi_fhir_structures_r4
# module: hapi-fhir-structures-r4
- name: hapi_fhir_structures_r5
module: hapi-fhir-structures-r5
- name: hapi_fhir_test_utilities
module: hapi-fhir-test-utilities
- name: hapi_fhir_testpage_overlay
module: hapi-fhir-testpage-overlay
- name: hapi_fhir_validation
module: hapi-fhir-validation
- name: hapi_fhir_validation_resources_dstu2
module: hapi-fhir-validation-resources-dstu2
- name: hapi_fhir_validation_resources_dstu2_1
module: hapi-fhir-validation-resources-dstu2.1
- name: hapi_fhir_validation_resources_dstu3
module: hapi-fhir-validation-resources-dstu3
- name: hapi_fhir_validation_resources_r4
module: hapi-fhir-validation-resources-r4
- name: hapi_fhir_validation_resources_r5
module: hapi-fhir-validation-resources-r5
- name: hapi_tinder_plugin
module: hapi-tinder-plugin
- name: hapi_tinder_test
module: hapi-tinder-test
- name: tests_hapi_fhir_base_test_jaxrsserver_kotlin
module: tests/hapi-fhir-base-test-jaxrsserver-kotlin
- name: tests_hapi_fhir_base_test_mindeps_client
module: tests/hapi-fhir-base-test-mindeps-client
- name: tests_hapi_fhir_base_test_mindeps_server
module: tests/hapi-fhir-base-test-mindeps-server

View File

@ -136,21 +136,6 @@
<build> <build>
<plugins> <plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<configuration>
<dumpOnExit>true</dumpOnExit>
</configuration>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>

View File

@ -69,19 +69,5 @@
</plugin> </plugin>
</plugins> </plugins>
</pluginManagement> </pluginManagement>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build> </build>
</project> </project>

View File

@ -96,27 +96,5 @@
<version>${project.version}</version> <version>${project.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<configuration>
<dumpOnExit>true</dumpOnExit>
</configuration>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project> </project>

View File

@ -39,21 +39,6 @@
<build> <build>
<plugins> <plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<configuration>
<dumpOnExit>true</dumpOnExit>
</configuration>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>

View File

@ -215,23 +215,6 @@
</additionalDependencies> </additionalDependencies>
</configuration> </configuration>
</plugin> </plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<configuration>
<dumpOnExit>true</dumpOnExit>
</configuration>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins> </plugins>
</build> </build>
</project> </project>

View File

@ -167,27 +167,4 @@
</plugin> </plugin>
</plugins> </plugins>
</reporting> </reporting>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<configuration>
<dumpOnExit>true</dumpOnExit>
</configuration>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project> </project>

View File

@ -437,21 +437,6 @@
</dependency> </dependency>
</dependencies> </dependencies>
</plugin> </plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<configuration>
<dumpOnExit>true</dumpOnExit>
</configuration>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin> <plugin>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-tinder-plugin</artifactId> <artifactId>hapi-tinder-plugin</artifactId>

View File

@ -243,21 +243,6 @@
<skip>${skipFailsafe}</skip> <skip>${skipFailsafe}</skip>
</configuration> </configuration>
</plugin> </plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<configuration>
<dumpOnExit>true</dumpOnExit>
</configuration>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId> <artifactId>maven-checkstyle-plugin</artifactId>

View File

@ -117,18 +117,6 @@
</dependency> </dependency>
</dependencies> </dependencies>
</plugin> </plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins> </plugins>
</build> </build>
</project> </project>

View File

@ -155,19 +155,5 @@
</plugin> </plugin>
</plugins> </plugins>
</pluginManagement> </pluginManagement>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build> </build>
</project> </project>

View File

@ -159,18 +159,6 @@
</plugins> </plugins>
</pluginManagement> </pluginManagement>
<plugins> <plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>

View File

@ -135,19 +135,5 @@
</plugin> </plugin>
</plugins> </plugins>
</pluginManagement> </pluginManagement>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build> </build>
</project> </project>

View File

@ -243,21 +243,6 @@
<skip>${skipFailsafe}</skip> <skip>${skipFailsafe}</skip>
</configuration> </configuration>
</plugin> </plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<configuration>
<dumpOnExit>true</dumpOnExit>
</configuration>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId> <artifactId>maven-checkstyle-plugin</artifactId>

View File

@ -131,18 +131,6 @@
</plugins> </plugins>
</pluginManagement> </pluginManagement>
<plugins> <plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin> <plugin>
<groupId>org.apache.felix</groupId> <groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId> <artifactId>maven-bundle-plugin</artifactId>

View File

@ -114,21 +114,6 @@
<build> <build>
<plugins> <plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<configuration>
<dumpOnExit>true</dumpOnExit>
</configuration>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>

View File

@ -107,22 +107,6 @@
</pluginManagement> </pluginManagement>
<plugins> <plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<configuration>
<dumpOnExit>true</dumpOnExit>
</configuration>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- The configuration here tells the WAR plugin to include the FHIR Tester overlay. You can omit it if you are not using that feature. --> <!-- The configuration here tells the WAR plugin to include the FHIR Tester overlay. You can omit it if you are not using that feature. -->
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>

View File

@ -103,19 +103,5 @@
</plugin> </plugin>
</plugins> </plugins>
</pluginManagement> </pluginManagement>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build> </build>
</project> </project>

View File

@ -169,19 +169,5 @@
</plugin> </plugin>
</plugins> </plugins>
</pluginManagement> </pluginManagement>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build> </build>
</project> </project>

View File

@ -250,21 +250,6 @@
<build> <build>
<plugins> <plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<configuration>
<dumpOnExit>true</dumpOnExit>
</configuration>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>

View File

@ -209,21 +209,6 @@
<build> <build>
<plugins> <plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<configuration>
<dumpOnExit>true</dumpOnExit>
</configuration>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>

View File

@ -261,21 +261,6 @@
<build> <build>
<plugins> <plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<configuration>
<dumpOnExit>true</dumpOnExit>
</configuration>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>

View File

@ -331,21 +331,6 @@
<build> <build>
<plugins> <plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<configuration>
<dumpOnExit>true</dumpOnExit>
</configuration>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>

View File

@ -316,21 +316,6 @@
<build> <build>
<plugins> <plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<configuration>
<dumpOnExit>true</dumpOnExit>
</configuration>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>

View File

@ -333,21 +333,6 @@
<build> <build>
<plugins> <plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<configuration>
<dumpOnExit>true</dumpOnExit>
</configuration>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>

View File

@ -415,21 +415,6 @@
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<configuration>
<dumpOnExit>true</dumpOnExit>
</configuration>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins> </plugins>
<pluginManagement> <pluginManagement>
<plugins> <plugins>

147
test-job-template.yml Normal file
View File

@ -0,0 +1,147 @@
# HAPI FHIR Build Pipeline
parameters:
param: [ ]
jobs:
- job: setup
displayName: setup-and-cache-build
timeoutInMinutes: 60
container: maven:3.8-openjdk-17
pool:
vmImage: ubuntu-latest
steps:
- task: Cache@2
inputs:
key: 'maven | "$(Agent.OS)" | ./pom.xml'
path: $(MAVEN_CACHE_FOLDER)
- task: Bash@3
inputs:
targetType: 'inline'
script: mkdir -p $(MAVEN_CACHE_FOLDER); pwd; ls -al $(MAVEN_CACHE_FOLDER)
- task: Maven@3
env:
JAVA_HOME_11_X64: /usr/java/openjdk-17
inputs:
goals: '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,CI,FASTINSTALL -e -B -Dmaven.repo.local=$(MAVEN_CACHE_FOLDER) -Dmaven.javadoc.skip=true -Dmaven.wagon.http.pool=false -Dhttp.keepAlive=false -Dstyle.color=always -Djansi.force=true'
# 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
- ${{ each p in parameters.modules }}:
- job: ${{ p.name }}
timeoutInMinutes: 60
displayName: ${{ p.name }}
dependsOn: [ 'setup' ]
container: maven:3.8-openjdk-17
pool:
vmImage: ubuntu-latest
steps:
- script: echo testing module ${{ p.module }}
- task: DockerInstaller@0
displayName: Docker Installer
inputs:
dockerVersion: 17.09.0-ce
releaseType: stable
- task: Cache@2
inputs:
key: 'maven | "$(Agent.OS)" | ./pom.xml'
path: $(MAVEN_CACHE_FOLDER)
# - task: Maven@3
# env:
# JAVA_HOME_11_X64: /usr/java/openjdk-17
# displayName: Checkstyle Build
# inputs:
# mavenPomFile: 'hapi-fhir-checkstyle/pom.xml'
# goals: 'clean install'
# options: '-Dmaven.repo.local=$(MAVEN_CACHE_FOLDER)'
# jdkVersionOption: 1.11
- task: Maven@3
env:
JAVA_HOME_11_X64: /usr/java/openjdk-17
inputs:
mavenPomFile: '$(System.DefaultWorkingDirectory)/pom.xml'
goals: 'clean test jacoco:report -pl ${{ p.module }}'
# 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 -e -B -Dmaven.repo.local=$(MAVEN_CACHE_FOLDER) -Dmaven.wagon.http.pool=false -Dhttp.keepAlive=false -Dstyle.color=always -Djansi.force=true'
# 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
# Copy testing log files and publish to pipeline run on Azure.
- task: CopyFiles@2
condition: always()
inputs:
sourceFolder: '$(System.DefaultWorkingDirectory)/'
contents: '**/target/*-reports/*.txt'
targetFolder: '$(Build.ArtifactStagingDirectory)'
- task: PublishPipelineArtifact@1
displayName: 'Publish Full Test Output'
condition: always()
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)/'
artifactName: '${{p.name}}_full_logs_$(Build.BuildId)_$(Build.BuildNumber)_$(System.JobId).zip'
# Publish target directory
- task: PublishBuildArtifacts@1
displayName: 'Publish generated build files'
continueOnError: true
inputs:
pathToPublish: '$(System.DefaultWorkingDirectory)/${{ p.module }}/target/'
parallel: true
artifactName: '${{ p.name }}_target'
- job:
pool:
vmImage: ubuntu-latest
timeoutInMinutes: 60
displayName: generate_test_reports
container: maven:3.8-openjdk-17
dependsOn:
- ${{ each p in parameters.modules }}:
- ${{ p.name }}
steps:
- ${{ each p in parameters.modules }}:
- task: Bash@3
inputs:
targetType: 'inline'
script: mkdir -p $(System.DefaultWorkingDirectory)/${{ p.module }}/target/
- task: DownloadBuildArtifacts@0
displayName: 'Download jacoco test coverage result exec file for ${{ p.name }}'
continueOnError: true
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: '${{ p.name }}_target'
downloadPath: '$(System.DefaultWorkingDirectory)/'
# Copy contents from downloaded artifact directory to final target directory.
- task: CopyFiles@2
condition: always()
inputs:
sourceFolder: '$(System.DefaultWorkingDirectory)/${{ p.name }}_target/'
contents: '**'
targetFolder: '$(System.DefaultWorkingDirectory)/${{ p.module }}/target/'
- task: Maven@3
env:
JAVA_HOME_11_X64: /usr/java/openjdk-17
inputs:
mavenPomFile: '$(System.DefaultWorkingDirectory)/pom.xml'
goals: 'jacoco:report-aggregate'
# 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'
# 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
- bash: |
curl -Os https://uploader.codecov.io/latest/linux/codecov
chmod +x codecov
./codecov -t $(CODECOV_TOKEN) -R hapi-fhir-jacoco/target/site/jacoco-aggregate/
displayName: 'codecov'
- task: PublishTestResults@2
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: '**/TEST-*.xml'
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: 'JaCoCo'
summaryFileLocation: $(System.DefaultWorkingDirectory)/hapi-fhir-jacoco/target/site/jacoco-aggregate/jacoco.xml
reportDirectory: $(System.DefaultWorkingDirectory)/hapi-fhir-jacoco/target/site/jacoco-report/
failIfCoverageEmpty: true