@@ -16,6 +16,7 @@ import (
1616 "time"
1717
1818 buildinfo "github.com/jfrog/build-info-go/entities"
19+ "github.com/jfrog/jfrog-cli-core/v2/utils/config"
1920 "github.com/jfrog/jfrog-cli-core/v2/utils/coreutils"
2021 coreTests "github.com/jfrog/jfrog-cli-core/v2/utils/tests"
2122 "github.com/jfrog/jfrog-cli/utils/tests"
@@ -41,6 +42,23 @@ func initHelmTest(t *testing.T) {
4142 if artifactoryCli == nil {
4243 initArtifactoryCli ()
4344 }
45+
46+ // Set up home directory configuration so GetDefaultServerConf() can find the server
47+ createJfrogHomeConfig (t , true )
48+
49+ // Initialize serverDetails for Helm tests (similar to maven_test.go)
50+ serverDetails = & config.ServerDetails {
51+ Url : * tests .JfrogUrl ,
52+ ArtifactoryUrl : * tests .JfrogUrl + tests .ArtifactoryEndpoint ,
53+ SshKeyPath : * tests .JfrogSshKeyPath ,
54+ SshPassphrase : * tests .JfrogSshPassphrase ,
55+ }
56+ if * tests .JfrogAccessToken != "" {
57+ serverDetails .AccessToken = * tests .JfrogAccessToken
58+ } else {
59+ serverDetails .User = * tests .JfrogUser
60+ serverDetails .Password = * tests .JfrogPassword
61+ }
4462}
4563
4664func isArtifactoryAccessible (t * testing.T ) bool {
@@ -368,6 +386,13 @@ spec:
368386 err = os .WriteFile (filepath .Join (templatesDir , "deployment.yaml" ), []byte (deploymentYaml ), 0644 )
369387 require .NoError (t , err )
370388
389+ // Create an empty Chart.lock file for charts without dependencies
390+ // This is required because Helm FlexPack tries to read Chart.lock even when it doesn't exist
391+ chartLockYaml := `dependencies: []
392+ `
393+ err = os .WriteFile (filepath .Join (chartDir , "Chart.lock" ), []byte (chartLockYaml ), 0644 )
394+ require .NoError (t , err )
395+
371396 return chartDir
372397}
373398
0 commit comments