From 664978c8199b36f22f464a51afb325c1fcd1034b Mon Sep 17 00:00:00 2001 From: silverwind Date: Thu, 5 Nov 2026 07:14:56 +0000 Subject: [PATCH] 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 Co-authored-by: silverwind --- act/runner/run_context_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/act/runner/run_context_test.go b/act/runner/run_context_test.go index c8b9c320..9c1682dc 100644 --- a/act/runner/run_context_test.go +++ b/act/runner/run_context_test.go @@ -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))