Add the QA foundation: test pyramid, test-case catalog, CI#2
Open
dnk8n wants to merge 1 commit into
Open
Conversation
Test suites (no application code touched; all verified green locally): - tests/db: pgTAP, 87 assertions across schema/role invariants, constraints and triggers, auth.* functions, RLS per persona (SET ROLE), and pm/lead grant-revoke automation. Each file is a transaction that rolls back; pgTAP is apt-installed into the running container at test time so the production image stays untouched. - tests/api: Vitest + jose, 40 tests driving PostgREST with per-persona HS256 debug JWTs: auth, employees, projects, teams, reference data, time tracking, FAQs, plots, and the ra-data-postgrest query contract. - tests/e2e: Playwright, 8 specs: debug login/logout, unknown-user rejection, the AoW->activity->project->log-time journey through the cascading selects, dashboard render. Test cases and policy: - docs/test-cases.md: natural-language catalog; every automated test cites a TC-id, enforced by tests/check-test-case-ids.sh in CI - docs/testing.md: strategy, how to run, design self-review, and the defects pinned by expected-fail tests Three genuine bugs were found and are committed as expected failures (pgTAP todo / vitest test.fails), per policy - not fixed: - TC-RLS-012/TC-PROJ-105: select_projects_policy lacks FOR SELECT, so any project member can update the project - TC-EMP-106: employees cannot self-update their profile (only power has INSERT on auth.users, which employees_upsert requires) - TC-SEC-001: aoe_teams_grant_or_revoke_privs is executable by basic CI (.github/workflows/ci.yml): lint job (UI type-check/eslint/prettier in check mode, pre-commit, TC-id check) and stack-tests job (boots the real compose stack, runs pgTAP -> API -> E2E, uploads traces and compose logs on failure). Make targets: test, test-db, test-api, test-e2e. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Test suites (no application code touched; all verified green locally):
Test cases and policy:
Three genuine bugs were found and are committed as expected failures (pgTAP todo / vitest test.fails), per policy - not fixed:
CI (.github/workflows/ci.yml): lint job (UI type-check/eslint/prettier in check mode, pre-commit, TC-id check) and stack-tests job (boots the real compose stack, runs pgTAP -> API -> E2E, uploads traces and compose logs on failure). Make targets: test, test-db, test-api, test-e2e.