Compare commits

...

2 Commits

Author SHA1 Message Date
Emil Lerch e74a0e9456
get build LLVM-approved (riscv64-linux disabled for now)
aws-zig mach nominated build / build-zig-nominated-mach-latest (push) Failing after 3m8s Details
aws-zig nightly build / build-zig-nightly (push) Failing after 1m0s Details
2024-04-02 17:49:45 -07:00
Emil Lerch 723e0b0989
add commented out "normal test" pattern 2024-04-02 17:47:50 -07:00
6 changed files with 36 additions and 9 deletions

View File

@ -32,7 +32,7 @@ jobs:
tar x -C /usr/local -f zig-linux-${ARCH}-${ZIG_VERSION}.tar.xz
ln -s /usr/local/zig-linux-${ARCH}-${ZIG_VERSION}/zig /usr/local/bin/zig
- name: Run tests
run: zig build -j1 test --verbose
run: zig build test --verbose
- name: Build example
run: ( cd example && zig build ) # Make sure example builds
# Zig package manager expects everything to be inside a directory in the archive,

View File

@ -35,7 +35,7 @@ jobs:
ln -s /usr/local/"${file%%.tar.xz}"/zig /usr/local/bin/zig
zig version
- name: Run tests
run: zig build -j1 test --verbose
run: zig build test --verbose
- name: Build example
run: ( cd example && zig build ) # Make sure example builds
# Zig package manager expects everything to be inside a directory in the archive,

View File

@ -33,7 +33,7 @@ jobs:
ln -s /usr/local/"${file%%.tar.xz}"/zig /usr/local/bin/zig
zig version
- name: Run tests
run: zig build -j1 test --verbose
run: zig build test --verbose
- name: Build example
run: ( cd example && zig build ) # Make sure example builds
# Zig package manager expects everything to be inside a directory in the archive,

View File

@ -17,15 +17,19 @@ Current executable size for the demo is 980k after compiling with -Doptimize=Rel
in x86_linux, and will vary based on services used. Tested targets:
* x86_64-linux
* riscv64-linux
* riscv64-linux\*
* aarch64-linux
* x86_64-windows
* x86_64-windows\*\*
* arm-linux
* aarch64-macos
* x86_64-macos
Tested targets are built, but not continuously tested, by CI.
\* On Zig 0.12, riscv64-linux tests get stuck forever in "LLVM Emit object"
\*\* On Zig 0.12, x86_64-windows tests have one test skipped as LLVM consumes all available RAM on the system
Zig-Develop Branch
------------------

View File

@ -14,10 +14,12 @@ const test_targets = [_]std.zig.CrossTarget{
.cpu_arch = .aarch64,
.os_tag = .linux,
},
.{
.cpu_arch = .riscv64,
.os_tag = .linux,
},
// // The test executable just spins forever in LLVM using nominated zig 0.12 March 2024
// // This is likely a LLVM problem unlikely to be fixed in zig 0.12
// .{
// .cpu_arch = .riscv64,
// .os_tag = .linux,
// },
.{
.cpu_arch = .arm,
.os_tag = .linux,
@ -171,6 +173,20 @@ pub fn build(b: *Builder) !void {
// running the unit tests.
const test_step = b.step("test", "Run unit tests");
// // Creates a step for unit testing. This only builds the test executable
// // but does not run it.
// const unit_tests = b.addTest(.{
// .root_source_file = .{ .path = "src/aws.zig" },
// .target = target,
// .optimize = optimize,
// });
// unit_tests.root_module.addImport("smithy", smithy_dep.module("smithy"));
// unit_tests.step.dependOn(gen_step);
//
// const run_unit_tests = b.addRunArtifact(unit_tests);
// run_unit_tests.skip_foreign_checks = true;
// test_step.dependOn(&run_unit_tests.step);
for (test_targets) |t| {
// Creates a step for unit testing. This only builds the test executable
// but does not run it.

View File

@ -1,3 +1,4 @@
const builtin = @import("builtin");
const std = @import("std");
const awshttp = @import("aws_http.zig");
@ -1898,7 +1899,13 @@ test "ec2_query_no_input: EC2 describe regions" {
try std.testing.expectEqualStrings("4cdbdd69-800c-49b5-8474-ae4c17709782", call.response_metadata.request_id);
try std.testing.expectEqual(@as(usize, 17), call.response.regions.?.len);
}
// LLVM hates this test. Depending on the platform, it will consume all memory
// on the compilation host. Windows x86_64 and Linux riscv64 seem to be a problem so far
// riscv64-linux also seems to have another problem with LLVM basically infinitely
// doing something. My guess is the @embedFile is freaking out LLVM
test "ec2_query_with_input: EC2 describe instances" {
if (builtin.cpu.arch == .x86_64 and builtin.os.tag == .windows) return error.SkipZigTest;
if (builtin.cpu.arch == .riscv64 and builtin.os.tag == .linux) return error.SkipZigTest;
const allocator = std.testing.allocator;
var test_harness = TestSetup.init(.{
.allocator = allocator,