1
0
Fork 0
mirror of https://github.com/zigzap/zap.git synced 2025-10-20 07:04:08 +00:00

fix tests on gh

This commit is contained in:
renerocksai 2025-08-28 22:56:37 +02:00
parent ecb03cb90e
commit 729a614c30
No known key found for this signature in database
3 changed files with 10 additions and 10 deletions

View file

@ -18,21 +18,22 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: goto-bus-stop/setup-zig@v2 - uses: goto-bus-stop/setup-zig@v2
with: with:
version: 0.14.0 version: 0.15.1
- name: Check zig version - name: Check zig version
run: zig version run: zig version
- name: Build all examples - name: Build all examples
run: zig build all run: zig build all
# Run tests separately so we can see more clearly which one fails # Run tests separately so we can see more clearly which one fails
# Also, the test runner tries to run tests concurrently, which causes # Also, the test runner tries to run tests concurrently, which causes
# conflicts when port numbers are re-used in the tests # conflicts when port numbers are re-used in the tests (which they aren't
# anymore)
- name: Run mustache tests - name: Run mustache tests
run: zig build test-mustache run: zig build test-mustache
- name: Run httpparams tests - name: Run httpparams tests
run: zig build test-httpparams run: zig build test-http_params
- name: Run sendfile tests - name: Run sendfile tests
run: zig build test-sendfile run: zig build test-sendfile
- name: Run authentication tests - name: Run authentication tests
run: zig build test-authentication run: zig build test-auth
- name: Report end of tests - name: Report end of tests
run: echo "tests finished" run: echo "tests finished"

View file

@ -31,11 +31,10 @@ jobs:
- name: Run mustache tests - name: Run mustache tests
run: zig build test-mustache run: zig build test-mustache
- name: Run httpparams tests - name: Run httpparams tests
run: zig build test-httpparams run: zig build test-http_params
- name: Run sendfile tests - name: Run sendfile tests
run: zig build test-sendfile run: zig build test-sendfile
- name: Run authentication tests - name: Run authentication tests
run: zig build test-authentication run: zig build test-auth
- name: Report end of tests - name: Report end of tests
run: echo "tests finished" run: echo "tests finished"

View file

@ -22,7 +22,7 @@ const TestSystem = struct {
}); });
tests.root_module.addImport("zap", self.zap_module); tests.root_module.addImport("zap", self.zap_module);
const step = self.b.step(self.b.fmt("test{s}", .{test_name}), self.b.fmt("Run {s} unit tests [REMOVE zig-cache!]", .{test_name})); const step = self.b.step(self.b.fmt("test-{s}", .{test_name}), self.b.fmt("Run {s} unit tests [REMOVE zig-cache!]", .{test_name}));
self.addRunInstallToStep(tests, step); self.addRunInstallToStep(tests, step);
} }
@ -170,7 +170,7 @@ pub fn build(b: *std.Build) !void {
// we can call it again when needed. // we can call it again when needed.
const test_step = b.step("test", "Run unit tests"); const test_step = b.step("test", "Run unit tests");
const test_system = TestSystem {.b = b, .zap_module = zap_module, .target = target, .optimize = optimize, .combine_test_step = test_step}; const test_system = TestSystem{ .b = b, .zap_module = zap_module, .target = target, .optimize = optimize, .combine_test_step = test_step };
// authentication tests // authentication tests
test_system.addTest("src/tests/test_auth.zig", "auth"); test_system.addTest("src/tests/test_auth.zig", "auth");
// mustache tests // mustache tests
@ -185,7 +185,7 @@ pub fn build(b: *std.Build) !void {
// dependencies have changed. // dependencies have changed.
// So, for now, we just force the exe to be built, so in order that // So, for now, we just force the exe to be built, so in order that
// we can call it again when needed. // we can call it again when needed.
// //
// docserver // docserver
const docserver_mod = b.addModule("docserver", .{ const docserver_mod = b.addModule("docserver", .{