Repository navigation
feat: aggregate and gate process test coverage, fix the cancellation gateway - #111
Merged
Merged
Conversation
…gateway - Combine the per-class coverage reports in the CIB seven examples (report aggregator, Gradle and Maven). - Fail every *ProcessTest class below 100 % process coverage in the CIB seven and Fluxnova examples; the minimum is the extension's system property, applied to process test classes only. - Fix cancel-bike-order in all examples: a cancellable order is reversed directly, only a non-cancellable one is clarified and its costs booked. The demo dealer refuses cancellation for BIKE-CUSTOM. - Cover the signature reminder and both cancellation branches in the process tests; Bruno, demo data, fullstack UI and docs follow. Refs Miragon/cibseven-developer-training#249
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
#110 writes one process test coverage report per test class, but there was no overview across classes and nothing failed when a path went untested. Turning on a 100 % minimum surfaced two gaps that held in every example: the 7-day signature reminder was never tested, and in cancel-bike-order the condition of the gateway "Cancellation possible?" sat on the "No" flow, so a cancellable order went through "Clarify return with supplier" and "Book costs" (ADR-0014 of the Temporal example already noted that the model reads as inverted).
What
aggregateProcessTestCoverageaftertest. Maven runs theaggregategoal in thetestphase. The result isall/report.htmlin the report folder.org.cibseven.community.process_test_coverage.ASSERT_AT_LEAST, orprocess_test_coverage.ASSERT_AT_LEASTfor Fluxnova.ProcessTestCoverageContextCustomizerFactory, registered inMETA-INF/spring.factories. It builds the coverage properties with the extension's builder only for classes ending inProcessTest. Other classes that run the process, such asBikeUnavailableTransactionTest, are still reported but not gated. The extension's own inclusion patterns cannot be used for this, because an excluded class that starts a process fails with "Coverage state must be initialized".cibseven-remoteuses the JUnit 5 extension, whose builder reads the property itself.-PprocessTestCoverageMinimum=0(Gradle) or-Dprocess-test-coverage.minimum=0(Maven).${!cancellationPossible}(Camunda 8:=not(cancellationPossible)). The models were edited with bpmn-cli, so each diff is one line, and the generated process APIs were regenerated.BIKE-CUSTOMcannot be cancelled. Every other order still can. The rule is encoded in the order id prefixORDER-CUSTOM-, so the adapter keeps no state.03-abortand the demo data07-withdrawn-return-openorderBIKE-CUSTOM, so they keep the clarify-return path.11-abort-order-cancelledshows the direct cancellation.03-abortalso checks that the application is still WITHDRAWN after a few seconds.withdrawRequestedNote, en/de) now says the Tasklist step is only needed when the dealer cannot cancel.BIKE-CUSTOMas intended, anddrift.ymlrecords why the Fluxnova factory and the Temporal check differ.Verification
./gradlew clean build/./mvnw -B clean verifyin cibseven-embedded, cibseven-process-engine-api and cibseven-remote (both variants), fullstack-cibseven-embedded and fluxnova-embedded (both variants). EachBikeLeasingProcessTestreaches 100 %. The CIB seven report folders containall/report.html.BikeLeasingProcessTestfails with "matches if the coverage ratio is at least 1.0" in cibseven-embedded (93 %), cibseven-remote (94.6 %) and fluxnova-embedded (94.4 %), in both variants.BikeUnavailableTransactionTest(46 %) passes ungated.BikeLeasingProcessTestmethod fails the gate, and passes with-PprocessTestCoverageMinimum=0../mvnw test -Dtest=…#… -Dprocess-test-coverage.minimum=0passes and writesall/../gradlew build/./mvnw -B verifypassed in operaton-embedded, operaton-process-engine-api, operaton-remote, temporal-native and the three Zeebe examples. These builds ran before the last whitespace and Bruno-only edits in those examples. The Zeebe builds ran one at a time, because Camunda Process Test containers time out under podman load.npm run drift,npm run generate:check,scripts/check-owner.sh,npm testandnpm --prefix examples/fullstack-cibseven-embedded/frontend run verifyall pass.bpmn-cli validatereports every edited model valid, with no warnings.Out of scope / Follow-ups
withdrawRequestedNote(en/de) and the visible "Custom Build" bike in the fullstack catalogue are user-facing; please confirm the wording and the choice.Project); the cache is off in these builds.report.jsonunder the report folder, so reports of renamed or deleted test classes stay inall/untilclean.Workflow.getVersion; the dev server keeps no state, and on a real cluster a parked cancel workflow would simply complete without booking costs.Refs https://github.com/Miragon/cibseven-developer-training/issues/249