docs: test-first workflow, coverage ratchet, definition of done; real gitlab-cicd test jobs - #154
Open
rubiagatra wants to merge 1 commit into
Open
docs: test-first workflow, coverage ratchet, definition of done; real gitlab-cicd test jobs#154rubiagatra wants to merge 1 commit into
rubiagatra wants to merge 1 commit into
Conversation
… gitlab-cicd test jobs docsite/content/moonrepo-testing.md was a list of build/start commands. It now documents how generated projects are tested: - the red → green → refactor loop and what "failing for the right reason" means - which test to write first, per layer, for go-modular (domain, service, repository, handler, fx wiring, webhook receiver, third-party client, migration, whole app) and for react-app (logic, component, route via renderAt, API call, e2e journey, shared-ui) - fixtures are recorded, never invented; seeders are the only realistic data source - coverage: honest denominator, floors ship at 0, ratchet rule (floor = measured - 5, only ever raised, history recorded next to the value) - a generic definition-of-done checklist - CI: reproduce a clean checkout locally (MOON_CACHE=off, git clean -fdX) before pushing task/CI changes, and why (inferred tasks without outputs, generated inputs) - the old smoke-test commands, kept under "Template smoke tests" contribution-guidelines.md §6 Tests links to it and carries the clean-checkout advice. templates/gitlab-cicd/test/all.yml replaces the `echo "Running test..."` stub with the jobs a project actually needs: lint-typecheck-build (affected projects only, unless a workspace-level file changed; fails if lint --fix produced a diff), test-api (dind for testcontainers, gate's "overall" line as job coverage, JUnit + coverage artifacts) and a .test-frontend job template with one example SPA job. CHANGEME_* placeholders mark the project ids, matching the template's existing convention. templates/gitlab-cicd/.gitlab/merge_request_templates/Default.md: the definition-of-done checklist as an MR template. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
4 tasks
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.
Description 📋
docsite/content/moonrepo-testing.mdWas a list of
build/startcommands. Now documents how generated projects are tested:go-modular(domain, service, repository, handler, fx wiring, webhook receiver, third-party client, migration, whole app) and one forreact-app(logic, component, route viarenderAt, API call, e2e journey,shared-ui). Generalised from a downstream project; no project-specific rows.MOON_CACHE=off,git clean -fdX) and why: inferred tasks have no declared outputs, and generated inputs must be produced by a dependency. This is the lesson from a day lost downstream.contribution-guidelines.md§6The Tests bullet links to the page and carries the clean-checkout advice.
templates/gitlab-cicd/test/all.ymlReplaces the
echo "Running test..."stub with jobs mirroring the local gates so CI andmoon run …agree:lint-typecheck-build— affected projects only (--affected --downstream deep), or everything if a workspace-level file changed; fails iflint --fixproduced a diff.test-api— Docker-in-Docker for testcontainers (ryuk disabled, host override),moon run <api>:coverage, the gate'soverallline as the job coverage regex, JUnit + coverage artifacts..test-frontendjob template + one example SPA job —moon run <spa>:test-coverage,Linesregex, JUnit fromtests-results/junit.xml..setupand.rules:merge-requestanchors;CHANGEME_API_APP/CHANGEME_WEB_APPplaceholders follow the template'sCHANGEME_*convention.templates/gitlab-cicd/.gitlab/merge_request_templates/Default.mdThe definition-of-done checklist as an MR template (generic: persistence / queue / integration / third-party contract sections).
Noticed, not changed
templates/gitlab-cicd/.gitlab-ci.ymlincludes/deploy/pipelines/test/test.yml, but the file istest/all.ymland the template's destination isinfra/[package_name](the other includes use/infra/...). Looks like pre-existing drift — happy to fix in this PR if you confirm the intended paths.Type of change 🤔
Submission checklist ✅
🤖 Generated with Claude Code