Skip to content

[ZEPPELIN-6566] Run frontend unit checks in CI - #5548

Open
kimyenac wants to merge 3 commits into
apache:masterfrom
kimyenac:ZEPPELIN-6566
Open

kimyenac wants to merge 3 commits into
apache:masterfrom
kimyenac:ZEPPELIN-6566

Conversation

@kimyenac

@kimyenac kimyenac commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

What is this PR for?

Give the frontend unit checks named results in pull-request CI and run the React remote tests and typecheck through Maven.

  • Scripts:
    • projects/zeppelin-react gains typecheck (tsc --noEmit).
    • The frontend root gains test:react and typecheck:react. Both delegate with npm --prefix projects/zeppelin-react, so the React project's working directory is unchanged.
  • Maven: the test phase gains two executions, npm test react and npm typecheck react. A failure names the execution in the Maven log, for example Failed to execute goal ... npm (npm typecheck react).
  • Workflow: frontend.yml gains three steps on the anonymous leg of run-playwright-e2e-tests: Run Angular shell unit tests, Run React unit tests and Typecheck React.
    • They call the same root scripts, so the local, Maven and workflow entry points run one implementation.
    • The auth leg still runs the Maven-owned checks inside mvnw verify -Pweb-e2e, without a duplicate named result.
  • TS2802 fix: exportFile.spec.ts spread a Uint8Array, which fails tsc --noEmit under the React project's ES5 target. It now uses Array.from. This was the only typecheck error on master (943a3fb8d).
  • fail-fast: false on the e2e matrix:
    • When I first ran the deliberate typecheck failure on my fork, the auth leg's Maven npm typecheck react execution failed first. Matrix fail-fast then cancelled the anonymous leg during Install application, so Typecheck React never ran.
    • The failure only showed up under the e2e job name, which is what this issue is meant to prevent.
    • With fail-fast: false, both legs report (run). core.yml already uses fail-fast: false for its matrices.
  • Docs: AGENTS.md and projects/zeppelin-react/AGENTS.md describe the new commands and CI steps. The parts that are still true are kept:
    • the checks without a named step still run inside verify -Pweb-e2e on both legs and surface under the e2e job name;
    • React lint still runs only there;
    • the npm-audit remediation workflow also runs npm test.

Commits, continued from the ZEPPELIN-6566-shell-react-ci branch in voidmatcha/zeppelin with the author's agreement:

  1. 7c709e5ac, the original commit unchanged: scripts, Maven executions, named steps, the TS2802 fix and the first docs update.
  2. 038784611: fail-fast: false on the e2e matrix.
  3. 9adb65413: the docs corrections above.

The verification below covers the combined result.

Cost: on the anonymous leg the shell tests, React tests and React typecheck now run twice, once as named steps and again in the Maven test phase inside verify. Locally that is about 16 seconds in total: shell 8.2s, React 6.7s, typecheck 1.5s.

What type of PR is it?

Improvement

Todos

  • Add typecheck to the React project, and test:react / typecheck:react to the frontend root
  • Add Maven npm test react and npm typecheck react executions
  • Add named shell test, React test and React typecheck steps on the anonymous leg
  • Fix the existing TS2802 typecheck failure
  • Keep the anonymous leg from being cancelled before its named steps report
  • Demonstrate the deliberate failures and revert them

What is the Jira issue?

ZEPPELIN-6566

How should this be tested?

cd zeppelin-web-angular
npm run test:react
npm run typecheck:react
cd ..
./mvnw test -pl zeppelin-web-angular

Same pass count from every entry point. The React suite runs 15 files / 105 tests from each of:

  • npm test in projects/zeppelin-react
  • npm run test:react at the frontend root
  • the Maven npm test react execution

The shell suite runs 211 tests. ./mvnw test -pl zeppelin-web-angular reports BUILD SUCCESS.

Deliberate failures (all reverted). Each one was written to pass lint, so it fails in the targeted check and not earlier. The fork runs used throwaway branches, now deleted; the run pages remain.

Deliberate failure Local Fork CI (anonymous leg)
failing shell spec npm run test:shell fails (1 failed / 211 passed) Run Angular shell unit tests fails (run)
failing React spec npm run test:react fails; Maven fails at (npm test react) Run React unit tests fails (run)
TypeScript error in React src npm run typecheck:react fails; Maven fails at (npm typecheck react) Typecheck React fails, and the auth leg fails at Maven (npm typecheck react) (run)

For the TypeScript error, the React webpack build uses ts-loader with transpileOnly: true. So the error does not fail Install application first, and it surfaces at the named step.

Screenshots (if appropriate)

N/A.

Questions:

  • Does the license files need to update? No.
  • Is there breaking changes for older versions? No. Existing scripts and executions are unchanged.
  • Does this needs documentation? The two AGENTS.md files are updated.

🤖 Generated with Claude Code

voidmatcha and others added 3 commits October 6, 2026 09:09
Expose the shell and React unit checks as named frontend workflow steps and
run React tests and typechecking from the Maven test phase. Fix the existing
ES5-compatible Uint8Array assertion so the React typecheck can become a gate.
Update the scoped test guidance to describe the new command and CI surfaces.

Confidence: high
Scope-risk: additional frontend CI duration and newly enforced React failures
Not-tested: GitHub-hosted workflow execution
Disable fail-fast on the run-playwright-e2e-tests matrix. The auth leg
runs the Maven-owned checks inside mvnw verify -Pweb-e2e, so a React
test or typecheck failure there can finish first and cancel the
anonymous leg before its named steps report. The failure then only
shows up under the e2e job name.
Restore what still holds after the named steps are added: frontend.yml
builds with -DskipTests, so every Maven-owned check runs inside mvnw
verify -Pweb-e2e on both legs, and the checks without a named step
still surface under the e2e job name. In the React guidance, keep the
build phase, the lint running only inside the e2e job, and the npm-audit
remediation workflow running npm test.

@voidmatcha voidmatcha left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants