3 Commits
Author SHA1 Message Date
Ruslan KonviserandClaude Opus 5.5 91d91ffca3 test: make the unit-test run hermetic and fix the Angular jest harness
The Unit Tests workflow has never been green (24 of 97 projects red at
develop eac7136562, run 36319732347). Causes addressed here:

- Env leak: Nx loads the committed .env.local (DEMO=true,
  WORKER_QUEUE_ENABLED=false, NODE_ENV=development) into every task.
  The test step now sets NX_LOAD_DOT_ENV_FILES=false, and the two specs
  that depend on a mode pin it themselves (role-permission counts pin
  environment.demo=false and gain a demo-mode suite asserting 209 per
  role; the worker spec clears the queue env before the constants load).
  .env.local is unchanged.
- Angular harness: nohoist gives each workspace its own @angular copy,
  so setupZoneTestEnv() initialised a different TestBed from the one the
  spec used. A workspace resolver (jest.resolver.js, wrapping Nx's) makes
  every @angular/* import in a Jest project resolve to one copy. The
  Angular projects now inherit the preset's transformIgnorePatterns,
  which gains the .mjs exception plus @datorama, @ngneat and lodash-es.
- ui-config's environment.ts is generated and gitignored; the workflow
  runs `yarn config:dev` before the tests, as the Playwright workflow does.
- Misconfigured targets: gauzy (jest.config.js -> .ts, Angular transform,
  setupFile moved into the config), integration-sim-ui (.ts -> .cts),
  integration-activepieces (config file added), mcp-auth (ran
  `node build/main.js --test`; now the jest executor like apps/mcp).
- Real failures: the openai "silence" case used a body with no `text`,
  which the shared helper rejects by contract; the toolbar spec read the
  tabIndex property, which is 0 on any button; the docs-ui linearity
  tests asserted wall-clock bounds, now a 4x-input growth ratio.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-27 17:39:40 +02:00
Ruslan KonviserandClaude Opus 5 5aa7b27392 ci: use the real nx flag and drop the checkout credential
From review on #10055.

`--continue` is not an nx option. nx 22 spells it `nxBail`, and an unknown
option is forwarded to the executor - so `--continue` would have reached jest
rather than enabling failure continuation, and the first failing project would
still have hidden every other project's result. Now `--nxBail=false`.

Also sets `persist-credentials: false` on checkout: this job only reads the
tree and never pushes, so the credential does not need to outlive the step.

Action majors stay aligned with build.yml on purpose - this job consumes the
node_modules cache that workflow writes, so producer and consumer are kept on
the same actions rather than following the newer majors used elsewhere.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-28 00:30:12 +02:00
Ruslan KonviserandClaude Opus 5 9b3ada96ea ci: run the existing jest unit tests on stage
The repository has ~330 `*.spec.ts` files and an nx `test` target on 20+
projects (`@nx/jest:jest`, already cached via nx.json targetDefaults), but no
workflow ever invoked any of them. CI ran builds plus Playwright/Cypress e2e
only, so a green pull request proved the code COMPILED and said nothing about
the unit tests - including the ~53 specs in packages/core.

This wires the existing targets up. It adds no test tooling and changes no
test code.

Scope is `stage` only, plus manual dispatch. Stage is where the cascade lands
before production and pushes to it are infrequent, so this cannot slow the
day-to-day loop while the suites' true state is still unknown.

Deliberately NOT a required status check: these suites have never run in CI so
the first runs may be red, and that is exactly the information the workflow
exists to surface - it should surface it without blocking the cascade. Promote
it to required once it has been green for a while.

`cancel-in-progress: false`, because a cancelled test run produces no verdict
and a gate that reports nothing is worse than no gate.

Dependencies come from the same lockfile-keyed cache the build workflow
writes, so a stage push that already built this tree reuses it rather than
paying for another install.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-28 00:14:25 +02:00