Skip to content

Commit 27ca7d6

Browse files
committed
fix(rebase): satisfy fork invariants on new upstream content (gc-5sacl)
Three test adaptations the rebase rework left incomplete on the new upstream layer: - precommit_contract_test.go: upstream relocated docs/schema/ → docs/reference/schema/; the pre-commit hook's `git add` now references the new paths, but the fake-repo fixture still created the old ones, so the hook aborted with "pathspec docs/reference/schema/openapi.json did not match any files". Point the placeholders at the relocated paths. - maintenance_scripts_test.go: the archive seed helpers exec `git commit` inheriting the host git config; under `make test`'s env -i sandbox (no SSH_AUTH_SOCK) an inherited commit.gpgsign + gpg.format=ssh fails with "Couldn't get agent socket?". Route the seed commits through testutil.IsolatedGitConfig (the fork's host-signing neutralizer), matching the gastown_test.go helpers. - examples/gastown/packs/gastown/testenv_import_test.go: remove the stale testenv stub the gc-k7cex generator run left orphaned (a testenv import in a directory with no real tests), which TestRequiresDedicatedTestenvImportFile flags in the full suite. Re-generated via `go run scripts/add-testenv-import.go` (1 stale removed, 115 dirs already canonical).
1 parent b721d7d commit 27ca7d6

3 files changed

Lines changed: 12 additions & 9 deletions

File tree

‎examples/gastown/maintenance_scripts_test.go‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import (
1515
"time"
1616

1717
"github.com/gastownhall/gascity/internal/beads"
18+
"github.com/gastownhall/gascity/internal/testutil"
1819
)
1920

2021
var rawDoltSQLCallRe = regexp.MustCompile(`(?m)(^|[^A-Za-z0-9_-])dolt(?:[ \t]+|[ \t]*\\[ \t]*\r?\n[ \t]*)+sql([ \t]|$)`)
@@ -6866,6 +6867,10 @@ exit 0
68666867
// later `git push origin main` would target the same ref the test verifies.
68676868
func initSeedArchive(t *testing.T, archiveRepo string, prevCount int) string {
68686869
t.Helper()
6870+
// Disable host commit signing for the seed commit: make test runs under
6871+
// env -i (no SSH_AUTH_SOCK), so an inherited commit.gpgsign + gpg.format=ssh
6872+
// fails with "Couldn't get agent socket?".
6873+
testutil.IsolatedGitConfig(t)
68696874
dbDir := filepath.Join(archiveRepo, "beads")
68706875
if err := os.MkdirAll(dbDir, 0o755); err != nil {
68716876
t.Fatal(err)
@@ -7148,6 +7153,7 @@ exit 0
71487153

71497154
func initSeedArchiveWithoutLocalIdentity(t *testing.T, archiveRepo string, prevCount int) string {
71507155
t.Helper()
7156+
testutil.IsolatedGitConfig(t) // disable host commit signing (env -i strips SSH_AUTH_SOCK)
71517157
dbDir := filepath.Join(archiveRepo, "beads")
71527158
if err := os.MkdirAll(dbDir, 0o755); err != nil {
71537159
t.Fatal(err)
@@ -7191,6 +7197,7 @@ func initSeedArchiveWithoutLocalIdentity(t *testing.T, archiveRepo string, prevC
71917197

71927198
func initSeedArchiveWithRemote(t *testing.T, archiveRepo string) (string, string) {
71937199
t.Helper()
7200+
testutil.IsolatedGitConfig(t) // disable host commit signing (env -i strips SSH_AUTH_SOCK)
71947201
remoteRepo := filepath.Join(t.TempDir(), "archive-remote.git")
71957202
if out, err := exec.Command("git", "init", "--bare", "-q", remoteRepo).CombinedOutput(); err != nil {
71967203
t.Fatalf("git init --bare: %v\n%s", err, out)
@@ -7264,6 +7271,7 @@ func initSeedArchiveWithUnreachableRemote(t *testing.T, archiveRepo string) {
72647271

72657272
func advanceArchiveRemoteMain(t *testing.T, remoteRepo string) string {
72667273
t.Helper()
7274+
testutil.IsolatedGitConfig(t) // disable host commit signing (env -i strips SSH_AUTH_SOCK)
72677275
worktree := t.TempDir()
72687276
if out, err := exec.Command("git", "clone", "-q", remoteRepo, worktree).CombinedOutput(); err != nil {
72697277
t.Fatalf("git clone remote advance worktree: %v\n%s", err, out)

‎examples/gastown/packs/gastown/testenv_import_test.go‎

Lines changed: 0 additions & 5 deletions
This file was deleted.

‎scripts/precommit_contract_test.go‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,11 +249,11 @@ exit 0
249249
// out above, so we just need the files to exist for git add.
250250
placeholders := []string{
251251
"internal/api/openapi.json",
252-
"docs/schema/openapi.json",
253-
"docs/schema/openapi.txt",
252+
"docs/reference/schema/openapi.json",
253+
"docs/reference/schema/openapi.txt",
254254
"internal/api/genclient/client_gen.go",
255-
"docs/schema/city-schema.json",
256-
"docs/schema/city-schema.txt",
255+
"docs/reference/schema/city-schema.json",
256+
"docs/reference/schema/city-schema.txt",
257257
"docs/reference/config.md",
258258
"docs/reference/cli.md",
259259
"cmd/gc/dashboard/web/src/generated/placeholder.ts",

0 commit comments

Comments
 (0)