Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 337c0e2733 | |||
| 423d4bf72d | |||
| a9bac033fd | |||
| 5fab813215 | |||
| 84d923a707 | |||
| 944a4e161f | |||
| 17d261fa94 | |||
| e5fe005986 | |||
| 97da5f332e | |||
| 5390131a6a | |||
| 8cce9c4d35 | |||
| f80f781b23 | |||
| a5bd9c915c |
+7
-9
@@ -1,7 +1,10 @@
|
|||||||
FROM node:22-alpine AS base
|
FROM node:22-alpine AS base
|
||||||
RUN corepack enable && corepack install -g pnpm@9.15.4
|
# Install pnpm as a real binary via npm (not corepack shim) so runtime
|
||||||
ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0
|
# invocations of `pnpm` work without DNS access to registry.npmjs.org.
|
||||||
ENV COREPACK_ENABLE_STRICT=0
|
# The corepack shim delegates to corepack, which re-validates against
|
||||||
|
# npmjs.org on first use — that fails in air-gapped UAT seed/migrate/reset
|
||||||
|
# Jobs. GRO-1983 / GRO-1889 / GRO-1909.
|
||||||
|
RUN npm install -g pnpm@9.15.4
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Install deps
|
# Install deps
|
||||||
@@ -22,9 +25,7 @@ RUN pnpm --filter @groombook/types build && \
|
|||||||
|
|
||||||
# Runtime
|
# Runtime
|
||||||
FROM node:22-alpine AS runner
|
FROM node:22-alpine AS runner
|
||||||
RUN corepack enable && corepack install -g pnpm@9.15.4
|
RUN npm install -g pnpm@9.15.4
|
||||||
ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0
|
|
||||||
ENV COREPACK_ENABLE_STRICT=0
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
|
|
||||||
@@ -53,7 +54,4 @@ CMD ["pnpm", "--filter", "@groombook/db", "seed"]
|
|||||||
|
|
||||||
# Reset stage — drops all tables, re-runs migrations, and re-seeds
|
# Reset stage — drops all tables, re-runs migrations, and re-seeds
|
||||||
FROM builder AS reset
|
FROM builder AS reset
|
||||||
RUN corepack enable && corepack install -g pnpm@9.15.4
|
|
||||||
ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0
|
|
||||||
ENV COREPACK_ENABLE_STRICT=0
|
|
||||||
CMD ["pnpm", "--filter", "@groombook/db", "reset"]
|
CMD ["pnpm", "--filter", "@groombook/db", "reset"]
|
||||||
|
|||||||
@@ -19,6 +19,27 @@ GroomBook API is a Hono-based REST service (TypeScript/Node.js) powering the pet
|
|||||||
- OIDC authentication provider configured
|
- OIDC authentication provider configured
|
||||||
- Seed data present (clients, pets, services, staff)
|
- Seed data present (clients, pets, services, staff)
|
||||||
|
|
||||||
|
### Source of truth for UAT passwords (GRO-2000)
|
||||||
|
|
||||||
|
The `UAT_SUPER_PASSWORD` / `UAT_GROOMER_PASSWORD` / `UAT_TESTER_PASSWORD` / `UAT_CUSTOMER_PASSWORD` env vars the test orchestrator uses **must** be pulled from the live `seed-uat-passwords` Secret in the UAT cluster — never from a captured shell value, a previous run's `.env`, or a copy of the SealedSecret committed before the latest rotation.
|
||||||
|
|
||||||
|
**Canonical recipe** (works from any host with `kubectl` + cluster credentials):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
SUPER=$(kubectl get secret seed-uat-passwords -n groombook-uat \
|
||||||
|
-o jsonpath='{.data.super-password}' | base64 -d)
|
||||||
|
GROOMER=$(kubectl get secret seed-uat-passwords -n groombook-uat \
|
||||||
|
-o jsonpath='{.data.groomer-password}' | base64 -d)
|
||||||
|
TESTER=$(kubectl get secret seed-uat-passwords -n groombook-uat \
|
||||||
|
-o jsonpath='{.data.tester-password}' | base64 -d)
|
||||||
|
CUSTOMER=$(kubectl get secret seed-uat-passwords -n groombook-uat \
|
||||||
|
-o jsonpath='{.data.customer-password}' | base64 -d)
|
||||||
|
```
|
||||||
|
|
||||||
|
**Why:** the Bitnami SealedSecret `apps/overlays/uat/ss-seed-uat-passwords.yaml` (in `groombook/infra`) is the single source of truth. The UAT `reset-demo-data` CronJob re-hashes these values into the `account` table on every run (idempotent — GRO-1977). A captured env var from a previous generation will not match the current hash, producing 401 `INVALID_EMAIL_OR_PASSWORD`. If the live login still 401s after pulling from the SealedSecret, the seed Job is stale — trigger `kubectl create job --from=cronjob/reset-demo-data -n groombook-uat manual-seed-$$` and retry.
|
||||||
|
|
||||||
|
**How to apply:** at the start of every UAT run that touches TC-API-1.4 / 1.5 / 1.6 / 1.7 / 3.18 / 3.21 / 3.23, refresh these four env vars from the cluster before issuing the sign-in request.
|
||||||
|
|
||||||
## Test Cases
|
## Test Cases
|
||||||
|
|
||||||
### 4.0 Health Check
|
### 4.0 Health Check
|
||||||
@@ -119,6 +140,7 @@ GroomBook API is a Hono-based REST service (TypeScript/Node.js) powering the pet
|
|||||||
| TC-API-3.25 | Verify 30+ total pets in UAT DB | GET /api/pets then count total | 30+ pets returned (UAT seed creates 500 random-pool + 5 UAT test clients + 2 UAT customer = 507 total) |
|
| TC-API-3.25 | Verify 30+ total pets in UAT DB | GET /api/pets then count total | 30+ pets returned (UAT seed creates 500 random-pool + 5 UAT test clients + 2 UAT customer = 507 total) |
|
||||||
| TC-API-3.26 | Verify 25-35% medicalAlerts distribution | GET /api/pets (first 30 pets), count how many have non-empty medicalAlerts | Ratio is 25-35% (seed uses rand() < 0.3 for ~30% distribution) |
|
| TC-API-3.26 | Verify 25-35% medicalAlerts distribution | GET /api/pets (first 30 pets), count how many have non-empty medicalAlerts | Ratio is 25-35% (seed uses rand() < 0.3 for ~30% distribution) |
|
||||||
| TC-API-3.27 | Verify coat_type enum has all seed values | After UAT seed completes, inspect the coat_type enum on the UAT DB — it must contain: short, medium, long, double, wire, silky, curly, hairless | UAT seed jobs (`reset-demo-data`, `seed-test-data`) complete 1/1 with no `enum_in` error; coat_type includes all 8 values used by seed.ts `coatTypePool` |
|
| TC-API-3.27 | Verify coat_type enum has all seed values | After UAT seed completes, inspect the coat_type enum on the UAT DB — it must contain: short, medium, long, double, wire, silky, curly, hairless | UAT seed jobs (`reset-demo-data`, `seed-test-data`) complete 1/1 with no `enum_in` error; coat_type includes all 8 values used by seed.ts `coatTypePool` |
|
||||||
|
| TC-API-3.28 | Verify pet_size_category enum has all seed values | After UAT seed completes, inspect the pet_size_category enum on the UAT DB — it must contain: small, medium, large, extra_large | UAT seed jobs (`reset-demo-data`, `seed-test-data`) complete 1/1 with no `enum_in` error; pet_size_category includes all 4 values used by seed.ts `petSizeCategoryPool` (regression for GRO-1999, mirrors TC-API-3.27) |
|
||||||
|
|
||||||
### 4.4 Appointment Scheduling
|
### 4.4 Appointment Scheduling
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
-- GRO-1999: 0037 was skipped on existing DBs due to a below-high-water-mark
|
||||||
|
-- journal timestamp. Re-register extra_large with a monotonic timestamp so
|
||||||
|
-- the existing UAT/persistent DBs apply it. Idempotent.
|
||||||
|
ALTER TYPE "pet_size_category" ADD VALUE IF NOT EXISTS 'extra_large';
|
||||||
@@ -260,6 +260,13 @@
|
|||||||
"when": 1751500000000,
|
"when": 1751500000000,
|
||||||
"tag": "0037_add_extra_large_to_pet_size_category",
|
"tag": "0037_add_extra_large_to_pet_size_category",
|
||||||
"breakpoints": true
|
"breakpoints": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idx": 38,
|
||||||
|
"version": "7",
|
||||||
|
"when": 1780000000000,
|
||||||
|
"tag": "0038_register_extra_large_pet_size_category",
|
||||||
|
"breakpoints": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user