╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ───────╮ │src/test/net.zig│ ╰────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────╮ │145 defer temp_dir.close(io); │ │146 │ │147 // init server │ │240 - var server = try Server(transport_def, temp_dir_name, port).init(io, allocator);│ │241 - try server.start(); │ │242 - defer server.stop(); │ │148 + var server_process = try runServer(io, allocator, temp_dir_name); │ │149 + defer _ = server_process.kill(io); │ │150 │ │151 const cwd_path = try std.process.currentPathAlloc(io, allocator); │ │152 defer allocator.free(cwd_path); │ ╰─────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │194 //.file => try std.fmt.allocPrint(allocator, "file://{s}{s}", .{ separator, server_path }), │ │195 .file => try std.fmt.allocPrint(allocator, "../server", .{}), // relative file paths work too │ │196 .wire => |wire_kind| switch (wire_kind) { │ │290 - .http => try std.fmt.allocPrint(allocator, "http://localhost:{}/server", .{port}), │ │291 - .raw => try std.fmt.allocPrint(allocator, "git://localhost:{}/server", .{port}), │ │292 - .ssh => try std.fmt.allocPrint(allocator, "ssh://localhost:{}{s}{s}", .{ port, separator, server_path }), │ │197 + .http => try std.fmt.allocPrint(allocator, "http://localhost:{}/server", .{http_port}), │ │198 + .raw => try std.fmt.allocPrint(allocator, "git://localhost:{}/server", .{http_port}), │ │199 + .ssh => try std.fmt.allocPrint(allocator, "ssh://localhost:{}{s}{s}", .{ ssh_port, separator, server_path }),│ │200 }, │ │201 }; │ │202 defer allocator.free(remote_url); │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │220 }; │ │221 // haxy generates a fresh host key on every run, so don't try to record │ │222 // it. accept the unknown host and skip writing to known_hosts. the key │ │316 - // identity flag picks the ed25519 key created in Server.init. │ │223 + // identity flag picks the ed25519 key created in runServer. │ │224 const ssh_cmd_maybe: ?[]const u8 = if (is_ssh) blk: { │ │225 const priv_key_path = try std.fs.path.join(allocator, &.{ cwd_path, temp_dir_name, "key" });│ │226 defer allocator.free(priv_key_path); │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────╮ │229 } else null; │ │230 defer if (ssh_cmd_maybe) |ssh_cmd| allocator.free(ssh_cmd);│ │231 │ │325 - │ │232 try client_repo.fetch( │ │233 io, │ │234 allocator, │ ╰────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────╮ │287 fn testPush( │ │288 comptime repo_kind: rp.RepoKind, │ │289 comptime transport_def: net.TransportDefinition,│ │384 - comptime port: u16, │ │290 io: std.Io, │ │291 allocator: std.mem.Allocator, │ │292 ) !void { │ ╰─────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────╮ │304 defer temp_dir.close(io); │ │305 │ │306 // init server │ │402 - var server = try Server(transport_def, temp_dir_name, port).init(io, allocator);│ │403 - try server.start(); │ │404 - defer server.stop(); │ │307 + var server_process = try runServer(io, allocator, temp_dir_name); │ │308 + defer _ = server_process.kill(io); │ │309 │ │310 const cwd_path = try std.process.currentPathAlloc(io, allocator); │ │311 defer allocator.free(cwd_path); │ ╰─────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │361 //.file => try std.fmt.allocPrint(allocator, "file://{s}{s}", .{ separator, server_path }), │ │362 .file => try std.fmt.allocPrint(allocator, "../server", .{}), // relative file paths work too │ │363 .wire => |wire_kind| switch (wire_kind) { │ │460 - .http => try std.fmt.allocPrint(allocator, "http://localhost:{}/server", .{port}), │ │461 - .raw => try std.fmt.allocPrint(allocator, "git://localhost:{}/server", .{port}), │ │462 - .ssh => try std.fmt.allocPrint(allocator, "ssh://localhost:{}{s}{s}", .{ port, separator, server_path }), │ │364 + .http => try std.fmt.allocPrint(allocator, "http://localhost:{}/server", .{http_port}), │ │365 + .raw => try std.fmt.allocPrint(allocator, "git://localhost:{}/server", .{http_port}), │ │366 + .ssh => try std.fmt.allocPrint(allocator, "ssh://localhost:{}{s}{s}", .{ ssh_port, separator, server_path }),│ │367 }, │ │368 }; │ │369 defer allocator.free(remote_url); │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │382 }; │ │383 // haxy generates a fresh host key on every run, so don't try to record │ │384 // it. accept the unknown host and skip writing to known_hosts. the key │ │481 - // identity flag picks the ed25519 key created in Server.init. │ │385 + // identity flag picks the ed25519 key created in runServer. │ │386 const ssh_cmd_maybe: ?[]const u8 = if (is_ssh) blk: { │ │387 const priv_key_path = try std.fs.path.join(allocator, &.{ cwd_path, temp_dir_name, "key" });│ │388 defer allocator.free(priv_key_path); │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────╮ │391 } else null; │ │392 defer if (ssh_cmd_maybe) |ssh_cmd| allocator.free(ssh_cmd);│ │393 │ │490 - │ │394 try client_repo.push( │ │395 io, │ │396 allocator, │ ╰────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────╮ │502 true, │ │503 .{ .wire = .{ .ssh = .{ │ │504 .command = ssh_cmd_maybe, │ │602 - } } }, │ │505 + } } }, │ │506 ); │ │507 │ │508 // verify the server ref was not updated (push was denied)│ ╰───────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯