@substrat-run/contract-tests 0.159.0 → 0.161.0
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/dist/attachment-bytes-suite.d.ts +9 -0
- package/dist/attachment-bytes-suite.d.ts.map +1 -0
- package/dist/attachment-bytes-suite.js +97 -0
- package/dist/attachment-bytes-suite.js.map +1 -0
- package/dist/connector-fixture.d.ts +2 -2
- package/dist/connector-fixture.d.ts.map +1 -1
- package/dist/directory-audit-suite.d.ts +23 -0
- package/dist/directory-audit-suite.d.ts.map +1 -0
- package/dist/directory-audit-suite.js +560 -0
- package/dist/directory-audit-suite.js.map +1 -0
- package/dist/directory-restore-suite.d.ts.map +1 -1
- package/dist/directory-restore-suite.js +99 -0
- package/dist/directory-restore-suite.js.map +1 -1
- package/dist/index.d.ts +11 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -1
- package/dist/index.js.map +1 -1
- package/dist/introspection-reads-suite.d.ts +35 -0
- package/dist/introspection-reads-suite.d.ts.map +1 -0
- package/dist/introspection-reads-suite.js +114 -0
- package/dist/introspection-reads-suite.js.map +1 -0
- package/dist/many-migrations-suite.d.ts +9 -0
- package/dist/many-migrations-suite.d.ts.map +1 -0
- package/dist/many-migrations-suite.js +76 -0
- package/dist/many-migrations-suite.js.map +1 -0
- package/dist/many-migrations.d.ts +16 -0
- package/dist/many-migrations.d.ts.map +1 -0
- package/dist/many-migrations.js +50 -0
- package/dist/many-migrations.js.map +1 -0
- package/dist/membership-executor-suite.d.ts.map +1 -1
- package/dist/membership-executor-suite.js +8 -5
- package/dist/membership-executor-suite.js.map +1 -1
- package/dist/modules.d.ts.map +1 -1
- package/dist/modules.js +10 -0
- package/dist/modules.js.map +1 -1
- package/dist/reserved-role-suite.d.ts +6 -0
- package/dist/reserved-role-suite.d.ts.map +1 -1
- package/dist/reserved-role-suite.js +176 -8
- package/dist/reserved-role-suite.js.map +1 -1
- package/dist/restore-role-suite.d.ts +17 -0
- package/dist/restore-role-suite.d.ts.map +1 -0
- package/dist/restore-role-suite.js +107 -0
- package/dist/restore-role-suite.js.map +1 -0
- package/dist/role-state-suite.d.ts +17 -0
- package/dist/role-state-suite.d.ts.map +1 -0
- package/dist/role-state-suite.js +80 -0
- package/dist/role-state-suite.js.map +1 -0
- package/dist/schedule-platform-requests-suite.d.ts +7 -1
- package/dist/schedule-platform-requests-suite.d.ts.map +1 -1
- package/dist/schedule-platform-requests-suite.js +349 -2
- package/dist/schedule-platform-requests-suite.js.map +1 -1
- package/dist/schedule-purge-request-module.d.ts +88 -0
- package/dist/schedule-purge-request-module.d.ts.map +1 -0
- package/dist/schedule-purge-request-module.js +114 -0
- package/dist/schedule-purge-request-module.js.map +1 -0
- package/dist/schedule-purge-two-module.d.ts +141 -0
- package/dist/schedule-purge-two-module.d.ts.map +1 -0
- package/dist/schedule-purge-two-module.js +153 -0
- package/dist/schedule-purge-two-module.js.map +1 -0
- package/dist/scope-host-suite.d.ts.map +1 -1
- package/dist/scope-host-suite.js +1329 -8
- package/dist/scope-host-suite.js.map +1 -1
- package/dist/size-reads-suite.d.ts +20 -0
- package/dist/size-reads-suite.d.ts.map +1 -0
- package/dist/size-reads-suite.js +77 -0
- package/dist/size-reads-suite.js.map +1 -0
- package/dist/stored-vertical-copy-suite.d.ts +15 -0
- package/dist/stored-vertical-copy-suite.d.ts.map +1 -0
- package/dist/stored-vertical-copy-suite.js +68 -0
- package/dist/stored-vertical-copy-suite.js.map +1 -0
- package/dist/unreadable-scope-row-suite.d.ts +16 -0
- package/dist/unreadable-scope-row-suite.d.ts.map +1 -0
- package/dist/unreadable-scope-row-suite.js +152 -0
- package/dist/unreadable-scope-row-suite.js.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ScopeHostFixture } from './scope-host-suite.js';
|
|
2
|
+
/**
|
|
3
|
+
* A scope's attachment bytes (#2501), held to their producer: files go in through the attachment
|
|
4
|
+
* surface a vertical's users upload through, and the bytes come back as the co-located read
|
|
5
|
+
* (`HostAdmin.scopeAttachmentBytes`) and as the storage gauge's `attachments` on `/meters`. What is
|
|
6
|
+
* counted is what the scope's attachment rows record: a removed file stops counting.
|
|
7
|
+
*/
|
|
8
|
+
export declare function attachmentBytesContractSuite(adapterName: string, makeFixture: () => Promise<ScopeHostFixture>): void;
|
|
9
|
+
//# sourceMappingURL=attachment-bytes-suite.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attachment-bytes-suite.d.ts","sourceRoot":"","sources":["../src/attachment-bytes-suite.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAS9D;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAqFpH"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { describe, it, expect, beforeAll, afterAll } from 'vitest';
|
|
2
|
+
import { permissionKey, platformActorId, principalId, scopeId as scopeIdSchema, tenantId, } from '@substrat-run/contracts';
|
|
3
|
+
import { runPlatformSweep, ulid } from '@substrat-run/kernel';
|
|
4
|
+
import { connectorTestFetch } from './connector-fixture.js';
|
|
5
|
+
import { permMod } from './modules.js';
|
|
6
|
+
const PERM_READ = permissionKey.parse('perm:read');
|
|
7
|
+
const PERM_USE = permissionKey.parse('perm:use');
|
|
8
|
+
const item = (id) => ({ entityType: 'item', entityId: id });
|
|
9
|
+
const bytes = (n) => new Uint8Array(n).fill(97);
|
|
10
|
+
/**
|
|
11
|
+
* A scope's attachment bytes (#2501), held to their producer: files go in through the attachment
|
|
12
|
+
* surface a vertical's users upload through, and the bytes come back as the co-located read
|
|
13
|
+
* (`HostAdmin.scopeAttachmentBytes`) and as the storage gauge's `attachments` on `/meters`. What is
|
|
14
|
+
* counted is what the scope's attachment rows record: a removed file stops counting.
|
|
15
|
+
*/
|
|
16
|
+
export function attachmentBytesContractSuite(adapterName, makeFixture) {
|
|
17
|
+
describe(`attachment bytes beside the storage gauge (#2501): ${adapterName}`, () => {
|
|
18
|
+
let fixture;
|
|
19
|
+
let host;
|
|
20
|
+
const t = tenantId.parse(ulid());
|
|
21
|
+
const staff = platformActorId.parse(ulid());
|
|
22
|
+
const editor = principalId.parse(ulid());
|
|
23
|
+
beforeAll(async () => {
|
|
24
|
+
fixture = await makeFixture();
|
|
25
|
+
host = fixture.host;
|
|
26
|
+
host.registerModule(permMod);
|
|
27
|
+
await host.admin.createTenant(staff, { id: t, slug: `att-bytes-${t.toLowerCase()}`, name: 'Attachment bytes' });
|
|
28
|
+
await host.admin.grantEntitlement(staff, t, 'perm');
|
|
29
|
+
await host.provisionBlobStore(staff, { tenantId: t, vertical: 'docs', binding: 'ATTACHMENTS' });
|
|
30
|
+
await host.admin.defineRole(staff, t, { key: 'editor', permissions: [PERM_READ, PERM_USE], source: 'vertical' });
|
|
31
|
+
await host.admin.assignRole(staff, { principalId: editor, roleKey: 'editor', node: { tenantId: t, scopeId: null } });
|
|
32
|
+
});
|
|
33
|
+
afterAll(async () => {
|
|
34
|
+
await fixture.cleanup();
|
|
35
|
+
});
|
|
36
|
+
const newScope = async () => {
|
|
37
|
+
const s = scopeIdSchema.parse(ulid());
|
|
38
|
+
await host.provisionScope(staff, { tenantId: t, scopeId: s, vertical: 'docs' });
|
|
39
|
+
await host.admin.activateScope(staff, t, s);
|
|
40
|
+
return s;
|
|
41
|
+
};
|
|
42
|
+
const upload = async (s, size) => (await host.attachments(editor, t, s)).upload({
|
|
43
|
+
entity: item('i'),
|
|
44
|
+
filename: `f-${size}.txt`,
|
|
45
|
+
contentType: 'text/plain',
|
|
46
|
+
visibility: 'internal',
|
|
47
|
+
body: bytes(size),
|
|
48
|
+
});
|
|
49
|
+
it('reads what the uploaded files sum to, and a removed file stops counting', async () => {
|
|
50
|
+
const s = await newScope();
|
|
51
|
+
expect(await host.admin.scopeAttachmentBytes(staff, t, s)).toBe(0);
|
|
52
|
+
const kept = await upload(s, 5);
|
|
53
|
+
const removed = await upload(s, 11);
|
|
54
|
+
expect([kept.size, removed.size]).toEqual([5, 11]);
|
|
55
|
+
expect(await host.admin.scopeAttachmentBytes(staff, t, s)).toBe(16);
|
|
56
|
+
await (await host.attachments(editor, t, s)).remove(removed.id);
|
|
57
|
+
expect(await host.admin.scopeAttachmentBytes(staff, t, s)).toBe(5);
|
|
58
|
+
// K-24: the read wakes a scope, so it is attributable like the database size.
|
|
59
|
+
const reads = await host.admin.accessLog(staff, { method: 'scopeAttachmentBytes' });
|
|
60
|
+
expect(reads.some((r) => r.scopeId === s && r.tenantId === t)).toBe(true);
|
|
61
|
+
// A scope the directory does not hold under the tenant is refused, not read as 0.
|
|
62
|
+
await expect(host.admin.scopeAttachmentBytes(staff, t, scopeIdSchema.parse(ulid()))).rejects.toThrow();
|
|
63
|
+
});
|
|
64
|
+
it('the storage phase samples them beside the database, and /meters serves them apart from its bytes', async () => {
|
|
65
|
+
const [s1, s2] = [await newScope(), await newScope()];
|
|
66
|
+
await upload(s1, 7);
|
|
67
|
+
await upload(s1, 3);
|
|
68
|
+
await upload(s2, 4);
|
|
69
|
+
const report = await runPlatformSweep(host, {
|
|
70
|
+
actor: staff,
|
|
71
|
+
fetch: connectorTestFetch,
|
|
72
|
+
sweepers: {},
|
|
73
|
+
storageGauge: {
|
|
74
|
+
read: (scope) => host.admin.scopeDatabaseSize(staff, scope.tenantId, scope.id),
|
|
75
|
+
readAttachments: (scope) => host.admin.scopeAttachmentBytes(staff, scope.tenantId, scope.id),
|
|
76
|
+
batch: 10_000,
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
expect(report.errors.filter((e) => e.kind === 'storage')).toEqual([]);
|
|
80
|
+
const storage = (await host.admin.readMeters(staff, { tenantId: t })).perTenant[0].storage;
|
|
81
|
+
// Every scope of the tenant was sampled: these two, and any an earlier case left.
|
|
82
|
+
const scopes = await host.admin.listScopes(staff, { tenantId: t, status: 'active' });
|
|
83
|
+
let expected = 0;
|
|
84
|
+
for (const scope of scopes)
|
|
85
|
+
expected += await host.admin.scopeAttachmentBytes(staff, t, scope.id);
|
|
86
|
+
expect(expected).toBeGreaterThanOrEqual(14);
|
|
87
|
+
expect(storage.attachments).toEqual({ bytes: expected, sampled: scopes.length });
|
|
88
|
+
// `bytes` stays the scope databases, and says attachments are not in it.
|
|
89
|
+
expect(storage.basis).toBe('scope-databases');
|
|
90
|
+
expect(storage.excluded).toContain('attachments');
|
|
91
|
+
expect(storage.bytes).toBeGreaterThan(0);
|
|
92
|
+
// A whole storage pass, and on workerd every read wakes a scope DO: past vitest's 5 s
|
|
93
|
+
// default on a loaded machine, though it finishes in about one.
|
|
94
|
+
}, 30_000);
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=attachment-bytes-suite.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attachment-bytes-suite.js","sourceRoot":"","sources":["../src/attachment-bytes-suite.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AACnE,OAAO,EACL,aAAa,EACb,eAAe,EACf,WAAW,EACX,OAAO,IAAI,aAAa,EACxB,QAAQ,GAIT,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAkB,MAAM,sBAAsB,CAAC;AAE9E,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,SAAS,GAAG,aAAa,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;AACnD,MAAM,QAAQ,GAAG,aAAa,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;AACjD,MAAM,IAAI,GAAG,CAAC,EAAU,EAAa,E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
2
2
|
/**
|
|
3
3
|
* An in-memory provider, so a connector can be exercised end to end without any
|
|
4
4
|
* real API credentials.
|
|
@@ -16,7 +16,7 @@ export interface ConnectorCall {
|
|
|
16
16
|
url: string;
|
|
17
17
|
method: string | undefined;
|
|
18
18
|
auth: string | undefined;
|
|
19
|
-
body:
|
|
19
|
+
body: ConnectorRequestInit['body'];
|
|
20
20
|
}
|
|
21
21
|
export declare const connectorCalls: ConnectorCall[];
|
|
22
22
|
export declare const resetConnectorCalls: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connector-fixture.d.ts","sourceRoot":"","sources":["../src/connector-fixture.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"connector-fixture.d.ts","sourceRoot":"","sources":["../src/connector-fixture.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAE5E;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,IAAI,EAAE,oBAAoB,CAAC,MAAM,CAAC,CAAC;CACpC;AAED,eAAO,MAAM,cAAc,EAAE,aAAa,EAAO,CAAC;AAElD,eAAO,MAAM,mBAAmB,QAAO,IAEtC,CAAC;AAEF,uFAAuF;AACvF,eAAO,MAAM,kBAAkB,EAAE,SAiBhC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type ScopeHost } from '@substrat-run/kernel';
|
|
2
|
+
/**
|
|
3
|
+
* #2479: what a directory audit suite needs of an adapter — its host, and one statement run
|
|
4
|
+
* against the directory its admin log lives in, so a fault is a trigger in the real store.
|
|
5
|
+
*/
|
|
6
|
+
export interface DirectoryAuditFixture {
|
|
7
|
+
host: ScopeHost;
|
|
8
|
+
directorySql(sql: string): Promise<void>;
|
|
9
|
+
/**
|
|
10
|
+
* #2528: arm one statement to run against the directory, committed on its own, immediately
|
|
11
|
+
* before the host's next audited directory write begins its unit — the write another caller
|
|
12
|
+
* makes between whatever the host read first and the write. Runs once.
|
|
13
|
+
*/
|
|
14
|
+
interleave(sql: string): void;
|
|
15
|
+
cleanup(): Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* #2479: every tenant and vertical directory write commits with its admin row. A fault in the
|
|
19
|
+
* audit insert leaves the state as it was and no row; a fault in the state write leaves no row;
|
|
20
|
+
* the retry writes the state and exactly one row, fields as the adapters have always written them.
|
|
21
|
+
*/
|
|
22
|
+
export declare function directoryAdminAuditTransactionSuite(adapterName: string, makeFixture: () => Promise<DirectoryAuditFixture>): void;
|
|
23
|
+
//# sourceMappingURL=directory-audit-suite.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"directory-audit-suite.d.ts","sourceRoot":"","sources":["../src/directory-audit-suite.ts"],"names":[],"mappings":"AAEA,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAG5D;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,SAAS,CAAC;IAChB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC;;;;OAIG;IACH,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1B;AAgRD;;;;GAIG;AACH,wBAAgB,mCAAmC,CAAC,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC,qBAAqB,CAAC,GAAG,IAAI,CAkUhI"}
|