Skip to content

Commit 88e5e9b

Browse files
committed
fix: resolve remaining CI failures (Ruby, Validate, Node cache)
- Remove .bundle/bundle cleanup that destroys gems installed by setup-ruby - Bump Node binding cache version to v3 to invalidate stale artifacts - Fix Biome formatting across TypeScript test-utils (factory.ts, imports)
1 parent 0e8a989 commit 88e5e9b

File tree

7 files changed

+24
-74
lines changed

7 files changed

+24
-74
lines changed

.github/workflows/ci-node.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ jobs:
198198
task-command: node:build:ci
199199
cache-paths: |
200200
crates/kreuzberg-node/
201-
cache-version: v2
201+
cache-version: v3
202202
rust-hash: "n/a"
203203
binding-files: |
204204
crates/kreuzberg-node/**

.github/workflows/ci-ruby.yaml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -385,12 +385,7 @@ jobs:
385385
echo "✓ Cleaned tmp/"
386386
fi
387387
388-
# Also clean any cached compilation artifacts
389-
if [ -d ".bundle" ]; then
390-
echo "Cleaning bundle cache..."
391-
rm -rf .bundle/bundle
392-
echo "✓ Cleaned .bundle/bundle"
393-
fi
388+
# Note: Do NOT clean .bundle/ - it contains gems installed by ruby/setup-ruby
394389
395390
echo "Cleanup complete"
396391
echo ""

packages/typescript/test-utils/src/assertions/factory.ts

Lines changed: 14 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
import type {
2-
AssertionAdapter,
3-
ExtractionResult,
4-
PlainRecord,
5-
} from "./types.js";
1+
import type { AssertionAdapter, ExtractionResult, PlainRecord } from "./types.js";
62
import { isPlainRecord } from "./types.js";
73

84
/**
@@ -29,21 +25,9 @@ export interface ExtractionAssertions<TResult extends ExtractionResult> {
2925
assertMaxContentLength(result: TResult, maximum: number): void;
3026
assertContentContainsAny(result: TResult, snippets: string[]): void;
3127
assertContentContainsAll(result: TResult, snippets: string[]): void;
32-
assertTableCount(
33-
result: TResult,
34-
minimum?: number | null,
35-
maximum?: number | null,
36-
): void;
37-
assertDetectedLanguages(
38-
result: TResult,
39-
expected: string[],
40-
minConfidence?: number | null,
41-
): void;
42-
assertMetadataExpectation(
43-
result: TResult,
44-
path: string,
45-
expectation: MetadataExpectation,
46-
): void;
28+
assertTableCount(result: TResult, minimum?: number | null, maximum?: number | null): void;
29+
assertDetectedLanguages(result: TResult, expected: string[], minConfidence?: number | null): void;
30+
assertMetadataExpectation(result: TResult, path: string, expectation: MetadataExpectation): void;
4731
}
4832

4933
/**
@@ -103,9 +87,7 @@ export function createAssertions<TResult extends ExtractionResult>(
10387
if (!expected.length) {
10488
return;
10589
}
106-
const matches = expected.some((token) =>
107-
result.mimeType.includes(token),
108-
);
90+
const matches = expected.some((token) => result.mimeType.includes(token));
10991
adapter.assertTrue(
11092
matches,
11193
`Expected MIME type to contain one of ${JSON.stringify(expected)}, got ${result.mimeType}`,
@@ -133,34 +115,20 @@ export function createAssertions<TResult extends ExtractionResult>(
133115
return;
134116
}
135117
const lowered = result.content.toLowerCase();
136-
const matches = snippets.some((snippet) =>
137-
lowered.includes(snippet.toLowerCase()),
138-
);
139-
adapter.assertTrue(
140-
matches,
141-
`Expected content to contain one of ${JSON.stringify(snippets)}`,
142-
);
118+
const matches = snippets.some((snippet) => lowered.includes(snippet.toLowerCase()));
119+
adapter.assertTrue(matches, `Expected content to contain one of ${JSON.stringify(snippets)}`);
143120
},
144121

145122
assertContentContainsAll(result: TResult, snippets: string[]): void {
146123
if (!snippets.length) {
147124
return;
148125
}
149126
const lowered = result.content.toLowerCase();
150-
const allMatch = snippets.every((snippet) =>
151-
lowered.includes(snippet.toLowerCase()),
152-
);
153-
adapter.assertTrue(
154-
allMatch,
155-
`Expected content to contain all of ${JSON.stringify(snippets)}`,
156-
);
127+
const allMatch = snippets.every((snippet) => lowered.includes(snippet.toLowerCase()));
128+
adapter.assertTrue(allMatch, `Expected content to contain all of ${JSON.stringify(snippets)}`);
157129
},
158130

159-
assertTableCount(
160-
result: TResult,
161-
minimum?: number | null,
162-
maximum?: number | null,
163-
): void {
131+
assertTableCount(result: TResult, minimum?: number | null, maximum?: number | null): void {
164132
const tables = Array.isArray(result.tables) ? result.tables : [];
165133
if (typeof minimum === "number") {
166134
adapter.assertGreaterThanOrEqual(
@@ -178,18 +146,11 @@ export function createAssertions<TResult extends ExtractionResult>(
178146
}
179147
},
180148

181-
assertDetectedLanguages(
182-
result: TResult,
183-
expected: string[],
184-
minConfidence?: number | null,
185-
): void {
149+
assertDetectedLanguages(result: TResult, expected: string[], minConfidence?: number | null): void {
186150
if (!expected.length) {
187151
return;
188152
}
189-
adapter.assertDefined(
190-
result.detectedLanguages,
191-
"Expected detectedLanguages to be defined",
192-
);
153+
adapter.assertDefined(result.detectedLanguages, "Expected detectedLanguages to be defined");
193154
const languages = result.detectedLanguages ?? [];
194155
const allPresent = expected.every((lang) => languages.includes(lang));
195156
adapter.assertTrue(
@@ -209,20 +170,14 @@ export function createAssertions<TResult extends ExtractionResult>(
209170
}
210171
},
211172

212-
assertMetadataExpectation(
213-
result: TResult,
214-
path: string,
215-
expectation: MetadataExpectation,
216-
): void {
173+
assertMetadataExpectation(result: TResult, path: string, expectation: MetadataExpectation): void {
217174
if (!isPlainRecord(result.metadata)) {
218175
adapter.fail(`Metadata is not a record for path ${path}`);
219176
}
220177

221178
const value = getMetadataPath(result.metadata, path);
222179
if (value === undefined || value === null) {
223-
adapter.fail(
224-
`Metadata path '${path}' missing in ${JSON.stringify(result.metadata)}`,
225-
);
180+
adapter.fail(`Metadata path '${path}' missing in ${JSON.stringify(result.metadata)}`);
226181
}
227182

228183
if (!isPlainRecord(expectation)) {

packages/typescript/test-utils/src/assertions/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
* @module assertions
44
*/
55

6-
// Export only assertion-specific types/functions, not duplicated ones like PlainRecord/isPlainRecord
7-
export type { ExtractionResult, AssertionAdapter } from "./types.js";
8-
export type { MetadataExpectation, ExtractionAssertions } from "./factory.js";
6+
export { DenoAdapter } from "./deno-adapter.js";
7+
export type { ExtractionAssertions, MetadataExpectation } from "./factory.js";
98
export { createAssertions } from "./factory.js";
9+
// Export only assertion-specific types/functions, not duplicated ones like PlainRecord/isPlainRecord
10+
export type { AssertionAdapter, ExtractionResult } from "./types.js";
1011
export { VitestAdapter } from "./vitest-adapter.js";
11-
export { DenoAdapter } from "./deno-adapter.js";

packages/typescript/test-utils/src/config-mapping/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
* @module config-mapping
44
*/
55

6-
export * from "./types.js";
7-
export * from "./field-mappers.js";
86
export * from "./build-config.js";
7+
export * from "./field-mappers.js";
8+
export * from "./types.js";

packages/typescript/test-utils/src/fixtures/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
* @module fixtures
44
*/
55

6-
export * from "./types.js";
76
export * from "./skip-handler.js";
7+
export * from "./types.js";

packages/typescript/test-utils/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
* @module @kreuzberg/test-utils
55
*/
66

7+
export * from "./assertions/index.js";
78
// Re-export all modules
89
export * from "./config-mapping/index.js";
9-
export * from "./assertions/index.js";
1010
export * from "./fixtures/index.js";
1111
export * from "./paths/index.js";

0 commit comments

Comments
 (0)