╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ───────╮ │src/test/net.zig│ ╰────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │298 - const server_path = (try repoOnDiskPath(io, allocator, temp_dir_name, "testrepo", true)).?; │ │283 + const server_path = (try repoOnDiskPath(io, allocator, temp_path, "testrepo", true)).?; │ │284 defer allocator.free(server_path); │ │285 │ │286 var server_repo = try rp.Repo(.xit, .{ .is_test = true }).init(io, allocator, .{ .bare = true, .path = server_path });│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │295 defer export_file.close(io); │ │296 } │ │297 │ │313 - const cwd_path = try std.process.currentPathAlloc(io, allocator); │ │314 - defer allocator.free(cwd_path); │ │315 - │ │316 - const client_path = try std.fs.path.join(allocator, &.{ cwd_path, temp_dir_name, "client" }); │ │298 + const client_path = try std.fs.path.join(allocator, &.{ temp_path, "client" }); │ │299 defer allocator.free(client_path); │ │300 │ │301 var client_repo = try rp.Repo(repo_kind, .{ .is_test = true }).init(io, allocator, .{ .path = client_path });│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────╮ │330 .file => false, │ │331 .wire => |wire_kind| .ssh == wire_kind, │ │332 }; │ │351 - const ssh_cmd_maybe = try sshCommand(is_ssh, allocator, cwd_path, temp_dir_name, port);│ │333 + const ssh_cmd_maybe = try sshCommand(is_ssh, allocator, temp_path, port); │ │334 defer if (ssh_cmd_maybe) |ssh_cmd| allocator.free(ssh_cmd); │ │335 │ │336 try client_repo.push( │ ╰────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │482 io: std.Io, │ │483 allocator: std.mem.Allocator, │ │484 ) !void { │ │503 - const temp_dir_name = "temp-testnet-push-fork"; │ │504 - const cwd = std.Io.Dir.cwd(); │ │505 - var temp_dir_or_err = cwd.openDir(io, temp_dir_name, .{}); │ │506 - if (temp_dir_or_err) |*temp_dir| { │ │507 - temp_dir.close(io); │ │508 - try cwd.deleteTree(io, temp_dir_name); │ │509 - } else |_| {} │ │510 - var temp_dir = try cwd.createDirPathOpen(io, temp_dir_name, .{}); │ │511 - defer cwd.deleteTree(io, temp_dir_name) catch {}; │ │512 - defer temp_dir.close(io); │ │485 + var temp = std.testing.tmpDir(.{}); │ │486 + defer temp.cleanup(); │ │487 + const temp_path = try temp.dir.realPathFileAlloc(io, ".", allocator); │ │488 + defer allocator.free(temp_path); │ │489 │ │514 - var server_process = try runServer(io, allocator, temp_dir_name, port); │ │490 + var server_process = try runServer(io, allocator, temp_path, port); │ │491 defer _ = server_process.kill(io); │ │492 │ │517 - const target_path = (try repoOnDiskPath(io, allocator, temp_dir_name, "target", true)).?; │ │493 + const target_path = (try repoOnDiskPath(io, allocator, temp_path, "target", true)).?; │ │494 defer allocator.free(target_path); │ │495 { │ │496 var target_repo = try rp.Repo(.xit, .{}).init(io, allocator, .{ .bare = true, .path = target_path });│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │498 _ = try commitServer(&target_repo, io, allocator, .{ .files = &.{.{ .path = "main.txt", .content = "base contents\n" }} }, .{ .author = "admin <admin@example.test>", .message = "initial code" });│ │499 } │ │500 │ │525 - const other_path = (try repoOnDiskPath(io, allocator, temp_dir_name, "other", true)).?; │ │501 + const other_path = (try repoOnDiskPath(io, allocator, temp_path, "other", true)).?; │ │502 defer allocator.free(other_path); │ │503 │ │528 - const cwd_path = try std.process.currentPathAlloc(io, allocator); │ │529 - defer allocator.free(cwd_path); │ │530 - const admin_path = try std.fs.path.join(allocator, &.{ cwd_path, temp_dir_name, "admin" }); │ │504 + const admin_path = try std.fs.path.join(allocator, &.{ temp_path, "admin" }); │ │505 defer allocator.free(admin_path); │ │532 - const repos_dir = try std.fs.path.join(allocator, &.{ cwd_path, temp_dir_name, "repos" }); │ │506 + const repos_dir = try std.fs.path.join(allocator, &.{ temp_path, "repos" }); │ │507 defer allocator.free(repos_dir); │ │508 │ │509 var prng = std.Random.DefaultPrng.init(std.testing.random_seed); │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────╮ │534 }; │ │535 defer allocator.free(draft_path); │ │536 │ │563 - const client_path = try std.fs.path.join(allocator, &.{ cwd_path, temp_dir_name, "client" });│ │537 + const client_path = try std.fs.path.join(allocator, &.{ temp_path, "client" }); │ │538 defer allocator.free(client_path); │ │565 - const ssh_cmd = (try sshCommand(true, allocator, cwd_path, temp_dir_name, port)).?; │ │539 + const ssh_cmd = (try sshCommand(true, allocator, temp_path, port)).?; │ │540 defer allocator.free(ssh_cmd); │ │541 var client = try rp.Repo(.xit, .{ .is_test = true }).clone( │ │542 io, │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │755 defer admin.deinit(io, allocator); │ │756 try evt.remove(.admin, .xit, evt.admin_repo_opts, io, allocator, &admin, &repo_id, .repo, .{ .name = "admin", .email = "admin@example.test" });│ │757 } │ │784 - const clone_path = try std.fs.path.join(allocator, &.{ cwd_path, temp_dir_name, "fork-clone" }); │ │758 + const clone_path = try std.fs.path.join(allocator, &.{ temp_path, "fork-clone" }); │ │759 defer allocator.free(clone_path); │ │760 var fork_clone = try rp.Repo(.xit, .{ .is_test = true }).clone( │ │761 io, │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │811 io: std.Io, │ │812 allocator: std.mem.Allocator, │ │813 ) !void { │ │840 - const temp_dir_name = "temp-testnet-push-create"; │ │814 + var temp = std.testing.tmpDir(.{}); │ │815 + defer temp.cleanup(); │ │816 + const temp_path = try temp.dir.realPathFileAlloc(io, ".", allocator); │ │817 + defer allocator.free(temp_path); │ │818 │ │842 - const cwd = std.Io.Dir.cwd(); │ │843 - var temp_dir_or_err = cwd.openDir(io, temp_dir_name, .{}); │ │844 - if (temp_dir_or_err) |*temp_dir| { │ │845 - temp_dir.close(io); │ │846 - try cwd.deleteTree(io, temp_dir_name); │ │847 - } else |_| {} │ │848 - var temp_dir = try cwd.createDirPathOpen(io, temp_dir_name, .{}); │ │849 - defer cwd.deleteTree(io, temp_dir_name) catch {}; │ │850 - defer temp_dir.close(io); │ │851 - │ │852 - var server_process = try runServer(io, allocator, temp_dir_name, port); │ │819 + var server_process = try runServer(io, allocator, temp_path, port); │ │820 defer _ = server_process.kill(io); │ │854 - │ │855 - const cwd_path = try std.process.currentPathAlloc(io, allocator); │ │856 - defer allocator.free(cwd_path); │ │821 │ │858 - const client_path = try std.fs.path.join(allocator, &.{ cwd_path, temp_dir_name, "client" }); │ │822 + const client_path = try std.fs.path.join(allocator, &.{ temp_path, "client" }); │ │823 defer allocator.free(client_path); │ │824 │ │825 var client_repo = try rp.Repo(repo_kind, .{ .is_test = true }).init(io, allocator, .{ .path = client_path });│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────╮ │849 .file => false, │ │850 .wire => |wire_kind| .ssh == wire_kind, │ │851 }; │ │888 - const ssh_cmd_maybe = try sshCommand(is_ssh, allocator, cwd_path, temp_dir_name, port);│ │852 + const ssh_cmd_maybe = try sshCommand(is_ssh, allocator, temp_path, port); │ │853 defer if (ssh_cmd_maybe) |ssh_cmd| allocator.free(ssh_cmd); │ │854 │ │855 try client_repo.push( │ ╰────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │864 ); │ │865 │ │866 // the push registered admin/server; resolve its on-disk directory │ │903 - const server_path = (try repoOnDiskPath(io, allocator, temp_dir_name, "testrepo", false)).?; │ │867 + const server_path = (try repoOnDiskPath(io, allocator, temp_path, "testrepo", false)).?; │ │868 defer allocator.free(server_path); │ │869 │ │870 var server_repo = try rp.Repo(.xit, .{ .is_test = true }).open(io, allocator, .{ .path = server_path });│ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯