mirror of
https://gitea.com/gitea/runner.git
synced 2026-11-15 12:23:42 +00:00
test: fix windows path test (#1387)
`TestCopyWorkflowFilesHandsNodeTheRunnerCAUnlessTheJobOrImageSetsIt` from https://gitea.com/gitea/runner/pulls/1366 fails on Windows. `HostEnvironment.GetActPath` turns backslashes into slashes there, so `NODE_EXTRA_CA_CERTS` gets the slash form while the test expects the raw temp dir path. The runner behaviour is correct, only the expectation is wrong. Reviewed-on: https://gitea.com/gitea/runner/pulls/1387 Reviewed-by: Lunny Xiao <[email protected]> Co-authored-by: silverwind <[email protected]>
This commit is contained in:
1 parent
aa56f46c89
commit
664978c819
1 file changed
+1
-1
@@ -1490,7 +1490,7 @@ func TestCopyWorkflowFilesHandsNodeTheRunnerCAUnlessTheJobOrImageSetsIt(t *testi
|
|||||||
return env
|
return env
|
||||||
}
|
}
|
||||||
|
|
||||||
assert.Equal(t, actPath+"/ca.crt", stepEnv(caFile, nil, nil, nil)["NODE_EXTRA_CA_CERTS"])
|
assert.Equal(t, filepath.ToSlash(actPath)+"/ca.crt", stepEnv(caFile, nil, nil, nil)["NODE_EXTRA_CA_CERTS"])
|
||||||
ca, err := os.ReadFile(filepath.Join(actPath, "ca.crt"))
|
ca, err := os.ReadFile(filepath.Join(actPath, "ca.crt"))
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assert.Equal(t, "PEM\n", string(ca))
|
assert.Equal(t, "PEM\n", string(ca))
|
||||||
|
|||||||
Reference in new issue
Block a user