Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

main: fix auto-detected distro that is non-visible, tweak order #124

Merged
merged 1 commit into from
Feb 4, 2025

Conversation

mvo5
Copy link
Collaborator

@mvo5 mvo5 commented Feb 4, 2025

This commit fixes the issue that the auto-detect distro is not visible in the progress message. It also tweaks the order of the message to show:

Building manifest for <distro>-<img-type>

to be more conistent.

Closes: #121

Note that there is a small tweak needed in the progress library, then this can be properly tested:

func TestManifestIntegrationAutodetectDistro(t *testing.T) {
	if testing.Short() {
		t.Skip("manifest generation takes a while")
	}
	if !hasDepsolveDnf() {
		t.Skip("no osbuild-depsolve-dnf binary found")
	}

	restore := main.MockNewRepoRegistry(testrepos.New)
	defer restore()

	script := `cat - > "$0".stdin`
	fakeOsbuildCmd := testutil.MockCommand(t, "osbuild", script)
	defer fakeOsbuildCmd.Restore()

	restore = main.MockDistroGetHostDistroName(func() (string, error) {
		return "centos-9", nil
	})
	defer restore()

	restore = main.MockOsArgs([]string{
		"build",
		"qcow2",
		"--arch=x86_64",
		"--progress=debug",
	})
	defer restore()

	var fakeStdout bytes.Buffer
	restore = main.MockOsStdout(&fakeStdout)
	defer restore()

	var err error
	_, stderr := testutil.CaptureStdio(t, func() {
		err = main.Run()
	})
	assert.NoError(t, err)
	assert.Contains(t, stderr, "msg: Building manifest for centos-9-qcow2")
}

This commit fixes the issue that the auto-detect distro is not
visible in the progress message. It also tweaks the order of
the message to show:
```
Building manifest for <distro>-<img-type>
```
to be more conistent.

Closes: osbuild#121
Copy link
Member

@ondrejbudai ondrejbudai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick fix!

@ondrejbudai ondrejbudai added this pull request to the merge queue Feb 4, 2025
Merged via the queue into osbuild:main with commit 24dc23a Feb 4, 2025
27 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Progress bar message doesn't show the distro version if --distro isn't given
2 participants