Skip to content

Add CI and a proof-of-concept xunit test on stub#21

Merged
lagergren merged 5 commits into
masterfrom
ci-and-stub-tests
Jul 6, 2026
Merged

Add CI and a proof-of-concept xunit test on stub#21
lagergren merged 5 commits into
masterfrom
ci-and-stub-tests

Conversation

@lagergren

Copy link
Copy Markdown
Contributor

platform currently has no CI and no automated tests. This is a deliberately small proof-of-concept that establishes both.

What's added

1. CI — .github/workflows/ci.yml
Runs on push to master, on PRs, and via manual dispatch. One Build & test job: JDK 25 + gradle/actions/setup-gradle (validate-wrappers: true), then ./gradlew build (compiles every module + runs unit tests) and ./gradlew installDist (assembles the runnable platform). For XTC, "compiles + assembles a runtime" is already a meaningful gate that nothing guarded before.

2. A unit-test lane on :stub
stub was picked as the POC target because it has zero module dependencies and zero @Inject, so a test runs in a bare xunit harness. The routing/templating decisions in the Unavailable web service are extracted into a pure, dependency-free StubContent helper (behavior-preserving), and StubTest exercises it:

  • isLandingPath — root / index.html vs. other paths
  • applyTags — placeholder substitution

3. failOnTestFailure = true on :stub
The XTC plugin's default only logs test failures and exits 0. This makes a failing test actually fail the build, so the lane is a real gate, not decorative.

Verification (local)

  • ./gradlew build installDist — BUILD SUCCESSFUL (all modules, including platformUI).
  • ./gradlew :stub:build — StubTest passes 4/4.
  • Temporarily breaking an assertion → :stub:testXtc FAILEDBUILD FAILED, confirming the gate; then restored.

Suggested next steps (not in this PR)

  • Grow the xunit lane into auth (the security core) and common, extracting pure seams where needed.
  • Turn the empty tests/ dir into an in-process integration module driving common/auth/host/DB scenarios.
  • Optionally add a Docker image-build job.

lagergren added 2 commits July 6, 2026 14:50
platform had no CI and no automated tests. This establishes both, kept small:

- .github/workflows/ci.yml: build + installDist with Gradle wrapper validation,
  on push to master, pull requests, and manual dispatch.
- A first xunit unit-test lane on :stub. The routing/templating logic in the
  Unavailable web service is extracted into a pure StubContent helper
  (behavior-preserving) so it can be tested with no web server or injection
  context; StubTest exercises it (4 tests).
- failOnTestFailure=true on :stub so a failing test actually fails the build;
  the XTC plugin otherwise logs failures and exits 0.

Verified locally: ./gradlew build installDist succeeds, StubTest passes 4/4,
and a deliberately broken assertion fails the build (gate confirmed).
Comment thread stub/src/main/x/stub.x
lagergren added 3 commits July 6, 2026 15:48
…class

Per review (Gene): the isLandingPath/applyTags helpers don't need a separate
class. As static functions on the Unavailable service they are equally callable
and unit-testable (a static call instantiates no service and needs no web
server), so the extra type added nothing. Tests call Unavailable.isLandingPath
directly, which reads fine without the suggested import alias.
The gradle-node-plugin is already at the latest (7.1.0). Bump the rest of the
version-catalog toolchain and refresh the Quasar GUI deps to the latest within
their existing semver ranges (no major bumps):

- libs.versions.toml: nodejs 22.21.0 -> 22.23.1, npm 11.6.2 -> 11.18.0
- package.json: quasar 2.18.5 -> 2.21.1 (safe minor)
- yarn.lock regenerated in-range: axios 1.12.2 -> 1.18.1, pinia 3.0.3 -> 3.0.4,
  vue -> 3.5.x latest, etc.

Verified: ./gradlew build installDist is BUILD SUCCESSFUL under Node 22.23.1 --
the Quasar SPA builds and the stub tests still pass.
`yarn lint` was already broken before the dependency refresh: ESLint 9 defaults
to flat config, and eslint-plugin-vue 10 no longer ships the legacy
`plugin:vue/vue3-essential` shareable config, so the old `.eslintrc.cjs` could
not load at all (and eslint-plugin-vue's required peer `vue-eslint-parser` was
never declared).

- Add `vue-eslint-parser` (the unmet peer surfaced by the refresh).
- Replace `.eslintrc.cjs` + `.eslintignore` with `eslint.config.mjs` (flat):
  vue3 essential rules, prettier last, browser+node globals, same custom rules
  and ignore patterns.
- lint script: `eslint --ext .js,.vue ./` -> `eslint .` (`--ext` removed in
  ESLint 9; the vue flat config lints `.vue`).
- Drop two now-stale inline directives (`/* eslint-env node */`,
  `/* eslint-disable */`) that flat config flags.

Verified: `yarn lint` runs clean (0 problems) and `./gradlew build installDist`
succeeds under Node 22.23.1.
@lagergren lagergren merged commit a28bb96 into master Jul 6, 2026
1 check passed
@lagergren lagergren deleted the ci-and-stub-tests branch July 6, 2026 14:20
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