diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-08-22 15:09:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-08-22 15:09:21 +0300 |
commit | 4fc46d75644b28789e83c95ec4d1309498bb4ba3 (patch) | |
tree | c9609e71d701f19835ccad3f5f1c4b24490d4049 /workhorse/upload_test.go | |
parent | 48641ca0e8b4517fbc73704b132c0157943deec6 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'workhorse/upload_test.go')
-rw-r--r-- | workhorse/upload_test.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/workhorse/upload_test.go b/workhorse/upload_test.go index 62a78dd9464..de7c5c6dd52 100644 --- a/workhorse/upload_test.go +++ b/workhorse/upload_test.go @@ -74,9 +74,9 @@ func uploadTestServer(t *testing.T, allowedHashFunctions []string, authorizeTest var err error if len(allowedHashFunctions) == 0 { - _, err = fmt.Fprintf(w, `{"TempPath":"%s"}`, scratchDir) + _, err = fmt.Fprintf(w, `{"TempPath":"%s"}`, t.TempDir()) } else { - _, err = fmt.Fprintf(w, `{"TempPath":"%s", "UploadHashFunctions": ["%s"]}`, scratchDir, strings.Join(allowedHashFunctions, `","`)) + _, err = fmt.Fprintf(w, `{"TempPath":"%s", "UploadHashFunctions": ["%s"]}`, t.TempDir(), strings.Join(allowedHashFunctions, `","`)) } require.NoError(t, err) @@ -386,7 +386,7 @@ func TestLfsUpload(t *testing.T) { lfsApiResponse := fmt.Sprintf( `{"TempPath":%q, "LfsOid":%q, "LfsSize": %d}`, - scratchDir, oid, len(reqBody), + t.TempDir(), oid, len(reqBody), ) ts := testhelper.TestServerWithHandler(regexp.MustCompile(`.`), func(w http.ResponseWriter, r *http.Request) { @@ -512,7 +512,7 @@ func packageUploadTestServer(t *testing.T, method string, resource string, reqBo return testhelper.TestServerWithHandler(regexp.MustCompile(`.`), func(w http.ResponseWriter, r *http.Request) { require.Equal(t, r.Method, method) apiResponse := fmt.Sprintf( - `{"TempPath":%q, "Size": %d}`, scratchDir, len(reqBody), + `{"TempPath":%q, "Size": %d}`, t.TempDir(), len(reqBody), ) switch r.RequestURI { case resource + "/authorize": |