(t *testing.T, testFiles ...string)
| 73 | } |
| 74 | |
| 75 | func prepareAgentsDir(t *testing.T, testFiles ...string) string { |
| 76 | t.Helper() |
| 77 | |
| 78 | agentsDir := filepath.Join(t.TempDir(), "agents") |
| 79 | err := os.MkdirAll(agentsDir, 0o700) |
| 80 | require.NoError(t, err) |
| 81 | |
| 82 | for _, file := range testFiles { |
| 83 | buf, err := os.ReadFile(filepath.Join("testdata", file)) |
| 84 | require.NoError(t, err) |
| 85 | |
| 86 | err = os.WriteFile(filepath.Join(agentsDir, filepath.Base(file)), buf, 0o600) |
| 87 | require.NoError(t, err) |
| 88 | } |
| 89 | |
| 90 | return agentsDir |
| 91 | } |
| 92 | |
| 93 | func startServer(t *testing.T, ctx context.Context, agentsDir string) string { |
| 94 | t.Helper() |
no test coverage detected