mirror of
https://gitea.com/gitea/runner.git
synced 2026-11-17 05:13:42 +00:00
enhance: test on Windows and fix what it found (#1348)
Adds a weekly and on-demand workflow that runs the cross-compiled tests on Windows Server 2025 Core in a [dockur/windows](https://github.com/dockur/windows) QEMU VM, and fixes the Windows bugs it found in host and UNC paths, env handling, shell quoting, post-task scripts, health checks, checkout, action symlinks, step summaries, Git client certificates and docker mode from a Windows host. Host-mode steps now emit UTF-8, `bash` falls back to Git's bash instead of the WSL launcher, the runner can run as a native Windows service, steps can keep background helpers with `RUNNER_TRACKING_ID`, and Windows arm64 binaries are released. Fixes: https://gitea.com/gitea/runner/issues/1339 Fixes: https://gitea.com/gitea/runner/issues/637 Fixes: https://gitea.com/gitea/runner/issues/1172 Fixes: https://gitea.com/gitea/runner/issues/347 Reviewed-on: https://gitea.com/gitea/runner/pulls/1348 Reviewed-by: bircni <[email protected]>
This commit is contained in:
1 parent
6e42621b4a
commit
d6f5b68a0d
85 files changed
+2578
-620
No files matched your search
@@ -241,9 +241,6 @@ func TestRunnerShouldRunIdleCleanupSkipsWhenDisabled(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
// TestRunnerOnIdleIntegratesCleanup wires the full OnIdle entry point and
|
||||
// confirms it walks workdir_parent (after the leading-slash trim that
|
||||
// matches the production path construction) and removes stale numeric dirs.
|
||||
func TestRunnerOnIdleIntegratesCleanup(t *testing.T) {
|
||||
now := time.Date(2026, time.April, 29, 20, 0, 0, 0, time.UTC)
|
||||
root := t.TempDir()
|
||||
@@ -255,7 +252,7 @@ func TestRunnerOnIdleIntegratesCleanup(t *testing.T) {
|
||||
cfg: &config.Config{
|
||||
Container: config.Container{
|
||||
BindWorkdir: true,
|
||||
WorkdirParent: root, // leading slash absent, OnIdle reattaches it
|
||||
WorkdirParent: root,
|
||||
},
|
||||
Runner: config.Runner{
|
||||
WorkdirCleanupAge: 24 * time.Hour,
|
||||
@@ -371,3 +368,16 @@ func TestRunnerOnIdleRemovesOrphanNetworks(t *testing.T) {
|
||||
assert.Equal(t, []string{"a1b2c3d4e5f6", ""}, detached)
|
||||
assert.Equal(t, []string{"runner-1"}, sweptPods)
|
||||
}
|
||||
|
||||
func TestContainerWorkdirRoot(t *testing.T) {
|
||||
absolute := t.TempDir()
|
||||
rooted := filepath.Join(string(filepath.Separator), "workspace")
|
||||
for input, want := range map[string]string{
|
||||
"workspace": rooted,
|
||||
"/workspace/": rooted,
|
||||
absolute: absolute,
|
||||
absolute + "/nested": filepath.Join(absolute, "nested"),
|
||||
} {
|
||||
assert.Equal(t, want, containerWorkdirRoot(input), input)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user