diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index ec879d84c..f968b4d70 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,4 +1,4 @@ -name: Build OpenIntegrationEngine +name: Build Open Integration Engine on: push: @@ -9,6 +9,16 @@ on: - main jobs: + event_file: + name: "Event File" + runs-on: ubuntu-latest + steps: + - name: Upload + uses: actions/upload-artifact@v4 + with: + name: Event File + path: ${{ github.event_path }} + build: runs-on: ubuntu-latest @@ -30,7 +40,7 @@ jobs: - name: Build OIE (unsigned) if: github.ref != 'refs/heads/main' working-directory: server - run: ant -f mirth-build.xml -DdisableSigning=true + run: ant -f mirth-build.xml -DdisableSigning=true -Dcoverage=true - name: Package distribution run: tar czf openintegrationengine.tar.gz -C server/ setup --transform 's|^setup|openintegrationengine/|' @@ -40,3 +50,19 @@ jobs: with: name: oie-build path: openintegrationengine.tar.gz + + - name: Stage Test Results + if: (!cancelled()) + run: | + mkdir -p aggregate-test-results + # Copy the directory structures + cp -r --parents */build/test-results aggregate-test-results/ + + - name: Upload Test Results + if: (!cancelled()) + uses: actions/upload-artifact@v4 + with: + name: Test Results + path: | + aggregate-test-results/**/*.xml + diff --git a/.github/workflows/upload_test_results.yaml b/.github/workflows/upload_test_results.yaml new file mode 100644 index 000000000..21ab857bb --- /dev/null +++ b/.github/workflows/upload_test_results.yaml @@ -0,0 +1,38 @@ +name: Test Results + +on: + workflow_run: + workflows: ["Build Open Integration Engine"] + types: + - completed + +permissions: {} + +jobs: + test-results: + name: Test Results + runs-on: ubuntu-latest + if: github.event.workflow_run.conclusion == 'success' || github.event.workflow_run.conclusion == 'failure' + + permissions: + checks: write + # needed unless run with comment_mode: off + pull-requests: write + # required by download step to access artifacts API + actions: read + + steps: + - name: Download and Extract Artifacts + uses: actions/download-artifact@v4 + with: + run-id: ${{ github.event.workflow_run.id }} + github-token: ${{ secrets.GITHUB_TOKEN }} + path: artifacts + + - name: Publish Test Results + uses: EnricoMi/publish-unit-test-result-action@v2 + with: + commit: ${{ github.event.workflow_run.head_sha }} + event_file: artifacts/Event File/event.json + event_name: ${{ github.event.workflow_run.event }} + files: "artifacts/Test Results/**/*.xml" diff --git a/client/ant-build.xml b/client/ant-build.xml index de1dbfd09..e42fdf0f4 100644 --- a/client/ant-build.xml +++ b/client/ant-build.xml @@ -1,4 +1,6 @@ - + + OIE Client Build Help ----------------------- @@ -67,9 +69,18 @@ - + + + + + + + + + + @@ -352,30 +363,78 @@ resource="org/jacoco/ant/antlib.xml" classpathref="jacoco.classpath"/> + + Run unit tests WITH JaCoCo coverage. + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - + Run unit tests. Coverage is only enabled if 'jacoco.agent.arg' is set. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/client/build.properties b/client/build.properties index 05c6e3f82..731c01e7a 100644 --- a/client/build.properties +++ b/client/build.properties @@ -1,6 +1,7 @@ # top level directories src=${basedir}/src test=${basedir}/test +build.dir=${basedir}/build server=${basedir}/../server donkey_src=${basedir}/../donkey/src/main/java donkey_lib=${basedir}/../donkey/lib @@ -13,5 +14,23 @@ dist=${basedir}/dist # jars client.jar=mirth-client.jar +# Reports +reports.dir=${build.dir}/reports + +# JUnit Raw Results (XML) +test.results.dir=${build.dir}/test-results/test + +# JUnit Human-Readable Reports (HTML) +reports.tests.dir=${reports.dir}/tests/test + +# JaCoCo Execution Data (.exec) +jacoco.data.dir=${build.dir}/jacoco +jacoco.exec.file=${jacoco.data.dir}/test.exec + +# JaCoCo Reports (HTML and XML) +reports.jacoco.dir=${reports.dir}/jacoco/test +reports.jacoco.html=${reports.jacoco.dir}/html +reports.jacoco.xml=${reports.jacoco.dir}/jacocoTestReport.xml + # This value is used as the modified time for the files inside of jar, zip, and war files archive.entry.date=1999-01-01T00:00:00.000Z diff --git a/command/build.properties b/command/build.properties index 03e49e197..917d50746 100644 --- a/command/build.properties +++ b/command/build.properties @@ -3,7 +3,7 @@ src=${basedir}/src classes=${basedir}/classes lib=${basedir}/lib conf=${basedir}/conf -build=${basedir}/build +build.dir=${basedir}/build dist=${basedir}/dist test=${basedir}/test testlib=${basedir}/testlib @@ -14,5 +14,23 @@ server=${basedir}/../server cli.jar=mirth-cli.jar cli-launcher.jar=mirth-cli-launcher.jar +# Reports +reports.dir=${build.dir}/reports + +# JUnit Raw Results (XML) +test.results.dir=${build.dir}/test-results/test + +# JUnit Human-Readable Reports (HTML) +reports.tests.dir=${reports.dir}/tests/test + +# JaCoCo Execution Data (.exec) +jacoco.data.dir=${build.dir}/jacoco +jacoco.exec.file=${jacoco.data.dir}/test.exec + +# JaCoCo Reports (HTML and XML) +reports.jacoco.dir=${reports.dir}/jacoco/test +reports.jacoco.html=${reports.jacoco.dir}/html +reports.jacoco.xml=${reports.jacoco.dir}/jacocoTestReport.xml + # This value is used as the modified time for the files inside of jar, zip, and war files archive.entry.date=1999-01-01T00:00:00.000Z diff --git a/command/build.xml b/command/build.xml index 0f2ff9c52..a591dabc1 100644 --- a/command/build.xml +++ b/command/build.xml @@ -1,4 +1,6 @@ - + + @@ -10,13 +12,19 @@ unless:set="archive.entry.date" /> - + - + + + + + + + @@ -25,28 +33,28 @@ - + - + - + - + - + - + - + @@ -91,29 +99,77 @@ resource="org/jacoco/ant/antlib.xml" classpathref="jacoco.classpath"/> + + Run unit tests WITH JaCoCo coverage. + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - + Run unit tests. Coverage is only enabled if 'jacoco.agent.arg' is set. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/donkey/build.properties b/donkey/build.properties index 4f1f6ce8b..58466c9c5 100644 --- a/donkey/build.properties +++ b/donkey/build.properties @@ -3,6 +3,7 @@ src=${basedir}/src/main/java classes=${basedir}/classes test=${basedir}/src/test/java test_classes=${basedir}/test_classes +build.dir=${basedir}/build lib=${basedir}/lib testlib=${basedir}/testlib setup=${basedir}/setup @@ -19,5 +20,23 @@ setup=${basedir}/setup setup.lib=${setup}/lib setup.docs=${setup}/docs +# Reports +reports.dir=${build.dir}/reports + +# JUnit Raw Results (XML) +test.results.dir=${build.dir}/test-results/test + +# JUnit Human-Readable Reports (HTML) +reports.tests.dir=${reports.dir}/tests/test + +# JaCoCo Execution Data (.exec) +jacoco.data.dir=${build.dir}/jacoco +jacoco.exec.file=${jacoco.data.dir}/test.exec + +# JaCoCo Reports (HTML and XML) +reports.jacoco.dir=${reports.dir}/jacoco/test +reports.jacoco.html=${reports.jacoco.dir}/html +reports.jacoco.xml=${reports.jacoco.dir}/jacocoTestReport.xml + # This value is used as the modified time for the files inside of jar, zip, and war files archive.entry.date=1999-01-01T00:00:00.000Z diff --git a/donkey/build.xml b/donkey/build.xml index 781f0824e..7dc831adb 100644 --- a/donkey/build.xml +++ b/donkey/build.xml @@ -1,5 +1,7 @@ - + + @@ -10,12 +12,20 @@ - - + + + + - + + + + + + + @@ -89,33 +99,81 @@ - + + + Run unit tests WITH JaCoCo coverage. + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - + Run unit tests. Coverage is only enabled if 'jacoco.agent.arg' is set. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + diff --git a/server/build.properties b/server/build.properties index 966ab20b8..d3c6f2708 100644 --- a/server/build.properties +++ b/server/build.properties @@ -11,8 +11,8 @@ conf=${basedir}/conf dbconf=${basedir}/dbconf public_html=${basedir}/public_html public_api_html=${basedir}/public_api_html -build=${basedir}/build -extensions=${build}/extensions +build.dir=${basedir}/build +extensions=${build.dir}/extensions logs=${basedir}/logs docs=${basedir}/docs docs.javadocs=${docs}/javadocs @@ -30,6 +30,24 @@ dbconf.jar=mirth-dbconf.jar userutil-sources.jar=userutil-sources.jar tests.jar=mirth-server-tests.jar +# Reports +reports.dir=${build.dir}/reports + +# JUnit Raw Results (XML) +test.results.dir=${build.dir}/test-results/test + +# JUnit Human-Readable Reports (HTML) +reports.tests.dir=${reports.dir}/tests/test + +# JaCoCo Execution Data (.exec) +jacoco.data.dir=${build.dir}/jacoco +jacoco.exec.file=${jacoco.data.dir}/test.exec + +# JaCoCo Reports (HTML and XML) +reports.jacoco.dir=${reports.dir}/jacoco/test +reports.jacoco.html=${reports.jacoco.dir}/html +reports.jacoco.xml=${reports.jacoco.dir}/jacocoTestReport.xml + # setup directory setup=${basedir}/setup setup.server.lib=${setup}/server-lib diff --git a/server/build.xml b/server/build.xml index 30091d371..32dd10eb8 100644 --- a/server/build.xml +++ b/server/build.xml @@ -1,5 +1,6 @@ - + @@ -67,17 +68,24 @@ - + + - + + + + + + + @@ -1304,58 +1312,92 @@ resource="org/jacoco/ant/antlib.xml" classpathref="jacoco.classpath"/> + + Run unit tests WITH JaCoCo coverage. + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + Run unit tests. Coverage is only enabled if 'jacoco.agent.arg' is set. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - + + + diff --git a/server/mirth-build.xml b/server/mirth-build.xml index 73dda90fd..e4fc700ad 100644 --- a/server/mirth-build.xml +++ b/server/mirth-build.xml @@ -187,10 +187,19 @@ - - - - + + + + + + + + + + + + + @@ -203,4 +212,11 @@ + + + + + + +