1
0
Fork 0
mirror of https://github.com/imjasonh/krust synced 2026-07-08 06:45:32 +00:00

fix: Handle cross-compilation failures in platform detection test

The test now accepts linker errors as expected behavior when building
for detected platforms that lack cross-compilation toolchains on the
current runner (e.g., ARM runners without x86_64 toolchains).

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Jason Hall 2025-06-08 00:17:10 -04:00
parent 1f730645c3
commit 80656aa225
Failed to extract signature
2 changed files with 18 additions and 24 deletions

View file

@ -355,12 +355,24 @@ fn test_platform_detection_from_base_image() -> Result<()> {
// The default base image (cgr.dev/chainguard/static:latest) supports multiple platforms
// so we should see platform detection happening
cmd.assert()
.success()
.stderr(predicate::str::contains(
"Detecting available platforms from base image",
))
.stderr(predicate::str::contains("Detected platforms"));
let output = cmd.output()?;
let stderr = String::from_utf8_lossy(&output.stderr);
// We should always see platform detection
assert!(stderr.contains("Detecting available platforms from base image"));
assert!(stderr.contains("Detected platforms"));
// The build might fail if we don't have all cross-compilation toolchains
// (e.g., on ARM runners trying to build for x86_64)
if !output.status.success() {
assert!(
stderr.contains("linker")
|| stderr.contains("target may not be installed")
|| stderr.contains("cross-compilation"),
"Build failed for unexpected reason: {}",
stderr
);
}
Ok(())
}