Run the web UI tests in CI - #258
Merged
Merged
Conversation
The ui/ suite covers 31 cases — OIDC enablement and callback handling,
role resolution including the group:{uuid}:admin bug that once locked
endpoint administrators out of the management areas, and dataset
metadata and spatial geometry parsing — and none of them ran on a pull
request. CI installed Python dependencies and ran pytest; nothing
installed npm dependencies. Frontend regressions could land unnoticed,
which matters because most recent changes here are to the UI.
Add a ui-test job to both workflows, on Node 18 to match the ui-builder
stage of Dockerfile.allinone, running `npm test -- --watchAll=false` so
react-scripts does not sit watching for changes and hang the runner.
Remove ui/src/App.test.js. It was the untouched Create React App
template asserting the page renders a "learn react" link; App.js renders
the admin console router and has never contained that text, so the test
could only fail. It survived unnoticed precisely because the suite was
never run. Removed rather than rewritten: the value here is in the
behavioural tests, and a smoke test mounting the whole router would have
to stub window.__EP_CONFIG__, which only exists at container runtime.
Closes #257
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.
Closes #257.
What this does
The
ui/suite covers 31 cases and none of them ran on a pull request. CIinstalled Python dependencies and ran
pytest; nothing installed npmdependencies. Frontend regressions could land unnoticed, which matters because
most recent changes to this repository are to the UI.
src/services/oidc.test.jssrc/components/DatasetMetadata.test.jssrc/services/roles.test.jsgroup:{uuid}:adminbugA
ui-testjob is added topr.ymlandmain.yml, on Node 18 to match theui-builderstage ofDockerfile.allinone, with npm caching keyed onui/package-lock.json. It runsnpm test -- --watchAll=false, sincereact-scripts watches for changes by default and would otherwise hang the
runner.
It is a separate job from the Python one, so a frontend failure is obvious at a
glance rather than buried in a combined log.
Removing the scaffold test
ui/src/App.test.jswas the untouched Create React App template:App.jsrenders the admin console router and has never contained that text, sothis test could only fail. It survived unnoticed precisely because the suite was
never run — which is the problem this PR fixes.
It is removed rather than rewritten. The value in this suite is in the
behavioural tests; a smoke test that mounts the whole
Appwould have to stubwindow.__EP_CONFIG__, which only exists at container runtime, and would be themost fragile test here for the least benefit.
Testing
Node is not available on the machine this was written on, so the frontend suite
could not be run locally — this PR's own
ui-testjob is its firstexecution. If any of the 31 cases have gone stale, they surface here, before
merging, which is what the job is for.
Python side is unaffected and still green:
black --check .clean across 253files,
flake8 api/ tests/ scripts/clean, 1269 tests passed.