Skip to content

Commit 25dfa07

Browse files
committed
test(agents): Run llm integration only in dev mode
1 parent 4eccf15 commit 25dfa07

2 files changed

Lines changed: 30 additions & 25 deletions

File tree

packages/agents/src/llm.test.ts

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -23,30 +23,34 @@ describe('llm', () => {
2323
});
2424
});
2525

26-
it(
27-
'should be able to generate text',
28-
{
29-
timeout: 5_000,
30-
},
31-
async () => {
32-
console.log('Starting test');
33-
const prompt = 'Count to 6. Do not use any words.';
34-
const result = await kernel.launchSubcluster({
35-
bootstrap: 'user',
36-
vats: {
37-
user: {
38-
bundleSpec: getBundleSpec('user'),
39-
parameters: { name: 'Alice', prompt },
26+
// Only run in development mode
27+
// eslint-disable-next-line n/no-process-env
28+
describe.runIf(process.env.NODE_ENV === 'development')('integration', () => {
29+
it(
30+
'should be able to generate text',
31+
{
32+
timeout: 5_000,
33+
},
34+
async () => {
35+
console.log('Starting test');
36+
const prompt = 'Count to 6. Do not use any words.';
37+
const result = await kernel.launchSubcluster({
38+
bootstrap: 'user',
39+
vats: {
40+
user: {
41+
bundleSpec: getBundleSpec('user'),
42+
parameters: { name: 'Alice', prompt },
43+
},
44+
ollama: {
45+
bundleSpec: getBundleSpec('ollama'),
46+
},
4047
},
41-
ollama: {
42-
bundleSpec: getBundleSpec('ollama'),
43-
},
44-
},
45-
});
46-
expect(result).toBeDefined();
47-
const llmResponse = kunser(result as Parameters<typeof kunser>[0]);
48-
expect(typeof llmResponse).toBe('string');
49-
expect(llmResponse).toMatch(/1[^0-9]*2[^0-9]*3[^0-9]*4[^0-9]*5/u);
50-
},
51-
);
48+
});
49+
expect(result).toBeDefined();
50+
const llmResponse = kunser(result as Parameters<typeof kunser>[0]);
51+
expect(typeof llmResponse).toBe('string');
52+
expect(llmResponse).toMatch(/1[^0-9]*2[^0-9]*3[^0-9]*4[^0-9]*5/u);
53+
},
54+
);
55+
});
5256
});

packages/agents/vitest.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export default defineConfig((args) => {
1010
defineProject({
1111
test: {
1212
name: 'agents',
13+
env: { NODE_ENV: args.mode === 'development' ? 'development' : 'test' },
1314
},
1415
}),
1516
);

0 commit comments

Comments
 (0)