GPHDRUI-427: Fix CI test failures and modernize GitHub workflows - #165
Merged
Conversation
The test suite failed on CI with "ReferenceError: FormData is not defined" because the pipeline ran on an outdated Node that lacks the global FormData/Blob (added in Node 18+). The old workflow bundled its own Node via the CultureHQ/actions-yarn wrapper and silently ignored the matrix node-version. Test fixes (Node-version agnostic): - ContactDocumentService mock and integration tests: use the `form-data` package instead of the global FormData, and Buffer instead of Blob for the payload, so the tests run on any Node version - add "form-data": "^4.0.0" as an explicit devDependency (previously only a transitive axios dependency) and update yarn.lock CI workflow modernization: - main.yml: replace the outdated CultureHQ/actions-yarn wrapper with actions/setup-node@v4 running Node 20.x + yarn cache; bump actions/checkout to v4; install via `yarn install --frozen-lockfile`; run the integration suite (yarn test:integration) as a separate step after the mock suite - publish.yml: same modernization (checkout@v4, setup-node@v4 Node 20.x, frozen-lockfile install); keep the tag-from-version and NPM publish steps unchanged - create-release.yml: bump actions/checkout to v4
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.
The test suite failed on CI with "ReferenceError: FormData is not defined" because the pipeline ran on an outdated Node that lacks the global FormData/Blob (added in Node 18+). The old workflow bundled its own Node via the CultureHQ/actions-yarn wrapper and silently ignored the matrix node-version.
Test fixes (Node-version agnostic):
form-datapackage instead of the global FormData, and Buffer instead of Blob for the payload, so the tests run on any Node versionCI workflow modernization:
yarn install --frozen-lockfile; run the integration suite (yarn test:integration) as a separate step after the mock suite