Skip to content

Commit

Permalink
Order tests and assert pass vs failed
Browse files Browse the repository at this point in the history
  • Loading branch information
jguionnet committed Dec 12, 2023
1 parent a13cede commit ffefe30
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions test/helm_keda_remote_example_template_snapshot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import (

// An example of how to verify the rendered template object of a Helm Chart given various inputs.
func TestHelmKedaRemoteExampleTemplateRenderedDeploymentDump(t *testing.T) {
t.Parallel()

// chart name
releaseName := "keda"
Expand Down Expand Up @@ -74,7 +73,6 @@ func TestHelmKedaRemoteExampleTemplateRenderedDeploymentDump(t *testing.T) {

// An example of how to verify the rendered template object of a Helm Chart given various inputs.
func TestHelmKedaRemoteExampleTemplateRenderedDeploymentDiff(t *testing.T) {
t.Parallel()

// chart name
releaseName := "keda"
Expand Down Expand Up @@ -114,12 +112,11 @@ func TestHelmKedaRemoteExampleTemplateRenderedDeploymentDiff(t *testing.T) {

// run the diff and assert the number of diffs
number_of_diffs := helm.DiffAgainstSnapshot(output, releaseName)
require.Equal(t, number_of_diffs, 0)
require.Equal(t, 4, number_of_diffs)
}

// An example of how to store a snapshot of the current manaifest for future comparison
func TestHelmKedaRemoteExampleTemplateRenderedPackageDump(t *testing.T) {
t.Parallel()

// chart name
releaseName := "keda"
Expand Down Expand Up @@ -149,7 +146,6 @@ func TestHelmKedaRemoteExampleTemplateRenderedPackageDump(t *testing.T) {

// An example of how to verify the current helm k8s manifest against a previous snapshot
func TestHelmKedaRemoteExampleTemplateRenderedPackageDiff(t *testing.T) {
t.Parallel()

// chart name
releaseName := "keda"
Expand All @@ -173,7 +169,7 @@ func TestHelmKedaRemoteExampleTemplateRenderedPackageDiff(t *testing.T) {
// demonstrate how to select individual templates to render.
output := helm.RenderRemoteTemplate(t, options, "https://kedacore.github.io/charts", releaseName, []string{})

// run the diff and assert the number of diffs
// run the diff and assert the number of diffs matches the number of diffs in the snapshot
number_of_diffs := helm.DiffAgainstSnapshot(output, releaseName)
require.Equal(t, number_of_diffs, 0)
require.Equal(t, 18, number_of_diffs)
}

0 comments on commit ffefe30

Please sign in to comment.