-
Notifications
You must be signed in to change notification settings - Fork 45
Refactor test and coverage #248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor test and coverage #248
Conversation
mgaffigan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love the direction.
kayyagari
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a note, Ant 1.10.x is needed to run the build (it didn't work with my old 1.9.4 install).
lol. That’s not a build error; that’s a carbon dating result. (good note, though) |
NicoPiel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I should write some tests...
gibson9583
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well documented. Looks good
This will allow all tests for a given sub-project to finish, but will abort the rest of the build. Previously the build would finish successfully even if there were test failures. Issue: OpenIntegrationEngine#144 Signed-off-by: Tony Germano <tony@germano.name>
Refactors the Ant build scripts across client, command, donkey, and server projects to improve CI integration and local developer experience. Changes: * Decoupled Coverage: Separated unit test execution (`test-run`) from code coverage instrumentation (`test-coverage`). Developers can now run tests locally without the performance penalty of the JaCoCo agent unless explicitly requested. * Standardized Output: Consolidated all test artifacts into a unified, Gradle-compliant directory structure: - Raw results: `build/test-results/test` - HTML/XML Reports: `build/reports/tests` and `build/reports/jacoco` Single project Usage: - Run standard unit tests: `ant test-run` - Run tests with coverage: `ant test-coverage` Full Build Usage: - Run standard unit tests: `ant -f mirth-build.xml build` - Run tests with coverage: `ant -f mirth-build.xml build -Dcoverage=true` Signed-off-by: Tony Germano <tony@germano.name>
Improves build hygiene by ensuring all generated artifacts are removed
during clean operations.
Changes:
* Global Clean: Added a top-level `clean-all` target in
`mirth-build.xml` that cascades to all sub-projects.
* Legacy Cleanup: Introduced `clean-legacy-dirs` target to remove
obsolete directories (`junit-reports`, `code-coverage-reports`)
ensuring developers do not view stale reports.
* Deep Clean: Updated sub-project clean targets to include
`${test_classes}` and `${build.dir}`, preventing stale class files
from polluting subsequent builds.
Signed-off-by: Tony Germano <tony@germano.name>
Establishes a split-workflow CI pipeline to safely run tests and report
results, complying with security best practices for public repositories.
Changes:
* Build Workflow:
- Updated the Ant build command to enable coverage
(`-Dcoverage=true`).
- Added a "Stage Test Results" step to aggregate XML reports from
all sub-projects (client, server, donkey, etc.) while preserving
directory structure.
- Added an "Event File" job to capture PR metadata for secure
downstream processing.
* Reporting Workflow:
- Created `upload_test_results.yaml` triggered by `workflow_run`.
- Implemented the privileged report publishing step separately from
the unprivileged build step.
- configured `EnricoMi/publish-unit-test-result-action` to ingest the
aggregated XML reports.
Security:
* Uses the `workflow_run` pattern to allow safe PR commenting from forks
without exposing write tokens to the build environment.
Signed-off-by: Tony Germano <tony@germano.name>
e854921 to
04b533b
Compare
See below for details of each commit.
Jacoco is now disabled by default in the main build. There is a message echoed during the build that informs the developer they can pass the
-Dcoverage=trueproperty to enable collection of execution data. This was meant to speed up the local development cycle. When enabled, html reports are now produced for each sub-project underbuild/reports/jacoco/test/html.This PR does not actually do anything to publish the jacoco report in github, though it updates the github action to prepare the html and xml files if we want to make use of them in a future PR. Our test coverage is so poor right now, that I don't really see an immediate value to publishing it on every pull request, and this one was getting big enough as it is.
supersedes #150
fixes #144
commit ef7ae42
commit 63c2dff
commit f506683
commit e854921