image-builder: update TestBuildIntegrationErrors tests

This commit updates the tests for the error reporting. Since
we are now using the new "progress" module we can no longer
directly mock osStderr. So this now uses the new testutil
helper `CaptureStdio`.

Note also that the behavior of `verbose` and `term` is slightly
different - for backward compatibility in `verbose` mode the
stderr from osbuild is directly connected to the caller stderr.

For term mode this is not done to prevent spurious message from
leaking into the terminal progress and the full error is available
from the actual go error as captured output.
This commit is contained in:
Michael Vogt 2025-01-29 12:56:22 +01:00
parent e41cf0e429
commit f46ca14f85
3 changed files with 53 additions and 18 deletions

2
go.sum
View file

@ -220,6 +220,8 @@ github.com/opencontainers/selinux v1.11.0 h1:+5Zbo97w3Lbmb3PeqQtpmTkMwsW5nRI3YaL
github.com/opencontainers/selinux v1.11.0/go.mod h1:E5dMC3VPuVvVHDYmi78qvhJp8+M586T4DlDRYpFkyec=
github.com/osbuild/bootc-image-builder/bib v0.0.0-20250125114430-c5d674173ba0 h1:aLxeLEO/C6/mAc4O8fgmDE7uaf6EwAiW79IP2GI/bvo=
github.com/osbuild/bootc-image-builder/bib v0.0.0-20250125114430-c5d674173ba0/go.mod h1:22erXOiwfznPLNE5Y8hp35fnE0vh5ZjWp/iIQsVnYTg=
github.com/osbuild/bootc-image-builder/bib v0.0.0-20250128074618-f6403409fc97 h1:Xyv+vDEGCcG1qkHkdQFPBXhvM5WiMiAJm/AjBkzW4Sw=
github.com/osbuild/bootc-image-builder/bib v0.0.0-20250128074618-f6403409fc97/go.mod h1:22erXOiwfznPLNE5Y8hp35fnE0vh5ZjWp/iIQsVnYTg=
github.com/osbuild/images v0.112.0 h1:+pKwPniwYTRRgist6V+7DQfZEg7osddl1z4pASecq4M=
github.com/osbuild/images v0.112.0/go.mod h1:58tzp7jV50rjaH9gMpvmQdVati0c4TaC5Op7wmSD/tY=
github.com/ostreedev/ostree-go v0.0.0-20210805093236-719684c64e4f h1:/UDgs8FGMqwnHagNDPGOlts35QkhAZ8by3DR7nMih7M=