@owlmeans/test-integration 0.1.16-rc.0 → 0.1.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -4
- package/agent-meta/manifest.json +4 -11
- package/agent-meta/skills/testing-integration/SKILL.md +23 -0
- package/build/cleanup.d.ts.map +1 -1
- package/build/gates.js.map +1 -1
- package/build/naming.d.ts.map +1 -1
- package/build/naming.js.map +1 -1
- package/package.json +4 -4
- package/agent-meta/instructions/testing-integration.instructions.md +0 -23
package/README.md
CHANGED
|
@@ -13,10 +13,9 @@ Specs do not call services through these helpers — they consume the per-packag
|
|
|
13
13
|
<!-- owlmeans:agent-guidance:start -->
|
|
14
14
|
## Agent guidance
|
|
15
15
|
|
|
16
|
-
This package ships embedded
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
(`.claude/skills/` and `.github/instructions/`):
|
|
16
|
+
This package ships embedded agent skills under `agent-meta/`. After installing your
|
|
17
|
+
`@owlmeans/*` packages, run the OwlMeans agent-skills installer to place them into
|
|
18
|
+
your project's skill store (`.agents/skills/`):
|
|
20
19
|
|
|
21
20
|
```sh
|
|
22
21
|
npx @owlmeans/agent-skills
|
package/agent-meta/manifest.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"schemaVersion":
|
|
2
|
+
"schemaVersion": 2,
|
|
3
3
|
"package": "@owlmeans/test-integration",
|
|
4
|
-
"version": "0.1.
|
|
5
|
-
"generatedAt": "2026-08-
|
|
4
|
+
"version": "0.1.17",
|
|
5
|
+
"generatedAt": "2026-08-15T13:01:19.931Z",
|
|
6
6
|
"canonicalRepo": "https://github.com/owlmeans/common",
|
|
7
7
|
"entries": [
|
|
8
8
|
{
|
|
@@ -10,14 +10,7 @@
|
|
|
10
10
|
"name": "testing-integration",
|
|
11
11
|
"category": "package-specific",
|
|
12
12
|
"file": "skills/testing-integration/SKILL.md",
|
|
13
|
-
"canonicalPath": ".
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"kind": "instruction",
|
|
17
|
-
"name": "testing-integration",
|
|
18
|
-
"category": "package-specific",
|
|
19
|
-
"file": "instructions/testing-integration.instructions.md",
|
|
20
|
-
"canonicalPath": ".github/instructions/testing-integration.instructions.md"
|
|
13
|
+
"canonicalPath": ".agents/skills/testing-integration/SKILL.md"
|
|
21
14
|
}
|
|
22
15
|
]
|
|
23
16
|
}
|
|
@@ -43,6 +43,29 @@ reads — the value must never reach a log, a report, or a committed file:
|
|
|
43
43
|
POSTGRES_URL="$(<build it from the secret file, without echoing>)" bun test ./tests
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
+
### Where the real credentials come from
|
|
47
|
+
|
|
48
|
+
The dev-cluster secrets are the source of truth; `../viable/.env.dev.secrets` holds the same
|
|
49
|
+
values under kebab-case keys (`mongo-secret`, `redis-secret`, `s3-storage`, …) for
|
|
50
|
+
`kubectl create secret --from-env-file`. Read the cluster secret directly rather than transcribing:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
kubectl get secret mongo-owlmeans-mongo-main-db-admin-admin -o jsonpath='{.data.password}' | base64 -d
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Two things that will bite:
|
|
57
|
+
|
|
58
|
+
- **URL-escape the password before putting it in a connection string.** These generated passwords
|
|
59
|
+
contain reserved characters; an unescaped one fails with `MongoParseError: Password contains
|
|
60
|
+
unescaped characters`. Escape with `urllib.parse.quote(pw, safe='')`.
|
|
61
|
+
- **The port-forward may already be running** — the slots share one cluster, so
|
|
62
|
+
`bind: address already in use` on 27017/5432/6379 usually means another checkout forwards the
|
|
63
|
+
same service. Reuse it; never kill another environment's process.
|
|
64
|
+
|
|
65
|
+
The suites namespace every database/schema (`MONGO_TEST_DB_PREFIX`, default `omt`) and drop it on
|
|
66
|
+
completion, so they are safe against the shared cluster. Confirm nothing was left behind after a
|
|
67
|
+
run that aborted mid-way.
|
|
68
|
+
|
|
46
69
|
## Where the specs live
|
|
47
70
|
|
|
48
71
|
A resource package (`*-resource`) owns the `Resource<T>` contract; the db package
|
package/build/cleanup.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cleanup.d.ts","sourceRoot":"","sources":["../src/cleanup.ts"],"names":[],"mappings":"AAAA,KAAK,SAAS,GAAG,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;AAI3C;;;;;GAKG;AACH,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"cleanup.d.ts","sourceRoot":"","sources":["../src/cleanup.ts"],"names":[],"mappings":"AAAA,KAAK,SAAS,GAAG,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;AAI3C;;;;;GAKG;AACH,eAAO,MAAM,eAAe,OAAQ,SAAS,KAAG,IAE/C,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,WAAW,QAAa,OAAO,CAAC,IAAI,CAUhD,CAAA"}
|
package/build/gates.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gates.js","sourceRoot":"","sources":["../src/gates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAQnD,MAAM,OAAO,GAAG,CAAI,IAA0B,EAAc,EAAE;IAC5D,MAAM,GAAG,GAA2B,EAAE,CAAA;IACtC,KAAK,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC;QACrB,IAAI,MAAM,CAAC,CAAC,CAAC;YAAE,GAAG,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAW,CAAA;IAClD,CAAC;IACD,OAAO,GAAiB,CAAA;AAC1B,CAAC,CAAA;AAED,MAAM,iBAAiB,GAAG,CACxB,QAA8B,EAC9B,
|
|
1
|
+
{"version":3,"file":"gates.js","sourceRoot":"","sources":["../src/gates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EA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B,EAAE,CACrD,iBAAiB,CAAU,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC,CAAA;AAO7D,MAAM,CAAC,MAAM,YAAY,GAAG,GAAiC,EAAE,CAC7D,iBAAiB,CAAc,CAAC,cAAc,CAAC,EAAE,CAAC,yBAAyB,CAAC,CAAC,CAAA"}
|
package/build/naming.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"naming.d.ts","sourceRoot":"","sources":["../src/naming.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"naming.d.ts","sourceRoot":"","sources":["../src/naming.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,eAAO,MAAM,eAAe,WAAY,MAAM,WAAU,MAAM,KAAO,MAKpE,CAAA"}
|
package/build/naming.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"naming.js","sourceRoot":"","sources":["../src/naming.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAEzC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,MAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"naming.js","sourceRoot":"","sources":["../src/naming.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAEzC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,MAAc,EAAE,MAAM,GAAW,CAAC,EAAU,EAAE;IAC5E,MAAM,MAAM,GAAG,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;SAC3D,QAAQ,CAAC,KAAK,CAAC;SACf,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAA;IACnB,OAAO,GAAG,MAAM,IAAI,MAAM,EAAE,CAAA;AAC9B,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@owlmeans/test-integration",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.17",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@owlmeans/test": "^0.1.
|
|
24
|
+
"@owlmeans/test": "^0.1.17"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@owlmeans/dep-config": "^0.1.
|
|
27
|
+
"@owlmeans/dep-config": "^0.1.17",
|
|
28
28
|
"@types/bun": "^1.3.14",
|
|
29
29
|
"nodemon": "^3.1.14",
|
|
30
|
-
"typescript": "^
|
|
30
|
+
"typescript": "^7.0.2"
|
|
31
31
|
},
|
|
32
32
|
"publishConfig": {
|
|
33
33
|
"access": "public"
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
applyTo: "**/*.test.ts, **/*.spec.ts, **/*.ts"
|
|
3
|
-
---
|
|
4
|
-
<!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
|
|
5
|
-
|
|
6
|
-
# Category C — Integration Tests (env-gated)
|
|
7
|
-
|
|
8
|
-
- Tests in `<your-package>/tests/*.spec.ts`. Use `bun:test`.
|
|
9
|
-
- No mocks. Connect to real PostgreSQL / MongoDB / Redis / S3 / Kubernetes via the env values supplied by `<root>/.env`.
|
|
10
|
-
- Open the gate at the top of `tests/context.ts` via `postgresGate()` / `mongoGate()` / `redisGate()` / `s3Gate()` / `kubeGate()`. If `gate.skip`, do **not** register that service in the test context, and have specs self-skip with `gate.reason`.
|
|
11
|
-
- **Never print a credential.** Pipe it straight into the env var the gate reads.
|
|
12
|
-
- Unit specs (schema compilation, identifiers, error translation) go in the `*-resource` package; specs that build a real `ServerContext` go in the db package that depends on it — the reverse is a devDependency cycle.
|
|
13
|
-
- **One namespace per spec file.** Export a `makeSuite(label)` from `tests/context.ts` that owns a `randomNamespace(`${prefix}_${label}`)` schema/database and its own `teardown()`, called from that file's `afterAll`. The process-global `registerCleanup`/`runCleanups()` queue is only safe in a package with a single spec file: Bun runs every spec file of a package in one process, so the first `afterAll` would drop the namespaces of the files still to come.
|
|
14
|
-
- Capture connections in a `finally`, so a spec asserting a *failed* boot does not leak the pool it opened. Close them *after* the namespace drop.
|
|
15
|
-
- Capability probes go at module scope as a top-level `await` — Bun decides `test` vs `test.skip` synchronously — and default to "not capable" on any error.
|
|
16
|
-
- Never reset module-scope declarations (migration registries, table declarations) inside a shared `boot()` helper; a spec that wants a clean slate calls `resetDeclarations(alias)` itself. Keep migration bodies at module scope so their checksums are stable.
|
|
17
|
-
- `expect(fn).not.toThrow()` treats a **returned** `Error` as thrown — assert the returned value instead.
|
|
18
|
-
- `<root>/.env.example` is the authoritative documentation of every variable. Add a new key there with a comment when you introduce a new gate.
|
|
19
|
-
- Per-package `package.json` script: `"test": "bun test ./tests"`; add `"./tests/**/*"` to `tsconfig.json` `exclude` and `@owlmeans/test-integration` + `@types/bun` to devDependencies. Long round-trips: bump timeout in a per-package `bunfig.toml`.
|
|
20
|
-
- Cover `.claude/skills/<pkg>/SKILL.md` and `README.md` cases first.
|
|
21
|
-
- Max 3-4 tests per method/function.
|
|
22
|
-
|
|
23
|
-
See `.claude/skills/testing-integration/SKILL.md` for the full pattern.
|