mirror of
https://github.com/teamchong/pxpipe.git
synced 2026-07-22 02:02:51 +02:00
test: pin PXPIPE_MODELS in savings-math e2e so CI is hermetic
The GPT tests drive gpt-5.6-sol, which is intentionally outside the built-in default scope (Fable 5 only). Without pinning, the file's result depended on the developer's ambient PXPIPE_MODELS — passing locally but failing in CI's clean env. Snapshot/pin/restore, same convention as proxy-usage.test.ts.
This commit is contained in:
@@ -19,10 +19,25 @@
|
||||
*
|
||||
* Run just this file: pnpm vitest run tests/savings-math-e2e.test.ts
|
||||
*/
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { afterAll, beforeAll, describe, expect, it } from 'vitest';
|
||||
import { createProxy, type ProxyEvent } from '../src/core/proxy.js';
|
||||
import { countTokens as o200k } from 'gpt-tokenizer/encoding/o200k_base';
|
||||
|
||||
// The GPT tests below drive 'gpt-5.6-sol', which is intentionally absent from
|
||||
// the built-in default scope (Fable 5 only). Pin PXPIPE_MODELS so the suite is
|
||||
// deterministic regardless of the developer's shell (same convention as
|
||||
// proxy-usage.test.ts) — without this, the file passes or fails depending on
|
||||
// ambient env, which is exactly what broke CI.
|
||||
let ambientPxpipeModels: string | undefined;
|
||||
beforeAll(() => {
|
||||
ambientPxpipeModels = process.env.PXPIPE_MODELS;
|
||||
process.env.PXPIPE_MODELS = 'claude-fable-5,gpt-5.6-sol';
|
||||
});
|
||||
afterAll(() => {
|
||||
if (ambientPxpipeModels === undefined) delete process.env.PXPIPE_MODELS;
|
||||
else process.env.PXPIPE_MODELS = ambientPxpipeModels;
|
||||
});
|
||||
|
||||
const PROBE_TOKENS = 9999; // canned count_tokens result from the fake upstream
|
||||
|
||||
function fakeUpstream() {
|
||||
|
||||
Reference in New Issue
Block a user