Skip to content

[deckhouse-cli] Fix pull tests leaving bundle artifacts #342

Open
Glitchy-Sheep wants to merge 1 commit intomainfrom
fix/mirror-pull-tests-generates-extra-files
Open

[deckhouse-cli] Fix pull tests leaving bundle artifacts #342
Glitchy-Sheep wants to merge 1 commit intomainfrom
fix/mirror-pull-tests-generates-extra-files

Conversation

@Glitchy-Sheep
Copy link
Copy Markdown
Contributor

[mirror] Fix pull tests leaving bundle artifacts in the working tree

Summary

Pull tests called newPullService without setting BundleDir, so each go test run dropped bundle files into the repo working tree instead of a temp dir.

2026-04-29 AT 23 00

Fix

newPullService now fills BundleDir with t.TempDir() when callers leave it empty (and creates the options struct if nil).
Tests that need a specific path still override it.

Before / After

Before: go test ./internal/mirror/... left untracked bundle files in the working tree.
After: Each test gets its own t.TempDir(), cleaned up by Go automatically.

- `newPullService` now allocates a `t.TempDir()` when `BundleDir` is empty, so tests don't drop artifacts into the working tree.

Signed-off-by: Roman Berezkin <roman.berezkin@flant.com>
@Glitchy-Sheep Glitchy-Sheep self-assigned this Apr 29, 2026
@Glitchy-Sheep Glitchy-Sheep added the bug Something isn't working label Apr 29, 2026
@Glitchy-Sheep Glitchy-Sheep marked this pull request as ready for review April 29, 2026 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant