@creative-introvert/tons-of-tests 0.9.1 → 1.1.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.
Files changed (142) hide show
  1. package/README.md +113 -13
  2. package/dist/cjs/Classify.js +33 -2
  3. package/dist/cjs/Classify.js.map +1 -1
  4. package/dist/cjs/RepositoryError.js +45 -0
  5. package/dist/cjs/RepositoryError.js.map +1 -0
  6. package/dist/cjs/Test.js +2 -1
  7. package/dist/cjs/Test.js.map +1 -1
  8. package/dist/cjs/Test.repository.js +32 -6
  9. package/dist/cjs/Test.repository.js.map +1 -1
  10. package/dist/cjs/Test.repository.types.js +14 -0
  11. package/dist/cjs/Test.repository.types.js.map +1 -0
  12. package/dist/cjs/index.js +1 -1
  13. package/dist/cjs/internal/Classify.js +4 -32
  14. package/dist/cjs/internal/Classify.js.map +1 -1
  15. package/dist/cjs/internal/Classify.spec.js +223 -0
  16. package/dist/cjs/internal/Classify.spec.js.map +1 -0
  17. package/dist/cjs/internal/Test.js +61 -29
  18. package/dist/cjs/internal/Test.js.map +1 -1
  19. package/dist/cjs/internal/Test.repository.sqlite.js +172 -121
  20. package/dist/cjs/internal/Test.repository.sqlite.js.map +1 -1
  21. package/dist/cjs/internal/Test.repository.sqlite.spec.js +263 -170
  22. package/dist/cjs/internal/Test.repository.sqlite.spec.js.map +1 -1
  23. package/dist/cjs/internal/Test.spec.js +205 -0
  24. package/dist/cjs/internal/Test.spec.js.map +1 -0
  25. package/dist/cjs/internal/format-diff.spec.js +22 -16
  26. package/dist/cjs/internal/format-diff.spec.js.map +1 -1
  27. package/dist/cjs/internal/summarize.js.map +1 -1
  28. package/dist/cjs/pack.js.map +1 -1
  29. package/dist/dts/Classify.d.ts +58 -24
  30. package/dist/dts/Classify.d.ts.map +1 -1
  31. package/dist/dts/Error.d.ts +1 -1
  32. package/dist/dts/RepositoryError.d.ts +40 -0
  33. package/dist/dts/RepositoryError.d.ts.map +1 -0
  34. package/dist/dts/Test.d.ts +13 -6
  35. package/dist/dts/Test.d.ts.map +1 -1
  36. package/dist/dts/Test.repository.d.ts +11 -55
  37. package/dist/dts/Test.repository.d.ts.map +1 -1
  38. package/dist/dts/Test.repository.types.d.ts +66 -0
  39. package/dist/dts/Test.repository.types.d.ts.map +1 -0
  40. package/dist/dts/index.d.ts +1 -1
  41. package/dist/dts/index.d.ts.map +1 -1
  42. package/dist/dts/internal/Classify.d.ts +14 -23
  43. package/dist/dts/internal/Classify.d.ts.map +1 -1
  44. package/dist/dts/internal/Classify.spec.d.ts +2 -0
  45. package/dist/dts/internal/Classify.spec.d.ts.map +1 -0
  46. package/dist/dts/internal/Test.d.ts +8 -8
  47. package/dist/dts/internal/Test.d.ts.map +1 -1
  48. package/dist/dts/internal/Test.repository.sqlite.d.ts +9 -12
  49. package/dist/dts/internal/Test.repository.sqlite.d.ts.map +1 -1
  50. package/dist/dts/internal/Test.spec.d.ts +2 -0
  51. package/dist/dts/internal/Test.spec.d.ts.map +1 -0
  52. package/dist/dts/internal/common.d.ts +1 -1
  53. package/dist/dts/internal/common.d.ts.map +1 -1
  54. package/dist/dts/internal/diff.d.ts.map +1 -1
  55. package/dist/dts/internal/format-diff.d.ts.map +1 -1
  56. package/dist/dts/internal/lib/Schema.d.ts.map +1 -1
  57. package/dist/dts/internal/lib/jsondiffpatch/contexts/context.d.ts.map +1 -1
  58. package/dist/dts/internal/lib/jsondiffpatch/contexts/diff.d.ts.map +1 -1
  59. package/dist/dts/internal/lib/jsondiffpatch/contexts/patch.d.ts.map +1 -1
  60. package/dist/dts/internal/lib/jsondiffpatch/contexts/reverse.d.ts.map +1 -1
  61. package/dist/dts/internal/lib/jsondiffpatch/diffpatcher.d.ts.map +1 -1
  62. package/dist/dts/internal/lib/jsondiffpatch/filters/lcs.d.ts.map +1 -1
  63. package/dist/dts/internal/lib/jsondiffpatch/formatters/annotated.d.ts.map +1 -1
  64. package/dist/dts/internal/lib/jsondiffpatch/formatters/base.d.ts +1 -1
  65. package/dist/dts/internal/lib/jsondiffpatch/formatters/base.d.ts.map +1 -1
  66. package/dist/dts/internal/lib/jsondiffpatch/formatters/html.d.ts.map +1 -1
  67. package/dist/dts/internal/lib/jsondiffpatch/formatters/jsonpatch.d.ts.map +1 -1
  68. package/dist/dts/internal/lib/jsondiffpatch/pipe.d.ts.map +1 -1
  69. package/dist/dts/internal/lib/jsondiffpatch/processor.d.ts +1 -1
  70. package/dist/dts/internal/lib/jsondiffpatch/processor.d.ts.map +1 -1
  71. package/dist/dts/internal/pack.d.ts.map +1 -1
  72. package/dist/dts/internal/stats.d.ts +1 -1
  73. package/dist/dts/internal/stats.d.ts.map +1 -1
  74. package/dist/dts/internal/summarize.d.ts +2 -2
  75. package/dist/dts/internal/summarize.d.ts.map +1 -1
  76. package/dist/esm/Classify.js +53 -3
  77. package/dist/esm/Classify.js.map +1 -1
  78. package/dist/esm/DisplayConfig.js +20 -1
  79. package/dist/esm/DisplayConfig.js.map +1 -1
  80. package/dist/esm/Error.js.map +1 -1
  81. package/dist/esm/RepositoryError.js +45 -0
  82. package/dist/esm/RepositoryError.js.map +1 -0
  83. package/dist/esm/Test.js +2 -1
  84. package/dist/esm/Test.js.map +1 -1
  85. package/dist/esm/Test.repository.js +52 -7
  86. package/dist/esm/Test.repository.js.map +1 -1
  87. package/dist/esm/Test.repository.types.js +14 -0
  88. package/dist/esm/Test.repository.types.js.map +1 -0
  89. package/dist/esm/index.js +21 -2
  90. package/dist/esm/index.js.map +1 -1
  91. package/dist/esm/internal/Classify.js +4 -32
  92. package/dist/esm/internal/Classify.js.map +1 -1
  93. package/dist/esm/internal/Classify.spec.js +223 -0
  94. package/dist/esm/internal/Classify.spec.js.map +1 -0
  95. package/dist/esm/internal/Test.js +61 -29
  96. package/dist/esm/internal/Test.js.map +1 -1
  97. package/dist/esm/internal/Test.repository.sqlite.js +192 -122
  98. package/dist/esm/internal/Test.repository.sqlite.js.map +1 -1
  99. package/dist/esm/internal/Test.repository.sqlite.spec.js +283 -171
  100. package/dist/esm/internal/Test.repository.sqlite.spec.js.map +1 -1
  101. package/dist/esm/internal/Test.spec.js +205 -0
  102. package/dist/esm/internal/Test.spec.js.map +1 -0
  103. package/dist/esm/internal/common.js +5 -1
  104. package/dist/esm/internal/common.js.map +1 -1
  105. package/dist/esm/internal/diff.js +5 -1
  106. package/dist/esm/internal/diff.js.map +1 -1
  107. package/dist/esm/internal/format-diff.js +5 -1
  108. package/dist/esm/internal/format-diff.js.map +1 -1
  109. package/dist/esm/internal/format-diff.spec.js +42 -17
  110. package/dist/esm/internal/format-diff.spec.js.map +1 -1
  111. package/dist/esm/internal/lib/Schema.js.map +1 -1
  112. package/dist/esm/internal/lib/jsondiffpatch/contexts/diff.js +5 -1
  113. package/dist/esm/internal/lib/jsondiffpatch/contexts/diff.js.map +1 -1
  114. package/dist/esm/internal/lib/jsondiffpatch/contexts/patch.js +5 -1
  115. package/dist/esm/internal/lib/jsondiffpatch/contexts/patch.js.map +1 -1
  116. package/dist/esm/internal/lib/jsondiffpatch/contexts/reverse.js +5 -1
  117. package/dist/esm/internal/lib/jsondiffpatch/contexts/reverse.js.map +1 -1
  118. package/dist/esm/internal/lib/jsondiffpatch/diffpatcher.js +25 -2
  119. package/dist/esm/internal/lib/jsondiffpatch/diffpatcher.js.map +1 -1
  120. package/dist/esm/internal/lib/jsondiffpatch/filters/arrays.js +5 -1
  121. package/dist/esm/internal/lib/jsondiffpatch/filters/arrays.js.map +1 -1
  122. package/dist/esm/internal/lib/jsondiffpatch/filters/nested.js +5 -1
  123. package/dist/esm/internal/lib/jsondiffpatch/filters/nested.js.map +1 -1
  124. package/dist/esm/internal/lib/jsondiffpatch/formatters/annotated.js +5 -1
  125. package/dist/esm/internal/lib/jsondiffpatch/formatters/annotated.js.map +1 -1
  126. package/dist/esm/internal/lib/jsondiffpatch/formatters/html.js +5 -1
  127. package/dist/esm/internal/lib/jsondiffpatch/formatters/html.js.map +1 -1
  128. package/dist/esm/internal/lib/jsondiffpatch/formatters/jsonpatch.js +5 -1
  129. package/dist/esm/internal/lib/jsondiffpatch/formatters/jsonpatch.js.map +1 -1
  130. package/dist/esm/internal/lib/jsondiffpatch/index.js +5 -1
  131. package/dist/esm/internal/lib/jsondiffpatch/index.js.map +1 -1
  132. package/dist/esm/internal/lib/jsondiffpatch/with-text-diffs.js +5 -1
  133. package/dist/esm/internal/lib/jsondiffpatch/with-text-diffs.js.map +1 -1
  134. package/dist/esm/internal/pack.js +20 -1
  135. package/dist/esm/internal/pack.js.map +1 -1
  136. package/dist/esm/internal/stats.js +5 -1
  137. package/dist/esm/internal/stats.js.map +1 -1
  138. package/dist/esm/internal/summarize.js +5 -1
  139. package/dist/esm/internal/summarize.js.map +1 -1
  140. package/dist/esm/pack.js +20 -1
  141. package/dist/esm/pack.js.map +1 -1
  142. package/package.json +6 -6
@@ -1,182 +1,294 @@
1
1
  "use strict";
2
2
 
3
- var Sql = /*#__PURE__*/_interopRequireWildcard(/*#__PURE__*/require("@effect/sql"));
3
+ var SqlClient = /*#__PURE__*/_interopRequireWildcard(/*#__PURE__*/require("@effect/sql/SqlClient"));
4
4
  var t = /*#__PURE__*/_interopRequireWildcard(/*#__PURE__*/require("@effect/vitest"));
5
5
  var _effect = /*#__PURE__*/require("effect");
6
+ var _RepositoryError = /*#__PURE__*/require("../RepositoryError.js");
7
+ var _TestRepository = /*#__PURE__*/require("../Test.repository.js");
8
+ var _TestRepositoryTypes = /*#__PURE__*/require("../Test.repository.types.js");
6
9
  var T = /*#__PURE__*/_interopRequireWildcard(/*#__PURE__*/require("./Test.js"));
7
10
  var TR = /*#__PURE__*/_interopRequireWildcard(/*#__PURE__*/require("./Test.repository.sqlite.js"));
8
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
11
+ function _interopRequireWildcard(e, t) {
12
+ if ("function" == typeof WeakMap) var r = new WeakMap(),
13
+ n = new WeakMap();
14
+ return (_interopRequireWildcard = function (e, t) {
15
+ if (!t && e && e.__esModule) return e;
16
+ var o,
17
+ i,
18
+ f = {
19
+ __proto__: null,
20
+ default: e
21
+ };
22
+ if (null === e || "object" != typeof e && "function" != typeof e) return f;
23
+ if (o = t ? n : r) {
24
+ if (o.has(e)) return o.get(e);
25
+ o.set(e, f);
26
+ }
27
+ for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]);
28
+ return f;
29
+ })(e, t);
30
+ }
9
31
  const add = input => _effect.Effect.succeed(input + 1);
10
- const _subtract = input => _effect.Effect.succeed(input - 1);
11
- const testCases = [{
12
- input: 1,
13
- expected: 2
14
- }, {
15
- input: 2,
16
- expected: 3
17
- }, {
18
- input: 3,
19
- expected: 4
20
- }];
21
- // TODO: Rewrite these by targeting the CLI functions _summarize, _diff, etc.,
22
- // i.e. make them higher-level.
32
+ // Each test uses a unique suite name and scopes queries to its own run via
33
+ // getTestResultsStream, so tests are robust to vitest reordering and the
34
+ // shared in-memory db contents from other tests in the same describe block.
23
35
  t.describe('Test.repository.sqlite', () => {
24
- t.effect('getOrCreateCurrentTestRun', () => _effect.Effect.gen(function* () {
25
- const name = 'getOrCreateCurrentTestRun';
26
- const repository = yield* TR.TestRepository;
27
- const a = yield* repository.getOrCreateCurrentTestRun(name);
28
- yield* repository.commitCurrentTestRun({
29
- name,
30
- hash: `${name}-1`
31
- });
32
- const b = yield* repository.getOrCreateCurrentTestRun(name);
33
- t.assert.notStrictEqual(a, b);
34
- }).pipe(_effect.Effect.tapError(e => _effect.Console.error(e)), _effect.Effect.provide(TR.LiveLayer), _effect.Effect.provide(TR.SqliteTestLayer)));
35
- t.effect.skip('clearStale', () => _effect.Effect.gen(function* () {
36
- const sql = yield* Sql.SqlClient.SqlClient;
37
- const repository = yield* TR.TestRepository;
38
- const nameA = 'to-be-cleared';
39
- const nameB = 'dont-clear-me';
40
- // Set up some alternative test runs,
41
- // which are not supposed to be cleared.
42
- yield* T.all({
43
- testCases: [{
44
- input: 'a',
45
- expected: 'A!'
46
- }],
47
- program: s => _effect.Effect.succeed(s.toUpperCase()),
48
- name: nameB
49
- }).pipe(_effect.Stream.tap(_ => repository.insertTestResult(_, nameB)), _effect.Stream.runDrain);
50
- yield* repository.commitCurrentTestRun({
51
- name: nameB,
52
- hash: `${nameB}-1`
53
- });
54
- yield* T.all({
55
- testCases: [{
56
- input: 'a',
57
- expected: 'A!'
58
- }],
59
- program: s => _effect.Effect.succeed(`${s.toUpperCase()}!`),
60
- name: nameB
61
- }).pipe(_effect.Stream.runDrain);
62
- yield* repository.commitCurrentTestRun({
63
- name: nameB,
64
- hash: `${nameB}-2`
65
- });
66
- yield* T.all({
67
- testCases: [{
68
- input: 'a',
69
- expected: 'A!'
70
- }],
71
- program: s => _effect.Effect.succeed(`${s.toUpperCase()}!!`),
72
- name: nameB
73
- }).pipe(_effect.Stream.runDrain);
74
- // Set up the main test runs to be cleared.
75
- yield* T.all({
76
- testCases: [{
36
+ t.it('TestLayer is cached across accesses', () => {
37
+ t.expect(_TestRepository.TestRepository.TestLayer).toBe(_TestRepository.TestRepository.TestLayer);
38
+ });
39
+ t.layer(TR.TestRepository.TestLayer, {
40
+ excludeTestServices: true
41
+ })('with shared in-memory db', it => {
42
+ it.effect('getOrCreateCurrentTestRun creates, then re-creates after commit', () => _effect.Effect.gen(function* () {
43
+ const name = 'suite-get-or-create';
44
+ const repository = yield* TR.TestRepository;
45
+ const a = yield* repository.getOrCreateCurrentTestRun(name);
46
+ t.expect(a.name).toBe(name);
47
+ t.expect(a.hash).toBeNull();
48
+ // commitCurrentTestRun bails early if the current run has no
49
+ // results, so insert one first.
50
+ yield* T.all({
51
+ testCases: [{
52
+ input: 0,
53
+ expected: 1
54
+ }],
55
+ program: add,
56
+ name
57
+ }).pipe(_effect.Stream.tap(_ => repository.insertTestResult(_, a)), _effect.Stream.runDrain);
58
+ yield* repository.commitCurrentTestRun({
59
+ name,
60
+ hash: `${name}-1`
61
+ });
62
+ const b = yield* repository.getOrCreateCurrentTestRun(name);
63
+ t.expect(b.name).toBe(name);
64
+ t.expect(b.hash).toBeNull();
65
+ // A fresh current-run row was created; the original was committed.
66
+ t.expect(b.id).not.toBe(a.id);
67
+ const runs = (yield* repository.getAllTestRuns).filter(r => r.name === name);
68
+ const committed = runs.find(r => r.id === a.id);
69
+ t.expect(committed?.hash).toBe(`${name}-1`);
70
+ }));
71
+ it.effect('insertTestResult: round-trip + idempotent on re-insert', () => _effect.Effect.gen(function* () {
72
+ const name = 'suite-insert';
73
+ const testCases = [{
74
+ input: 111,
75
+ expected: 112,
76
+ tags: ['a', 'b']
77
+ }, {
78
+ input: 112,
79
+ expected: 113,
80
+ tags: []
81
+ }, {
82
+ input: 113,
83
+ expected: 114
84
+ }];
85
+ const repository = yield* TR.TestRepository;
86
+ const testRun = yield* repository.getOrCreateCurrentTestRun(name);
87
+ yield* T.all({
88
+ testCases,
89
+ program: add,
90
+ name
91
+ }).pipe(_effect.Stream.tap(_ => repository.insertTestResult(_, testRun)), _effect.Stream.runDrain);
92
+ const scopeToRun = _effect.Effect.gen(function* () {
93
+ const junction = yield* repository.getAllTestRunResults;
94
+ const all = yield* repository.getAllTestResults;
95
+ const idsForRun = new Set(junction.filter(j => j.testRun === testRun.id).map(j => j.testResult));
96
+ return all.filter(r => idsForRun.has(r.id));
97
+ });
98
+ const scoped = yield* scopeToRun;
99
+ t.expect(scoped).toHaveLength(testCases.length);
100
+ // tags survive the split(',') codec both ways
101
+ const first = scoped.find(r => r.ordering === 0);
102
+ t.expect(first?.tags).toEqual(['a', 'b']);
103
+ const second = scoped.find(r => r.ordering === 1);
104
+ t.expect(second?.tags).toEqual([]);
105
+ const junctionBefore = (yield* repository.getAllTestRunResults).filter(j => j.testRun === testRun.id);
106
+ // Re-inserting the same results is a no-op (ON CONFLICT DO NOTHING).
107
+ yield* T.all({
108
+ testCases,
109
+ program: add,
110
+ name
111
+ }).pipe(_effect.Stream.tap(_ => repository.insertTestResult(_, testRun)), _effect.Stream.runDrain);
112
+ const junctionAfter = (yield* repository.getAllTestRunResults).filter(j => j.testRun === testRun.id);
113
+ t.expect(junctionAfter).toHaveLength(junctionBefore.length);
114
+ const scopedAgain = yield* scopeToRun;
115
+ t.expect(scopedAgain).toHaveLength(testCases.length);
116
+ const allResults = yield* repository.getAllTestResults;
117
+ const scopedIds = new Set(scoped.map(r => r.id));
118
+ const scopedAgainIds = new Set(scopedAgain.map(r => r.id));
119
+ t.expect([...scopedAgainIds].sort()).toEqual([...scopedIds].sort());
120
+ t.expect(allResults.filter(r => scopedIds.has(r.id))).toHaveLength(testCases.length);
121
+ }));
122
+ it.effect('clearStale: keeps `keep` most recent commits, prunes orphans, leaves other suites alone', () => _effect.Effect.gen(function* () {
123
+ const other = 'clearStale-other';
124
+ const target = 'clearStale-target';
125
+ const repository = yield* TR.TestRepository;
126
+ // Use inputs unique to this test so pruned results are truly
127
+ // orphaned and get cleaned up.
128
+ const otherInput = 799;
129
+ const targetInputs = [751, 752, 753];
130
+ const otherRun = yield* repository.getOrCreateCurrentTestRun(other);
131
+ yield* T.all({
132
+ testCases: [{
133
+ input: otherInput,
134
+ expected: otherInput + 1
135
+ }],
136
+ program: add,
137
+ name: other
138
+ }).pipe(_effect.Stream.tap(_ => repository.insertTestResult(_, otherRun)), _effect.Stream.runDrain);
139
+ yield* repository.commitCurrentTestRun({
140
+ name: other,
141
+ hash: `${other}-1`
142
+ });
143
+ for (const input of targetInputs) {
144
+ const targetRun = yield* repository.getOrCreateCurrentTestRun(target);
145
+ yield* T.all({
146
+ testCases: [{
147
+ input,
148
+ expected: input + 1
149
+ }],
150
+ program: add,
151
+ name: target
152
+ }).pipe(_effect.Stream.tap(_ => repository.insertTestResult(_, targetRun)), _effect.Stream.runDrain);
153
+ yield* repository.commitCurrentTestRun({
154
+ name: target,
155
+ hash: `${target}-${input}`
156
+ });
157
+ }
158
+ yield* repository.clearStale({
159
+ name: target,
160
+ keep: 1
161
+ });
162
+ const runs = yield* repository.getAllTestRuns;
163
+ const targetHashes = new Set(runs.filter(r => r.name === target).map(r => r.hash));
164
+ t.expect(targetHashes).toEqual(new Set([null, `${target}-${targetInputs[2]}`]));
165
+ const otherHashes = new Set(runs.filter(r => r.name === other).map(r => r.hash));
166
+ t.expect(otherHashes).toEqual(new Set([null, `${other}-1`]));
167
+ // Verify orphan cleanup via the junction table. We check the
168
+ // target suite's kept run only has 1 associated result, and
169
+ // the pruned inputs (751, 752) are no longer referenced by
170
+ // any surviving run.
171
+ const allRunResults = yield* repository.getAllTestRunResults;
172
+ const keptTargetRun = runs.find(r => r.name === target && r.hash === `${target}-${targetInputs[2]}`);
173
+ t.expect(keptTargetRun).toBeDefined();
174
+ const keptAssociations = allRunResults.filter(rr => rr.testRun === keptTargetRun?.id);
175
+ t.expect(keptAssociations).toHaveLength(1);
176
+ // Pruned target run IDs must not appear in the junction table.
177
+ const survivingRunIds = new Set(runs.map(r => r.id));
178
+ t.expect(allRunResults.every(rr => survivingRunIds.has(rr.testRun))).toBe(true);
179
+ // Verify orphaned test-results rows (inputs 751, 752) were
180
+ // pruned by the final DELETE in clearStale. Scope to results
181
+ // referenced by the target/other suite runs — the shared
182
+ // in-memory DB also holds rows from other tests.
183
+ const allResults = yield* repository.getAllTestResults;
184
+ const myRunIds = new Set(runs.filter(r => r.name === target || r.name === other).map(r => r.id));
185
+ const myResultIds = new Set(allRunResults.filter(rr => myRunIds.has(rr.testRun)).map(rr => rr.testResult));
186
+ const inputs = allResults.filter(r => myResultIds.has(r.id)).map(r => r.input).filter(x => typeof x === 'number');
187
+ t.expect(new Set(inputs)).toEqual(new Set([otherInput, targetInputs[2]]));
188
+ // The orphaned inputs must not survive anywhere in test-results
189
+ // either — the final DELETE prunes rows no run references.
190
+ const allInputs = new Set(allResults.map(r => r.input).filter(x => typeof x === 'number'));
191
+ t.expect(allInputs.has(targetInputs[0])).toBe(false);
192
+ t.expect(allInputs.has(targetInputs[1])).toBe(false);
193
+ }));
194
+ it.effect('getOrCreateCurrentTestRun returns a decoded TestRun instance and is idempotent for the same name', () => _effect.Effect.gen(function* () {
195
+ const name = 'suite-get-or-create-idempotent';
196
+ const repository = yield* TR.TestRepository;
197
+ const a = yield* repository.getOrCreateCurrentTestRun(name);
198
+ const b = yield* repository.getOrCreateCurrentTestRun(name);
199
+ t.expect(a).toBeInstanceOf(_TestRepositoryTypes.TestRun);
200
+ t.expect(b.id).toBe(a.id);
201
+ t.expect(b.hash).toBeNull();
202
+ const runs = (yield* repository.getAllTestRuns).filter(r => r.name === name);
203
+ const current = runs.filter(r => r.hash === null);
204
+ t.expect(current).toHaveLength(1);
205
+ }));
206
+ it.effect('clearUncommitedTestResults is a no-op when no current run exists for the suite name', () => _effect.Effect.gen(function* () {
207
+ const repository = yield* TR.TestRepository;
208
+ const exit = yield* _effect.Effect.exit(repository.clearUncommitedTestResults({
209
+ name: 'suite-never-created'
210
+ }));
211
+ t.expect(_effect.Exit.isSuccess(exit)).toBe(true);
212
+ }));
213
+ it.effect('clearStale is a no-op when there are fewer committed runs than `keep`', () => _effect.Effect.gen(function* () {
214
+ const name = 'suite-few-runs';
215
+ const repository = yield* TR.TestRepository;
216
+ const testRun = yield* repository.getOrCreateCurrentTestRun(name);
217
+ yield* T.all({
218
+ testCases: [{
219
+ input: 601,
220
+ expected: 602
221
+ }],
222
+ program: add,
223
+ name
224
+ }).pipe(_effect.Stream.tap(_ => repository.insertTestResult(_, testRun)), _effect.Stream.runDrain);
225
+ yield* repository.commitCurrentTestRun({
226
+ name,
227
+ hash: `${name}-1`
228
+ });
229
+ const before = (yield* repository.getAllTestRuns).filter(r => r.name === name);
230
+ yield* repository.clearStale({
231
+ name,
232
+ keep: 3
233
+ });
234
+ const after = (yield* repository.getAllTestRuns).filter(r => r.name === name);
235
+ t.expect(after.map(r => r.hash).sort()).toEqual(before.map(r => r.hash).sort());
236
+ }));
237
+ });
238
+ // Bogus-row test needs a separate db so the bad label does not break
239
+ // other tests' getAllTestResults calls.
240
+ t.layer(TR.TestRepository.TestLayer, {
241
+ excludeTestServices: true
242
+ })('with isolated in-memory db (bogus row)', it => {
243
+ it.effect('getAllTestResults surfaces RepositoryDecodeError on a bogus label row', () => _effect.Effect.gen(function* () {
244
+ const sql = yield* SqlClient.SqlClient;
245
+ const repository = yield* TR.TestRepository;
246
+ yield* sql`
247
+ INSERT INTO ${sql(TR.tables.testResults)}
248
+ ${sql.insert({
249
+ id: 'bogus',
250
+ hashTestCase: 'bogus',
251
+ ordering: 0,
252
+ input: 'null',
253
+ result: 'null',
254
+ expected: 'null',
255
+ label: 'NOT_A_LABEL',
256
+ tags: '',
257
+ timeMillis: 0
258
+ })};
259
+ `;
260
+ const exit = yield* _effect.Effect.exit(repository.getAllTestResults);
261
+ t.expect(_effect.Exit.isFailure(exit)).toBe(true);
262
+ const err = _effect.Exit.isFailure(exit) ? _effect.Cause.failureOption(exit.cause).pipe(_effect.Option.getOrThrow) : null;
263
+ t.expect(err).toBeInstanceOf(_RepositoryError.RepositoryDecodeError);
264
+ }));
265
+ });
266
+ t.layer(TR.TestRepository.TestLayer, {
267
+ excludeTestServices: true
268
+ })('with isolated in-memory db (write failure)', it => {
269
+ it.effect('insertTestResult surfaces RepositoryWriteError when the table is dropped', () => _effect.Effect.gen(function* () {
270
+ const sql = yield* SqlClient.SqlClient;
271
+ const repository = yield* TR.TestRepository;
272
+ const name = 'suite-write-failure';
273
+ const testRun = yield* repository.getOrCreateCurrentTestRun(name);
274
+ // Force subsequent writes to fail.
275
+ yield* sql`DROP TABLE ${sql(TR.tables.testResults)};`;
276
+ const sample = {
277
+ id: 'x',
278
+ hashTestCase: 'x',
279
+ ordering: 0,
77
280
  input: 1,
78
- expected: 10
79
- }],
80
- program: n => _effect.Effect.succeed(n + 1),
81
- name: nameA
82
- }).pipe(_effect.Stream.runDrain);
83
- yield* repository.commitCurrentTestRun({
84
- name: nameA,
85
- hash: `${nameA}-1`
86
- });
87
- yield* T.all({
88
- testCases: [{
89
- input: 1,
90
- expected: 10
91
- }],
92
- program: n => _effect.Effect.succeed(n + 2),
93
- name: nameA
94
- }).pipe(_effect.Stream.runDrain);
95
- yield* repository.commitCurrentTestRun({
96
- name: nameA,
97
- hash: `${nameA}-2`
98
- });
99
- yield* T.all({
100
- testCases: [{
101
- input: 1,
102
- expected: 10
103
- }],
104
- program: n => _effect.Effect.succeed(n * 10),
105
- name: nameA
106
- }).pipe(_effect.Stream.runDrain);
107
- const all0 = yield* sql`
108
- SELECT
109
- res.result,
110
- runs.*
111
- FROM ${sql(TR.tables.testResults)} res
112
- JOIN ${sql(TR.tables.testRunResults)} runres ON res.id = runres.testResult
113
- JOIN ${sql(TR.tables.testRuns)} runs ON runs.id = runres.testRun
114
- ORDER BY ordering ASC;
115
- `;
116
- console.table(all0);
117
- yield* repository.clearStale({
118
- name: nameA
119
- });
120
- const all = yield* sql`
121
- SELECT
122
- res.result,
123
- runs.*
124
- FROM ${sql(TR.tables.testResults)} res
125
- JOIN ${sql(TR.tables.testRunResults)} runres ON res.id = runres.testResult
126
- JOIN ${sql(TR.tables.testRuns)} runs ON runs.id = runres.testRun
127
- ORDER BY ordering ASC;
128
- `;
129
- t.assert.deepStrictEqual(all, [{
130
- result: '"A"',
131
- id: 1,
132
- name: nameB,
133
- hash: `${nameB}-1`
134
- }, {
135
- result: '"A!"',
136
- id: 2,
137
- name: nameB,
138
- hash: `${nameB}-2`
139
- }, {
140
- result: '"A!!"',
141
- id: 3,
142
- name: nameB,
143
- hash: null
144
- }, {
145
- result: '3',
146
- id: 5,
147
- name: nameA,
148
- hash: `${nameA}-2`
149
- }, {
150
- result: '10',
151
- id: 6,
152
- name: nameA,
153
- hash: null
154
- }]);
155
- }).pipe(_effect.Effect.provide(TR.LiveLayer), _effect.Effect.provide(TR.SqliteTestLayer)));
156
- t.effect('insertTestResult', () => _effect.Effect.gen(function* () {
157
- const name = 'insertTestResult';
158
- const repository = yield* TR.TestRepository;
159
- yield* repository.getOrCreateCurrentTestRun(name);
160
- const _r1 = yield* T.all({
161
- testCases,
162
- program: add,
163
- name
164
- }).pipe(_effect.Stream.runCollect);
165
- // yield* repository.commitCurrentTestRun({
166
- // name,
167
- // hash: `${name}-1`,
168
- // });
169
- // const r2 = yield* T.all({
170
- // testCases: [
171
- // {input: 4, expected: 2},
172
- // {input: 5, expected: 3},
173
- // {input: 6, expected: 4},
174
- // ],
175
- // program: add,
176
- // name,
177
- // }).pipe(P.Stream.runCollect);
178
- //
179
- // t.assert.equal(r1.length, r2.length);
180
- }).pipe(_effect.Effect.tapError(e => _effect.Console.error(e)), _effect.Effect.provide(TR.LiveLayer), _effect.Effect.provide(TR.SqliteTestLayer)));
281
+ result: 1,
282
+ expected: 1,
283
+ label: 'TP',
284
+ tags: [],
285
+ timeMillis: 0
286
+ };
287
+ const exit = yield* _effect.Effect.exit(repository.insertTestResult(sample, testRun));
288
+ t.expect(_effect.Exit.isFailure(exit)).toBe(true);
289
+ const err = _effect.Exit.isFailure(exit) ? _effect.Cause.failureOption(exit.cause).pipe(_effect.Option.getOrThrow) : null;
290
+ t.expect(err).toBeInstanceOf(_RepositoryError.RepositoryWriteError);
291
+ }));
292
+ });
181
293
  });
182
294
  //# sourceMappingURL=Test.repository.sqlite.spec.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Test.repository.sqlite.spec.js","names":["Sql","_interopRequireWildcard","require","t","_effect","T","TR","e","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","add","input","Effect","succeed","_subtract","testCases","expected","describe","effect","gen","name","repository","TestRepository","a","getOrCreateCurrentTestRun","commitCurrentTestRun","hash","b","assert","notStrictEqual","pipe","tapError","Console","error","provide","LiveLayer","SqliteTestLayer","skip","sql","SqlClient","nameA","nameB","all","program","s","toUpperCase","Stream","tap","_","insertTestResult","runDrain","all0","tables","testResults","testRunResults","testRuns","console","table","clearStale","deepStrictEqual","result","id","_r1","runCollect"],"sources":["../../../src/internal/Test.repository.sqlite.spec.ts"],"sourcesContent":[null],"mappings":";;AACA,IAAAA,GAAA,gBAAAC,uBAAA,cAAAC,OAAA;AACA,IAAAC,CAAA,gBAAAF,uBAAA,cAAAC,OAAA;AACA,IAAAE,OAAA,gBAAAF,OAAA;AAEA,IAAAG,CAAA,gBAAAJ,uBAAA,cAAAC,OAAA;AACA,IAAAI,EAAA,gBAAAL,uBAAA,cAAAC,OAAA;AAAkD,SAAAD,wBAAAM,CAAA,EAAAJ,CAAA,6BAAAK,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAP,uBAAA,YAAAA,CAAAM,CAAA,EAAAJ,CAAA,SAAAA,CAAA,IAAAI,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,MAAAK,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAT,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAO,CAAA,MAAAF,CAAA,GAAAT,CAAA,GAAAO,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAV,CAAA,UAAAK,CAAA,CAAAM,GAAA,CAAAX,CAAA,GAAAK,CAAA,CAAAO,GAAA,CAAAZ,CAAA,EAAAO,CAAA,gBAAAX,CAAA,IAAAI,CAAA,gBAAAJ,CAAA,OAAAiB,cAAA,CAAAC,IAAA,CAAAd,CAAA,EAAAJ,CAAA,OAAAU,CAAA,IAAAD,CAAA,GAAAU,MAAA,C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AAC,IAAIwC,eAAO,CAACC,KAAK,CAACzC,CAAC,CAAC,CAAC,EACtCoB,cAAM,CAACsB,OAAO,CAAC3C,EAAE,CAAC4C,SAAS,CAAC,EAC5BvB,cAAM,CAACsB,OAAO,CAAC3C,EAAE,CAAC6C,eAAe,CAAC,CACrC,CACJ;AACL,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"Test.repository.sqlite.spec.js","names":["SqlClient","_interopRequireWildcard","require","t","_effect","_RepositoryError","_TestRepository","_TestRepositoryTypes","T","TR","e","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","add","input","Effect","succeed","describe","it","expect","TestRepository","TestLayer","toBe","layer","excludeTestServices","effect","gen","name","repository","a","getOrCreateCurrentTestRun","hash","toBeNull","all","testCases","expected","program","pipe","Stream","tap","_","insertTestResult","runDrain","commitCurrentTestRun","b","id","not","runs","getAllTestRuns","filter","committed","find","tags","testRun","scopeToRun","junction","getAllTestRunResults","getAllTestResults","idsForRun","Set","j","map","testResult","scoped","toHaveLength","length","first","ordering","toEqual","second","junctionBefore","junctionAfter","scopedAgain","allResults","scopedIds","scopedAgainIds","sort","other","target","otherInput","targetInputs","otherRun","targetRun","clearStale","keep","targetHashes","otherHashes","allRunResults","keptTargetRun","toBeDefined","keptAssociations","rr","survivingRunIds","every","myRunIds","myResultIds","inputs","x","allInputs","toBeInstanceOf","TestRun","current","exit","clearUncommitedTestResults","Exit","isSuccess","before","after","sql","tables","testResults","insert","hashTestCase","result","label","timeMillis","isFailure","err","Cause","failureOption","cause","Option","getOrThrow","RepositoryDecodeError","sample","RepositoryWriteError"],"sources":["../../../src/internal/Test.repository.sqlite.spec.ts"],"sourcesContent":[null],"mappings":";;AAAA,IAAAA,SAAA,gBAAAC,uBAAA,cAAAC,OAAA;AACA,IAAAC,CAAA,gBAAAF,uBAAA,cAAAC,OAAA;AACA,IAAAE,OAAA,gBAAAF,OAAA;AAEA,I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