mirror of
https://github.com/helmfile/helmfile.git
synced 2026-10-04 18:13:15 +02:00
* Create DeleteWait and DeleteTimeout parameters Signed-off-by: Virginia Tavares <briosovirginia@gmail.com> * Create tests for deleteWait and deleteTimeout Signed-off-by: Virginia Tavares <briosovirginia@gmail.com> * build(deps): bump github.com/aws/aws-sdk-go from 1.48.6 to 1.48.7 (#1176) Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.48.6 to 1.48.7. - [Release notes](https://github.com/aws/aws-sdk-go/releases) - [Commits](https://github.com/aws/aws-sdk-go/compare/v1.48.6...v1.48.7) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update temp_test.go with DeleteWait and DeleteTimeout Signed-off-by: Virginia Tavares <briosovirginia@gmail.com> * Create deleteWait function in state.go Signed-off-by: Virginia Tavares <briosovirginia@gmail.com> * Fix comments from review Signed-off-by: Virginia Tavares <briosovirginia@gmail.com> --------- Signed-off-by: Virginia Tavares <briosovirginia@gmail.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Virginia Tavares <virginia.tavares@ericsson.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
82 lines
1.6 KiB
Go
82 lines
1.6 KiB
Go
package state
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/google/go-cmp/cmp"
|
|
)
|
|
|
|
func TestGenerateID(t *testing.T) {
|
|
type testcase struct {
|
|
subject string
|
|
release ReleaseSpec
|
|
data any
|
|
want string
|
|
}
|
|
|
|
ids := map[string]int{}
|
|
|
|
run := func(tc testcase) {
|
|
t.Helper()
|
|
|
|
t.Run(tc.subject, func(t *testing.T) {
|
|
t.Helper()
|
|
|
|
got, err := generateValuesID(&tc.release, tc.data)
|
|
if err != nil {
|
|
t.Fatalf("uenxpected error: %v", err)
|
|
}
|
|
|
|
if d := cmp.Diff(tc.want, got); d != "" {
|
|
t.Fatalf("unexpected result: want (-), got (+):\n%s", d)
|
|
}
|
|
|
|
ids[got]++
|
|
})
|
|
}
|
|
|
|
run(testcase{
|
|
subject: "baseline",
|
|
release: ReleaseSpec{Name: "foo", Chart: "incubator/raw"},
|
|
want: "foo-values-b5df4fc58",
|
|
})
|
|
|
|
run(testcase{
|
|
subject: "different bytes content",
|
|
release: ReleaseSpec{Name: "foo", Chart: "incubator/raw"},
|
|
data: []byte(`{"k":"v"}`),
|
|
want: "foo-values-5bd95d98d5",
|
|
})
|
|
|
|
run(testcase{
|
|
subject: "different map content",
|
|
release: ReleaseSpec{Name: "foo", Chart: "incubator/raw"},
|
|
data: map[string]any{"k": "v"},
|
|
want: "foo-values-5cb8d75d9f",
|
|
})
|
|
|
|
run(testcase{
|
|
subject: "different chart",
|
|
release: ReleaseSpec{Name: "foo", Chart: "stable/envoy"},
|
|
want: "foo-values-5f6b44cff5",
|
|
})
|
|
|
|
run(testcase{
|
|
subject: "different name",
|
|
release: ReleaseSpec{Name: "bar", Chart: "incubator/raw"},
|
|
want: "bar-values-546889667f",
|
|
})
|
|
|
|
run(testcase{
|
|
subject: "specific ns",
|
|
release: ReleaseSpec{Name: "foo", Chart: "incubator/raw", Namespace: "myns"},
|
|
want: "myns-foo-values-78f4c8794f",
|
|
})
|
|
|
|
for id, n := range ids {
|
|
if n > 1 {
|
|
t.Fatalf("too many occurrences of %s: %d", id, n)
|
|
}
|
|
}
|
|
}
|