Skip to content

test(services): isolate test app-data state - #95

Open
somtri wants to merge 3 commits into
NVIDIA:developfrom
somtri:fix/issue-48-test-appdata-isolation
Open

somtri wants to merge 3 commits into
NVIDIA:developfrom
somtri:fix/issue-48-test-appdata-isolation

Conversation

@somtri

@somtri somtri commented Sep 19, 2026 •

Copy link
Copy Markdown

Description

Fixes #48.

Some Go tests inherited the developer's PAIR app-data directory. A saved LM Studio port file could affect a later run, and a test could overwrite the developer's saved port.

develop replaced services/lmstudio-proxy and services/ollama-proxy with services/nvpair-proxy, so this branch now merges develop and ports the change to the unified proxy:

  • services/tests sets a private configuration root for every child binary it starts. A new test starts a real nvpair-proxy, enables the LM Studio facade, sends lmstudio:set-port, and checks that the port file is written below that root.
  • The nvpair-proxy end-to-end failover test redirects the configuration root before it starts its child process.

Both set the variables after go build. On Linux and macOS, Go derives its module and build caches from HOME, so redirecting it earlier would build into the test directory.

Release intent

Changelog title

n/a

Changelog body

n/a

Bumps

  • services: none
  • nvpair-cluster-manager: none
  • nvpair-engine-manager: none
  • nvpair-errors: none
  • nvpair-job-scheduler: none
  • nvpair-manual-nodes: none
  • nvpair-node-info: none
  • nvpair-node-scanner: none
  • nvpair-node-settings: none
  • nvpair-proxy: none
  • nvpair-tui: none
  • nvpair-ui-broker: none
  • nvpair-workload-manager: none

Scope

Included:

  • Test setup in services/tests/main_test.go and services/nvpair-proxy/e2e_test.go.
  • One cross-process regression test for LM Studio port persistence.

Excluded:

  • Production app-directory behavior, flags, dependencies, APIs, documentation, and version files.
  • The earlier nvpair-ui-broker test file. services/nvpair-ui-broker/testmain_test.go on develop already isolates that package, and a second TestMain would not compile. The merge removes it.

Validation

  • go test . -run TestE2EFailoverOverRealBinary -count=2 in services/nvpair-proxy passed on Windows 11 with Go 1.26.5.
  • go test . -run TestLMStudioFacadeChildPersistsUnderPrivateBase -count=2 in services/tests passed on the same machine.
  • go test . -count=1 passed in services/nvpair-proxy and in services/tests. The only skips were the opt-in CORS tests and TestBrokerShutsDownOnSignal.
  • The real %LOCALAPPDATA%\Nvidia Corporation\Personal AI Router directory did not exist before these runs and did not exist after them.
  • On Linux (golang:1.26 container, non-root user), both focused tests passed twice and the full nvpair-proxy package passed. With the variable loop removed, the new test fails with "outside test config base".
  • node scripts/spdx-headers.mjs, git diff --check, and scripts/release-intent/validate_pr.py on this description passed.

Risk

This change affects test setup only. Compiled binaries and normal PAIR configuration resolution are unchanged.

Checklist

  • I have read the Contributing Guidelines.
  • Every commit is signed off (git commit -s), certifying the Developer Certificate of Origin.
  • New or existing tests cover the change.
  • Relevant documentation is updated. No documentation change is needed because users see no behavior change.
  • I checked the diff, changed filenames, and commit messages for credentials, private data, internal URLs, internal issue identifiers, and generated artifacts.
  • I recorded the validation commands and results above.
  • I declared version bumps in the release-intent block above. services/versions.json is written by automation — do not edit it by hand.

Signed-off-by: Som Tripathi <somtri@iastate.edu>
@Noah-Tervalon-Nvidia

Copy link
Copy Markdown
Collaborator

Heads up — develop has just taken a change that merges the Ollama and LM Studio
proxies into a single nvpair-proxy process, hosting one facade per enabled
engine. services/ollama-proxy/ and services/lmstudio-proxy/ are gone.

This PR edits files in those directories, so it will need updating before it can
merge. The good news is that the client-facing ollama-proxy: and
lmstudio-proxy: namespaces are unchanged — only the process behind them moved —
so the change should port across to services/nvpair-proxy/ fairly directly.

Apologies for the churn, and thanks for the contribution. Happy to help work out
where it lands if it isn't obvious.

@Noah-Tervalon-Nvidia
Noah-Tervalon-Nvidia changed the base branch from main to develop September 21, 2026 21:58
…appdata-isolation

Signed-off-by: Som Tripathi <somtri@iastate.edu>

# Conflicts:
#	services/lmstudio-proxy/e2e_test.go
#	services/tests/main_test.go
Signed-off-by: Som Tripathi <somtri@iastate.edu>
@somtri

somtri commented Sep 23, 2026

Copy link
Copy Markdown
Author

I merged develop and ported this to services/nvpair-proxy. The diff against develop is now two test files: services/tests/main_test.go and services/nvpair-proxy/e2e_test.go. I dropped the broker test file because develop already isolates that package in testmain_test.go. The description now has the release-intent block, with every bump set to none.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: tests write the live per-user app-data directory, so a second suite run fails

2 participants