Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions service/submitqueue/demo/requests/source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,13 @@ func sandbox(t *testing.T, git string) string {
bare := filepath.Join(t.TempDir(), "sandbox.git")

require.NoError(t, gitexec.Run(ctx, git, "", "init", "--bare", "-b", "main", bare))
// Auto-maintenance can repack in the background and race t.TempDir cleanup.
require.NoError(t, gitexec.Run(ctx, git, bare, "config", "maintenance.auto", "false"))
Comment thread
sbalabanov marked this conversation as resolved.
Resolved
seed := t.TempDir()
require.NoError(t, gitexec.Run(ctx, git, "", "clone", bare, seed))
require.NoError(t, gitexec.Run(ctx, git, seed, "config", "user.name", "Test"))
require.NoError(t, gitexec.Run(ctx, git, seed, "config", "user.email", "test@example.invalid"))
require.NoError(t, gitexec.Run(ctx, git, seed, "config", "maintenance.auto", "false"))
require.NoError(t, os.WriteFile(filepath.Join(seed, "seed.txt"), []byte("seed\n"), 0o644))
require.NoError(t, gitexec.Run(ctx, git, seed, "add", "."))
require.NoError(t, gitexec.Run(ctx, git, seed, "commit", "-m", "seed"))
Expand Down Expand Up @@ -256,6 +259,7 @@ func TestCheckFoldersHaveTargets(t *testing.T) {
require.NoError(t, gitexec.Run(ctx, git, "", "clone", withTargets, seed))
require.NoError(t, gitexec.Run(ctx, git, seed, "config", "user.name", "Test"))
require.NoError(t, gitexec.Run(ctx, git, seed, "config", "user.email", "test@example.invalid"))
require.NoError(t, gitexec.Run(ctx, git, seed, "config", "maintenance.auto", "false"))
require.NoError(t, os.MkdirAll(filepath.Join(seed, "demo", "00"), 0o755))
require.NoError(t, os.WriteFile(filepath.Join(seed, targetsMarker), nil, 0o644))
require.NoError(t, gitexec.Run(ctx, git, seed, "add", "."))
Expand Down