also looking at this
test: make CI exercise maintained integrations
#18
16 files
+390
-139
| @@ -8,7 +8,7 @@ pub fn example_per_test_timeout() !void { | ||
| 8 | 8 | const fastTest = struct { |
| 9 | 9 | fn run(alloc: std.mem.Allocator) !void { |
| 10 | 10 | _ = alloc; |
| 11 | std.Thread.sleep(50 * std.time.ns_per_ms); | |
| 11 | zig_test.compat.sleep(50 * std.time.ns_per_ms); | |
| 12 | 12 | std.debug.print("Fast test completed\n", .{}); |
| 13 | 13 | } |
| 14 | 14 | }.run; |
renamed throughout · 16 hidden lines
| @@ -26,14 +26,14 @@ pub fn example_suite_timeout() !void { renamed throughout | ||
| 26 | 26 | const test1 = struct { |
| 27 | 27 | fn run(alloc: std.mem.Allocator) !void { |
| 28 | 28 | _ = alloc; |
| 29 | std.Thread.sleep(100 * std.time.ns_per_ms); | |
| 29 | zig_test.compat.sleep(100 * std.time.ns_per_ms); | |
| 30 | 30 | } |
| 31 | 31 | }.run; |
| 32 | 32 | |
| 33 | 33 | const test2 = struct { |
| 34 | 34 | fn run(alloc: std.mem.Allocator) !void { |
| 35 | 35 | _ = alloc; |
| 36 | std.Thread.sleep(100 * std.time.ns_per_ms); | |
| 36 | zig_test.compat.sleep(100 * std.time.ns_per_ms); | |
| 37 | 37 | } |
| 38 | 38 | }.run; |
| 39 | 39 | |
| @@ -60,7 +60,7 @@ pub fn example_timeout_context() !void { | ||
| 60 | 60 | std.debug.print("Timeout context started with 1000ms timeout\n", .{}); |
| 61 | 61 | |
| 62 | 62 | // Simulate some work |
| 63 | std.Thread.sleep(200 * std.time.ns_per_ms); | |
| 63 | zig_test.compat.sleep(200 * std.time.ns_per_ms); | |
| 64 | 64 | |
| 65 | 65 | if (!context.isTimedOut()) { |
| 66 | 66 | std.debug.print("Still within timeout, elapsed: {d}ms, remaining: {d}ms\n", .{ |
renamed throughout · 16 hidden lines
| @@ -88,14 +88,14 @@ pub fn example_timeout_extension() !void { renamed throughout | ||
| 88 | 88 | std.debug.print("Started with 500ms timeout\n", .{}); |
| 89 | 89 | |
| 90 | 90 | // Simulate work |
| 91 | std.Thread.sleep(400 * std.time.ns_per_ms); | |
| 91 | zig_test.compat.sleep(400 * std.time.ns_per_ms); | |
| 92 | 92 | |
| 93 | 93 | // Need more time! |
| 94 | 94 | try context.extend(500); |
| 95 | 95 | std.debug.print("Extended timeout by 500ms (total: 1000ms)\n", .{}); |
| 96 | 96 | |
| 97 | 97 | // Continue work |
| 98 | std.Thread.sleep(300 * std.time.ns_per_ms); | |
| 98 | zig_test.compat.sleep(300 * std.time.ns_per_ms); | |
| 99 | 99 | |
| 100 | 100 | if (!context.isTimedOut()) { |
| 101 | 101 | std.debug.print("Completed within extended timeout\n", .{}); |
| @@ -165,7 +165,7 @@ pub fn example_timeout_monitoring() !void { | ||
| 165 | 165 | std.debug.print("Registered context with 500ms timeout\n", .{}); |
| 166 | 166 | |
| 167 | 167 | // Simulate work |
| 168 | std.Thread.sleep(600 * std.time.ns_per_ms); | |
| 168 | zig_test.compat.sleep(600 * std.time.ns_per_ms); | |
| 169 | 169 | |
| 170 | 170 | // Check if timed out |
| 171 | 171 | if (context.isTimedOut()) { |
renamed throughout · 13 hidden lines
| @@ -190,11 +190,11 @@ pub fn example_suite_tracker() !void { renamed throughout | ||
| 190 | 190 | |
| 191 | 191 | // Run some tests |
| 192 | 192 | tracker.incrementTest(); |
| 193 | std.Thread.sleep(200 * std.time.ns_per_ms); | |
| 193 | zig_test.compat.sleep(200 * std.time.ns_per_ms); | |
| 194 | 194 | tracker.incrementCompleted(); |
| 195 | 195 | |
| 196 | 196 | tracker.incrementTest(); |
| 197 | std.Thread.sleep(200 * std.time.ns_per_ms); | |
| 197 | zig_test.compat.sleep(200 * std.time.ns_per_ms); | |
| 198 | 198 | tracker.incrementCompleted(); |
| 199 | 199 | |
| 200 | 200 | std.debug.print("Tests run: {d}/{d}\n", .{ tracker.completed_count, tracker.test_count }); |
| @@ -240,7 +240,7 @@ pub fn example_async_with_timeout() !void { | ||
| 240 | 240 | const asyncTest = struct { |
| 241 | 241 | fn run(alloc: std.mem.Allocator) !void { |
| 242 | 242 | _ = alloc; |
| 243 | std.Thread.sleep(100 * std.time.ns_per_ms); | |
| 243 | zig_test.compat.sleep(100 * std.time.ns_per_ms); | |
| 244 | 244 | std.debug.print("Async test completed\n", .{}); |
| 245 | 245 | } |
| 246 | 246 | }.run; |
renamed throughout · 14 hidden lines
| @@ -258,12 +258,12 @@ pub fn example_timeout_result() !void { renamed throughout | ||
| 258 | 258 | var context = zig_test.TimeoutContext.init(allocator, 1000); |
| 259 | 259 | context.start(); |
| 260 | 260 | |
| 261 | std.Thread.sleep(150 * std.time.ns_per_ms); | |
| 261 | zig_test.compat.sleep(150 * std.time.ns_per_ms); | |
| 262 | 262 | |
| 263 | 263 | // Extend timeout |
| 264 | 264 | try context.extend(500); |
| 265 | 265 | |
| 266 | std.Thread.sleep(100 * std.time.ns_per_ms); | |
| 266 | zig_test.compat.sleep(100 * std.time.ns_per_ms); | |
| 267 | 267 | |
| 268 | 268 | context.complete(); |
| 269 | 269 | |