fix: pin native exports to stage execution service

This commit is contained in:
2026-10-20 21:46:42 +01:00
parent 1f867d4827
commit bb98bde4fc
20 changed files with 420 additions and 74 deletions
+14
View File
@@ -11,6 +11,7 @@ import (
)
func TestProviderCheckExecutesGenerationAndReportsFailures(t *testing.T) {
fakeNativeService(t)
// Isolate harness settings so an unrelated developer profile cannot route the
// native check through Docker.
t.Setenv("PIPELINES_HARNESS_CONFIG", filepath.Join(t.TempDir(), "harnesses.json"))
@@ -43,6 +44,19 @@ esac
}
}
func fakeNativeService(t *testing.T) {
t.Helper()
state := t.TempDir()
t.Setenv("XDG_STATE_HOME", state)
t.Setenv("XDG_CACHE_HOME", t.TempDir())
if err := os.Mkdir(filepath.Join(state, "opencode"), 0700); err != nil {
t.Fatal(err)
}
if err := os.WriteFile(filepath.Join(state, "opencode", "service.json"), []byte(`{"url":"http://127.0.0.1:1","password":"fixture-password"}`), 0600); err != nil {
t.Fatal(err)
}
}
func TestProviderCheckDeclineDoesNotExecute(t *testing.T) {
t.Setenv("PIPELINES_OPENCODE", "/does-not-exist")
var out bytes.Buffer
+1
View File
@@ -114,6 +114,7 @@ func TestProviderCheckDockerTextModeOmitsJSON(t *testing.T) {
}
func TestProviderCheckNativeProfileKeepsHostGenerator(t *testing.T) {
fakeNativeService(t)
root := t.TempDir()
marker := filepath.Join(root, "opencode-called")
opencode := filepath.Join(root, "opencode")