Adapt tests to Helm v3.18.0 JSON number

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
This commit is contained in:
Stefan Prodan 2025-05-23 16:31:16 +03:00 committed by Matheus Pimenta
parent a5cf14eed4
commit 15d24529b9
No known key found for this signature in database
GPG Key ID: 86D878C779EB9A95
2 changed files with 8 additions and 6 deletions

View File

@ -18,6 +18,7 @@ package chart
import (
"context"
"encoding/json"
"os"
"path/filepath"
"sync"
@ -112,7 +113,7 @@ func TestLocalBuilder_Build(t *testing.T) {
name: "default values",
reference: LocalReference{Path: "../testdata/charts/helmchart"},
wantValues: chartutil.Values{
"replicaCount": float64(1),
"replicaCount": json.Number("1"),
},
wantVersion: "0.1.0",
wantPackaged: true,
@ -136,7 +137,7 @@ fullnameOverride: "full-foo-name-override"`),
},
},
wantValues: chartutil.Values{
"replicaCount": float64(20),
"replicaCount": json.Number("20"),
"nameOverride": "foo-name-override",
"fullnameOverride": "full-foo-name-override",
},
@ -157,7 +158,7 @@ fullnameOverride: "full-foo-name-override"`),
name: "v1 chart",
reference: LocalReference{Path: "./../testdata/charts/helmchart-v1"},
wantValues: chartutil.Values{
"replicaCount": float64(1),
"replicaCount": json.Number("1"),
},
wantVersion: "0.2.0",
wantPackaged: true,

View File

@ -19,6 +19,7 @@ package chart
import (
"bytes"
"context"
"encoding/json"
"fmt"
"net/url"
"os"
@ -168,7 +169,7 @@ entries:
repository: mockRepo(),
wantVersion: "0.1.0",
wantValues: chartutil.Values{
"replicaCount": float64(1),
"replicaCount": json.Number("1"),
},
},
{
@ -316,7 +317,7 @@ func TestRemoteBuilder_BuildFromOCIChartRepository(t *testing.T) {
repository: mockRepo(),
wantVersion: "0.1.0",
wantValues: chartutil.Values{
"replicaCount": float64(1),
"replicaCount": json.Number("1"),
},
},
{
@ -325,7 +326,7 @@ func TestRemoteBuilder_BuildFromOCIChartRepository(t *testing.T) {
repository: mockRepo(),
wantVersion: "0.1.0",
wantValues: chartutil.Values{
"replicaCount": float64(1),
"replicaCount": json.Number("1"),
},
},
{