Expand GitLab CI with functional test jobs from reference matrix #421
Labels
No labels
agent:fix_bugfix
agent:fix_conflicts
agent:fix_security
agent:gap_analysis
agent:implement
agent:implement
agent:implement
agent:open_issues
agent:ready
agent:research
agent:security_audit
agent:verify
architecture
backend
blocker:hybrid
blocker:launch
blocker:limit-orders
blocker:v2
block:log_only
block:security
bug
ci
contracts
correctness
deploy
dev
devops
docs
documentation
duplicate
e2e
enhancement
epic
feature
frontend
functional-completion
gas
good first issue
governance
help wanted
high-risk
hooks
hybrid
indexer
infra
infrastructure
integrators
invalid
launch-blocker
limit-orders
localnet
localterra
low priority
missing-implementation
needs-design
ops
performance
priority
high
priority
medium
product
qa
QA
question
ready
ready
research
scripts
security
security-hardening
smartcontracts
tech-debt
testing
ux
UX
v2
verification
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
code/cl8y-dex-terraclassic#421
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent
#411 — Updated Gap Analysis (recommendation 14)
Current codebase
.gitlab-ci.ymlruns security + build only:gitleaks,cargo-audit-smartcontracts,cargo-audit-indexerNo contract unit tests, frontend Vitest, indexer integration, or Playwright E2E on merge.
Reference matrix:
.github/workflows/test.yml(local automation per #234).docs/testing.md§ CI documents Make targets.docs/qa-invariants.mdstill states "no hosted CI" — this issue expands GitLab CI toward the reference matrix.Why needed
Gap analysis flagged Critical: "GitLab CI green ≠ functional test pass." Retail launch (#411) needs merge gates on functional regressions (cosmes patch, hybrid sim, slippage #293).
Constraints / guardrails
cargo test --lib); E2E may stay manual/scheduled (DinD + LocalTerra is heavy).scripts/ci/patterns; pin images like existingGITLEAKS_IMAGE.rules: changes:to avoid running full matrix on docs-only MRs.docs/testing.md§ CI anddocs/qa-invariants.mdwhen jobs land.Relevant files
.gitlab-ci.yml.github/workflows/test.yml(reference).github/workflows/README.mdMakefile(test-contracts,test-frontend,test-indexer-integration)scripts/ci/docs/testing.md§ CIdocs/qa-invariants.mdRecommended direction
Phase 1 (this issue):
test-contractsjob —make test-contractson MR + default branch.test-frontendjob — Node from.nvmrc,npm ci,make test-frontend.test-indexer-libjob —cd indexer && cargo test --lib.Phase 2 (follow-up or stretch):
test-indexer-integrationwith Postgres service.Acceptance criteria
.gitlab-ci.ymlincludes at least contracts + frontend + indexer lib test jobs.merge_request_eventand default branch (with sensiblerules: changes:).allow_failure).docs/testing.md§ CI lists new GitLab jobs alongside Make equivalents.Test plan
main.cosmesPatch127.test.tsin draft MR — pipeline must fail.Attack / abuse test plan
VITE_DEV_MNEMONICin frontend build job (existing vite guard #118).Verification criteria
mainshows functional test jobs green after #411 child-9 test fixes land.test.ymljobs → GitLab jobs.mentioned in issue #411
mentioned in merge request !951
mentioned in merge request !953
Took the Phase-1 slice of this — wired the reference functional matrix into GitLab CI so a red functional test blocks merge instead of "GitLab green != functional pass." MR !953.
New
teststage (MR + default branch, change-gated, no allow_failure):test-contracts(cargo test)test-indexer-lib(cargo test --lib)test-frontend(lint + vitest)test-frontend-build(npm run build= tsc -b + vite) — the gate that actually matters here. The pipeline never ran a coldtsc -b, which is why type-only breaks kept reaching main (#246 + four more across the #337 thread, the latest thespendableRawbigint/string one this week). lint + vitest don't catch those; the build does. It also re-asserts #117 (no prod sourcemaps) for free.Phase 2 (Postgres-backed indexer integration + Playwright E2E) is heavier — service containers / DinD — so I left it for a follow-up, noted in the MR.
Docs updated (testing.md § CI, qa-invariants.md). The "break a draft MR and watch it fail" check from the test plan is just the first pipeline run. One thing that run validates:
test-frontend's vitest includes the knownterraExplorerlocalhost/127.0.0.1 artifact — green in CI historically, but if it surfaces red in the runner it needs an env-pin (known quantity, not a new break).@PlasticDigits this is the CI gap I've flagged a few times (the tsc-only breaks slipping to main); !953 closes it for the fast gates. Your merge.
mentioned in commit
5ce57c415ePhase-2a: shipped the Postgres-backed indexer-integration job (the Phase-1 follow-up from !953).
Dry-ran the suite on origin/main (
2a06048b) first —cargo test --tests -j1 -- --test-threads=1= 542 passed / 0 failed across the full indexer/tests/ suite (incl api_limit_lower_bound 16, limit_clamp_guardrail 1, security 35, api_route_solve 24 + api_route_solve_db_hybrid 4). Gate is green on the current tree.Then wired it in as test-indexer-integration:
make test-indexer-integrationci/lint on the merged config: valid, 0 errors / 0 warnings.
MR coming from my fork branch qa/421-ci-indexer-integration-phase2 (commit
e64fc7d1). Cross-fork, so the target-side pipeline shows red / 0-jobs as usual — not a defect.That leaves the last Phase-2 row — the scheduled DinD-LocalTerra Playwright E2E (heavier: browsers + a live chain). I'll scope that one separately; keep #421 open for it.
mentioned in merge request !971
mentioned in commit
15b77176c6Phase-2a landed (
15b77176), so the functionalteststage is now fully wired on main — test-contracts, test-indexer-lib, test-indexer-integration, test-frontend, test-frontend-build, all change-gated, none allow_failure.Heads up though: none of these have actually run green on main yet, and it's not the jobs' fault. The
securitystage sits ahead oftest, and it's red on every recent main pipeline, so the wholeteststage gets skipped before it can run. On the last completed main run (pipeline 2639532100, sha4757f1a2):Same shape going back ~12 pipelines. So the #421 verification criterion — "functional test jobs show green on hosted main" — can't be observed while the security stage is failing. The functional jobs themselves are fine: the integration suite dry-ran 542/0 locally and ci/lint is clean; this is purely that nothing downstream of a red security stage ever executes.
The failures are the advisory/scan gates from #380, not anything in the #421 jobs:
cargo audit --deny warnings(both crates) andnpm audit --audit-level=highare tripping on RUSTSEC/npm advisories, and gitleaks is failing its tracked-file scan. That's really a separate breakage from this issue, but right now it masks the entire point of #421 on the default branch — a red functional gate can never block a merge if the gate never runs.Suggest triaging the security-stage failures on their own (likely their own issue) — pin/patch or risk-accept the advisories, and chase whatever gitleaks is catching. Once security goes green I'll confirm the
teststage actually runs green on main and we can settle the non-E2E half of this. The scheduled DinD/LocalTerra Playwright E2E row is still the remaining open deliverable I'm keeping #421 open for.@PlasticDigits
mentioned in merge request !980
Came back to the security-stage-red blocker I flagged before (note 3507509424). Two things going on, one I fixed and one that's on you.
The script failures — fixed, MR !980. The
teststage never runs because the security stage exits non-zero first, and three real failures were stacking up there:terra1ustcquote293fixture inindexer/tests/common/mod.rs:384as a leaked api-key. Widened the existingterra1secret-allowlist bound in.gitleaks.tomlfrom{38,}to{10,}so short test addresses are covered. Re-ran the tracked-tree scan, no leaks.anyhow1.0.102 hit RUSTSEC-2026-0190 (downcast_mut unsoundness, published 06-25). Bumped to 1.0.103, lockfile only, indexer lib still 158/0.ws<=7.5.10 (high-sev DoS) + undici + esbuild.npm audit fix, lockfile only, package.json untouched. The cosmjs/uuid moderate chain stays as the accepted risk in supply-chain-security.md (below the high gate).All three verified locally: gitleaks clean,
cargo audit --deny warningsexit 0,npm audit --audit-level=high --omit=devexit 0,tsc -bclean.The bigger blocker — needs you @PlasticDigits. Independent of the above, every main pipeline since ~14:50 is failing with
failure_reason=ci_quota_exceededon every job — the shared-runner CI minutes are exhausted. So even with !980 merged, nothing will run green until the runner minutes get topped up or a self-hosted runner gets wired in. The functional gates from this issue can't demonstrate green on main until that's resolved.mentioned in commit
c1c5b9cf33We are not using gitlab ci at this time due to cost
Got it @PlasticDigits — parking this, no GitLab CI for now on cost.
The functional coverage this issue was after still lives in the Make targets, so nothing regresses: make test-contracts (456/0), make test-frontend (vitest), cd indexer && cargo test --lib (167/0) plus the integration suite (561/0 serial). If hosted CI ever comes back on the table, the Phase-1 jobs and the test-indexer-integration job I drafted are ready to wire in.