mirror of
https://gitea.com/gitea/act_runner.git
synced 2026-11-06 15:22:44 +08: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 <xiaolunwen@gmail.com> Co-authored-by: silverwind <me@silverwind.io>
This commit is contained in:
@@ -1490,7 +1490,7 @@ func TestCopyWorkflowFilesHandsNodeTheRunnerCAUnlessTheJobOrImageSetsIt(t *testi
|
||||
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"))
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, "PEM\n", string(ca))
|
||||
|
||||
Reference in New Issue
Block a user