fix: keep local home paths and addresses out of the test fixtures [skip release]
Three test-only spots had baked in the machine this repository was developed
on, and the repository is publicly readable, so they shipped that machine's
shape to anyone who cloned it:
* the end-to-end embedding backend was pinned to a private LAN address;
it is now read from DSH_SLOPO_E2E_API_BASE, defaulting to Ollama's own
loopback address, so the machine running the suite supplies its own;
* the real-slopo test resolved discovery from a hardcoded root home, which
meant it could only ever run for one user — it resolves from the running
user's home now, which is also the fix for everyone else;
* the harness-slot contract tests read the global npm tree by absolute
path; they go through this repository's own node_modules symlink, which
is already relative to the checkout.
No user-facing behaviour changes and the published package never contained
the test files, so this push publishes nothing. The default configuration was
already free of machine-specific values: every address, path and key defaults
to empty and is resolved per user at runtime.
[skip release]
This commit is contained in:
1 parent
1b2ab3613f
commit
cf3e797849
3 files changed
+47
-27
No files matched your search
+9
-2
@@ -31,11 +31,18 @@ import assert from 'node:assert/strict'
|
||||
import { existsSync, readFileSync } from 'node:fs'
|
||||
import { join } from 'node:path'
|
||||
import { test } from 'node:test'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
|
||||
const SOURCE = readFileSync(new URL('../client/client.js', import.meta.url), 'utf8')
|
||||
|
||||
/** Where a global dsh installation keeps its packages, if there is one. */
|
||||
const DSH_PACKAGES = '/usr/local/lib/node_modules/@deepseek-ai/dsh/node_modules/@deepseek-ai'
|
||||
/**
|
||||
* The installed harness's packages, reached through this repository's own
|
||||
* `node_modules/@deepseek-ai` symlink rather than a committed absolute path —
|
||||
* the link is what makes the `@deepseek-ai/*` imports resolve during tests in
|
||||
* the first place, so it is the one address that is already relative to the
|
||||
* checkout.
|
||||
*/
|
||||
const DSH_PACKAGES = fileURLToPath(new URL('../node_modules/@deepseek-ai/', import.meta.url))
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// The two doubles
|
||||
|
||||
Reference in new issue
Block a user