Repository navigation
fix(webapps): restore test harnesses and validate SDK calendar dates - #3820
Closed
hauptmedia wants to merge 1 commit into
Closed
hauptmedia wants to merge 1 commit into
hauptmedia wants to merge 1 commit into
Conversation
Restore legacy UI and SDK Node test tooling, repair date validation with 48 regression cases, and resolve the Neo XML test DTD offline. Include mechanical lint cleanup. Restore superagent-mock-config.js verbatim from operaton/operaton commit ee7bbef at webapps/camunda-bpm-sdk-js/test/superagent-mock-config.js, retaining its original Camunda Apache-2.0 attribution. Source: https://github.com/operaton/operaton/blob/ee7bbef8d02f85d0d6a7d4052b275d6b5b4cd18d/webapps/camunda-bpm-sdk-js/test/superagent-mock-config.js
This was referenced Oct 9, 2026
|
hauptmedia
added a commit
that referenced
this pull request
Oct 9, 2026
Reuse the verified offline XML test prerequisite from Operaton PR #3820. Preserve XML assertions while avoiding a live mybatis.org lookup during validation; runtime parsing is unchanged.
This was referenced Oct 22, 2026
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.



Superseded by three focused PRs
This combined PR has been split by problem into:
All three target
main. Merge #3900 before #3901 so the SDK date regression can use the restored Mocha/Chai test runner. Together they preserve all changes from this PR. The original description and validation record are retained below for reference.Summary
This PR addresses three independent problems found when attempting to run the existing test suites during the investigation of #3814: a broken legacy test entry point, a real SDK date-validation defect, and a network-dependent Neo XML test. These problems already exist independently of the multi-instance input-mapping change. This PR is not a prerequisite for #3818. The separate engine regression repairs are in #3819.
1. The legacy frontend still contains tests, but its test setup is incomplete
On the unchanged base,
webapps/frontend/package.jsondefinesnpm testaskarma start karma.config.js, but that configuration file is missing. Running the advertised command therefore stops withCannot find module .../karma.config.jsbefore any browser assertion runs. Required framework/launcher/assertion dependencies are also missing from the current setup.The SDK client tests have a separate problem: they reference
../superagent-mock-config, which was removed from the repository layout, and cannot start without that fixture and its test dependencies. Once the historical setup is restored, five helper usages are incompatible with the current libraries: three assertions inspectrequest.headersrather than Superagent'srequest.header, and two Sinon spies call the removedreset()method rather thanresetHistory(). The expected header values and behavioral assertions are retained.The consequence is a verification gap: keeping these test source files in the repository does not mean they actually run. The legacy Maven frontend build runs dependency installation, the license check and production bundling; it does not execute the legacy
npm testcommand. The PR workflow's dedicated frontend unit-test job targets Webapps Neo, so a green build does not prove that these older UI/SDK suites work.This PR adds the missing Karma configuration, pins the required development dependencies, restores the original SDK request-mock fixture with its attribution, and provides separate
npm run test:sdkandnpm run test:uicommands.npm testinvokes both in sequence. The SDK Node suite now runs successfully. The 32 UI browser spec files bundle, but browser execution is still unverified because Chromium cannot create its required Unix socket in the current executor. The older SDK browser and Commons browser inventories are not restored or claimed as executed by this change.2. SDK Date validation checks the string's shape, but not whether the date exists
The existing
Datebranch inoperaton-bpm-sdk-js/lib/forms/type-util.jsonly applies a regular expression forYYYY-MM-DDTHH:mm:ssand optional fractional seconds. It accepts two digits for each calendar/time field without checking their ranges or calendar relationships.For example,
2023-02-29T12:34:56,2024-02-30T12:34:56,2024-04-31T12:34:56and2024-01-01T25:00:00pass that check. Consequently, SDK form type checking can accept nonexistent dates or invalid times;convertToType(..., 'Date')can return those invalid strings rather than rejecting them. This is a product-validation defect, not merely an environment or test-runner issue.The fix validates the Gregorian calendar (including century leap-year rules), month/day ranges and time fields without using JavaScript Date parsing or timezone conversion. It deliberately retains the existing input grammar and compatibility forms: four-digit years, mandatory seconds, zero-to-four fractional digits, the legacy trailing decimal point, second 60, and end-of-day
24:00:00only when all smaller fields are zero. Offset/Z strings remain unsupported.The new regression file contains 48 cases. Against the unchanged validator, 17 invalid-calendar/range cases fail while 31 compatibility controls pass; with the fix, all 48 pass. The checks also cover host-timezone independence for UTC, New York and Kathmandu.
3. A Neo XML unit test unexpectedly requires external network access
QuerySessionFactoryTestparses the generated MyBatis configuration using a plain JAXP document builder. The XML references the MyBatis DTD, so the parser attempts external DTD resolution. The test can fail when that host cannot be resolved or reached, even when the generated mapping configuration is correct.MyBatis already bundles the required DTD and provides
XMLMapperEntityResolver. Configuring that resolver in the test lets the parser use the bundled resource. The change is confined to test setup; it does not change runtime query generation or remove the test assertions.Supporting cleanup and scope
The remaining edits are mechanical lint fixes in the legacy frontend build configuration and compatibility helper. Their normalized ASTs were compared to verify that the cleanup does not change behavior. This PR combines test-infrastructure repairs with the separately testable SDK validation fix; it introduces no multi-instance engine behavior changes and does not modify CI workflows.
Attribution
The SDK
superagent-mock-config.jsfixture is restored verbatim from repository history. Its original Camunda Apache-2.0 copyright/license header is retained. The source revision and path are also recorded in the commit.Verified locally
Verification scope
The three companion change sets were validated together on
79f9f874bcec4f3ff7423ac39270bfea2b66cfb1: 26,919 distinct Java cases, zero failures/errors and 142 existing skips; all 129 reactor modules completed successfully across verified recovery segments. This was not one uninterrupted build, and it is not a claim that each split branch independently passed the expanded full suite.This branch is based on
ce6e96e4139a006bb3ba6a3fce70f80eb3641f5c. The intervening main change only updates the REST documentation dependency lockfile. Every published changed file was checked byte-for-byte against the tested content.Legacy browser test execution is explicitly deferred for this run: Chromium cannot create its required Unix socket in the test executor. The 32 UI, 7 SDK browser and 13 Commons browser spec inventories are not claimed as passed. No tests are permanently disabled. Optional external-database/runtime-container/E2E matrices were not run.
The cleanup script's isolated imports phase passed. Its code/test phases encountered existing recipe configuration errors, so the complete cleanup pipeline is not claimed as passed.
git diff --checkpassed.