test(env): pin BurstLimit so the bare-value assertion is hermetic

TestEnvOutputDefault asserted the literal default '100', so an ambient
HELM_BURST_LIMIT in the test process environment would fail the run and
the assertion was coupled to the current default value. Pin
settings.BurstLimit for the single-variable check instead.

Suggested by the Copilot review on #32282.

Signed-off-by: Ruslan Shaydullin <shaydullin.r.d@outlook.com>
pull/32282/head
Ruslan Shaydullin 1 day ago
parent 17c1d0390e
commit b39ce53e7a

@ -62,12 +62,18 @@ func TestEnvOutputDefault(t *testing.T) {
}
// Single-variable mode without --output keeps printing the bare value.
// Pin BurstLimit so the expected value cannot drift with the ambient
// HELM_BURST_LIMIT of the test process.
oldBurstLimit := settings.BurstLimit
settings.BurstLimit = 150
t.Cleanup(func() { settings.BurstLimit = oldBurstLimit })
_, out, err = executeActionCommand("env HELM_BURST_LIMIT")
if err != nil {
t.Fatal(err)
}
if out != "100\n" {
t.Errorf("expected %q, got %q", "100\n", out)
if out != "150\n" {
t.Errorf("expected %q, got %q", "150\n", out)
}
}

Loading…
Cancel
Save