As we reevaluate how to best support and maintain Staging Ref in the future, we encourage development teams using this environment to highlight their use cases in the following issue: https://gitlab.com/gitlab-com/gl-infra/software-delivery/framework/software-delivery-framework-issue-tracker/-/issues/36.

Skip to content
Snippets Groups Projects
Unverified Commit fba6b115 authored by Ash McKenzie's avatar Ash McKenzie
Browse files

Make temp dir removal consistent with others

parent 711ed564
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -92,10 +92,9 @@ func StartGitalyServer(t *testing.T, network string) (string, *TestGitalyServer)
// for more detail.
tempDir, err := os.MkdirTemp("", "gitaly")
require.NoError(t, err)
gitalySocketPath := path.Join(tempDir, "gitaly.sock")
t.Cleanup(func() { require.NoError(t, os.RemoveAll(tempDir)) })
gitalySocketPath := path.Join(tempDir, "gitaly.sock")
err = os.MkdirAll(filepath.Dir(gitalySocketPath), 0700)
require.NoError(t, err)
Loading
Loading
Loading
Loading
@@ -33,7 +33,7 @@ func StartSocketHttpServer(t *testing.T, handlers []TestRequestHandler) string {
// for more detail.
tempDir, err := os.MkdirTemp("", "http")
require.NoError(t, err)
t.Cleanup(func() { os.RemoveAll(tempDir) })
t.Cleanup(func() { require.NoError(t, os.RemoveAll(tempDir)) })
testSocket := path.Join(tempDir, "internal.sock")
err = os.MkdirAll(filepath.Dir(testSocket), 0700)
Loading
Loading
Loading
Loading
@@ -263,7 +263,7 @@ func configureSSHD(t *testing.T, apiServer string) (string, ed25519.PublicKey) {
t.Helper()
tempDir := t.TempDir()
t.Cleanup(func() { os.RemoveAll(tempDir) })
t.Cleanup(func() { require.NoError(t, os.RemoveAll(tempDir)) })
configFile := filepath.Join(tempDir, "config.yml")
hostKeyFile := filepath.Join(tempDir, "hostkey")
Loading
Loading
Loading
Loading
@@ -62,7 +62,7 @@ func TestConfigureWithDebugLogLevel(t *testing.T) {
func TestConfigureWithPermissionError(t *testing.T) {
tempDir := t.TempDir()
defer os.RemoveAll(tempDir)
t.Cleanup(func() { require.NoError(t, os.RemoveAll(tempDir)) })
config := config.Config{
LogFile: tempDir,
Loading
Loading
Loading
Loading
@@ -34,7 +34,7 @@ func PrepareTestRootDir(t *testing.T) {
require.NoError(t, os.MkdirAll(TestRoot, 0700))
t.Cleanup(func() { os.RemoveAll(TestRoot) })
t.Cleanup(func() { require.NoError(t, os.RemoveAll(TestRoot)) })
require.NoError(t, copyTestData())
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment