testing
Technical notes on web development, DevOps, and AI integration.
83 articles
- 18:56testing
The Two-Layer QA Report: Append-Only Sessions, Living Modules
Why end-of-day reconstructed QA reports fail, and how the two-layer format with machine-artifact-only numbers makes test evidence traceable.
TL;DR: A new testing rule fixes untraceable findings by requiring an append-only session report filled in live, with unique scenario IDs, machine evidence, and a test-data ledger. A living module file tracks contract changes in every commit. First session proved it: 31 scenarios, 27 PASS, all counts matched 13 database queries.
#qa#testing#dokumentasi - 18:56security
The ZAP Baseline: Zero Failures Is Not the Number That Matters
A passive ZAP baseline before a QA backfill wave: zero FAIL, four WARN, and a rule-level delta table proving the new OAuth surface added no alerts.
TL;DR: The ZAP baseline rerun after adding Google OAuth came back clean: zero FAIL, four WARN, 57 PASS. More convincing, every rule-level count versus the prior baseline dropped or stayed flat, verified from the JSON artifact. Since the scan was passive and unauthenticated, these results cover only public pages; admin and API surfaces need their own session.
#zap#security-testing#owasp - 17:57testing
Why My Login Assertion Never Failed
A URL assertion in the admin login fixture looked safe and could never fail: the route is identical before and after login. Swap it for a post-login marker.
TL;DR: The login helper asserted the URL was /admincms, but that route shows both before and after login so the check always passed. Playwright's auto-retry couldn't save it since the condition was true from the start. Replacing it with a check for the admin-user-chip, visible only after a valid session, lets the test correctly fail on bad credentials.
#playwright#e2e#testing - 17:45testing
Baseline QA Before Fixes: Red Doesn't Mean Broken Code
The first QA baseline came back all red: a stale database volume and a healthcheck calling a missing wget, not a broken codebase.
TL;DR: Initial integration failures came from environment drift, not broken code, with a stale database volume and a missing wget in the healthcheck. Cleaning volumes with docker compose down -v fixed the setup and let all 28 API packages pass. Coverage gaps and E2E failures were recorded without patching to keep the baseline trustworthy for prioritized follow-ups.
#testing#golang#docker - 16:46testing
Fixture First: Writing the Login Helper Before Any Spec
One login helper and one evidence helper written before the first spec that needs them, and why getByLabel needs exact: true on this admin form.
TL;DR: Task 0 required building reusable Playwright helpers before any specs, enforcing short behavior-focused tests. loginAsAdmin uses real user-facing selectors like getByLabel with exact true and getByRole instead of test ids to avoid mismatches. A simple screenshot helper centralizes evidence and the team deferred faster storageState auth to keep tests isolated for now.
#playwright#e2e#testing - 16:01testing
The QA Spec Was Done by 9 a.m., Then the Owner Said: Too Narrow
The QA backfill spec was pushed at 9 a.m. and widened by the owner minutes later: lock current behavior, measure a baseline, retest one full vertical slice.
TL;DR: Initial plan focused only on validator unit tests, but coverage alone doesn't prove correctness and misses cross-field validation. Owner shifted scope to measure baseline first, then retest one full vertical slice from database to UI with contract checks. Findings now go to an owner decision list instead of silent fixes, keeping characterization tests honest.
#testing#go#openapi - 17:59database
Database Validation That Does Not Punish Value Evolution
Three enum-like columns were guarded by the app alone. CHECK constraints move the guarantee into the database, and value evolution gets cheap.
TL;DR: DemandScope's Migration 0004 adds CHECK constraints to three enum-like columns that were only validated in the app. Database-level guards block rogue writes that bypass Pydantic, while avoiding native ENUMs that make evolving values painful. Small tables validate instantly, but the team documented a NOT VALID plus VALIDATE pattern to avoid locking once tables grow.
#postgresql#database#testing - 23:48frontend
Tests That Lock Design Intent, Not Screenshots
Design intent does not survive on documentation alone. A 129-line unit test pins the house classes, so drift breaks the build, not the quarterly audit.
TL;DR: When a fresh restyle kept slipping back to old borders and colors, thicker documentation didn’t stop the drift. So the team shipped a 129-line test that renders components to static markup and checks exact Tailwind classes. It now catches silent design changes in CI and enforces token-only styles before shipping.
#testing#vitest#tailwind - 22:54testing
The Git Glob Blind Spot in a Token Build Gate
git's ** pathspec skips files directly under src/; a four-command throwaway repo exposed the blind spot in a token build gate before anyone exploited it.
TL;DR: While testing a build gate that blocks hardcoded hex colors, I assumed src/**/*.tsx would catch files directly in src. A quick git ls-files experiment proved the pattern misses direct children, leaving a silent loophole. I fixed it by combining shallow and recursive globs and added tests to ensure coverage at any depth.
#git#glob#build-gate