ci: run the UI tests (client, server, integration) on pull requests - #1059
Open
ilayfalach wants to merge 1 commit into
Open
ci: run the UI tests (client, server, integration) on pull requests#1059ilayfalach wants to merge 1 commit into
ilayfalach wants to merge 1 commit into
Conversation
Closes #1045. ci.yml only ran pytest hera/tests/; the client, server and integration suites ran by hand, so all three had drifted out of sync with the code and none of them passed. Adds three jobs and repairs what they found. CI (.github/workflows/ci.yml) - ui-client: Node 22, npm ci, tsc --noEmit, unit tests, production build — the ui/client/TEST_UI.md checklist, in order. Node 22 because the client uses Set.prototype.difference, which Node 20 lacks. - ui-server: pytest ui/server/tests with only the four packages the tests need; they install a fake hera, so no database is involved. - ui-integration: MongoDB service on 27018 plus the full Python env, running the same vitest command the Docker image runs. No image is built: globalSetup.ts starts the server itself. Server tests (6 were failing) - /exec has answered WARMING_UP since #1030 until the warmup thread imported hera, which unit tests never start: new `warmed_up` fixture, plus a test for the WARMING_UP answer itself. - Since #1033 the workflow runs in a forked child, so what the fake hera recorded in memory died with the child. It now records to a file the parent reads back. Integration tests (5 of 6 files were failing) - App owns its BrowserRouter, so wrapping it in MemoryRouter threw "cannot render a <Router> inside another <Router>". Set the path on the jsdom location instead. - jsdom reports every element as 0x0, so flexlayout rendered tab titles but never tab content — the project tree did not exist in the DOM. setupIntegDom.ts gives jsdom a viewport and a ResizeObserver. - Follow the UI as it is today: Add document / Delete project live in the project "Actions" popover, the document kind is a toggle group (and switching kind resets the name), the central repo folder expands only from its chevron, and deleting a document happens in the details view. - globalSetup waits for /ready instead of /healthz (/exec answers WARMING_UP until hera is imported) and takes a free port from the OS instead of assuming 8000 — server.py silently moves to the next free port, and nothing then answers where the tests look. - testTimeout 20s: jsdom + MUI renders trip the 5s default when workers compete for cores. Docker chain (could not build from a clean checkout) - fonttools 4.61.0 needs Python >= 3.10, so pip install failed on the image's 3.9.13 and the base image did not build. Pinned back to 4.60.2, the last release supporting 3.9 — it is the only pin in requirements.txt that 3.9 cannot resolve, so the declared support (setup.py python_requires>=3.9, README "Python 3.9+") still holds. - ui/server/requirements.txt was referenced by Dockerfile-server but had never been committed. Added, and argcomplete (imported by server.py) is now declared in the root requirements.txt too. - Dockerfile-server ran hera/scripts/run_mongo.sh + add_repo.sh at build time; both moved to hera/scripts/temp/ and mongod is not in the image anyway. Removed, with a note on registering the repository at runtime. - .dockerignore: skip heraenv/, .claude/ and cache/, which otherwise add gigabytes to the build context. Verified locally: client 389 tests, server 23 tests, integration 25 tests, plus the full Docker path on Python 3.9.13 (hera -> hera-server -> hera-integ-test, run_tests_docker.sh and npm run test:integ). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Collaborator
|
@erasta can you please take a look and confirm the changes to your code are LGTM? |
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 #1045.
ci.ymlonly ranpytest hera/tests/. The client, server and integration suites ran by hand, so all three had drifted out of sync with the code — none of them passed when first run. This adds the three CI jobs and repairs what they found.CI jobs (
.github/workflows/ci.yml)ui-clientnpm ci,tsc --noEmit, unit tests, production build — theui/client/TEST_UI.mdchecklist, in orderui-serverpytest ui/server/testswith only the four packages the tests need (they install a fakehera, so no database)ui-integrationNo Docker image is built in CI:
globalSetup.tsstartsui/server/server.pyitself, so the integration job takes minutes instead of the ~25 a base-image build costs.Server tests — 6 were failing
/exechas answeredWARMING_UPsince UI rebuild warmup #1030 until the warmup thread imported hera, and unit tests never start that thread. Added awarmed_upfixture, plus a test for theWARMING_UPanswer itself.Integration tests — 5 of 6 files were failing
Appowns itsBrowserRouter, so wrapping it inMemoryRouterthrew "cannot render a<Router>inside another<Router>". The path is set on the jsdom location instead.setupIntegDom.tsgives jsdom a viewport and a ResizeObserver.globalSetupwaits for/readyinstead of/healthz, and takes a free port from the OS instead of assuming 8000 —server.pysilently moves to the next free port, and nothing then answers where the tests look.testTimeout20s: jsdom + MUI renders trip the 5s default when workers compete for cores.Docker chain — could not build from a clean checkout
fonttools==4.61.0needs Python >= 3.10, sopip installfailed on the image's 3.9.13. Pinned back to4.60.2— it is the only pin inrequirements.txtthat 3.9 cannot resolve, sopython_requires=">=3.9"still holds and the image stays on 3.9.ui/server/requirements.txtwas referenced byDockerfile-serverbut had never been committed. Added;argcomplete(imported byserver.py) is now declared in the rootrequirements.txttoo.Dockerfile-serverranhera/scripts/run_mongo.sh+add_repo.shat build time — both moved tohera/scripts/temp/, andmongodis not in the image anyway. Removed, with a note on registering the repository at runtime..dockerignorenow skipsheraenv/,.claude/andcache/, which otherwise add gigabytes to the build context.Verified locally
🤖 Generated with Claude Code