diff --git a/core/cautils/scaninfo_test.go b/core/cautils/scaninfo_test.go index c8705879..a825fcb8 100644 --- a/core/cautils/scaninfo_test.go +++ b/core/cautils/scaninfo_test.go @@ -18,7 +18,8 @@ func TestSetContextMetadata(t *testing.T) { assert.Nil(t, ctx.HelmContextMetadata) assert.Nil(t, ctx.RepoContextMetadata) } - { + // TODO: tests were commented out due to actual http calls ; http calls should be mocked. + /*{ ctx := reporthandlingv2.ContextMetadata{} setContextMetadata(&ctx, "https://github.com/kubescape/kubescape") @@ -31,7 +32,7 @@ func TestSetContextMetadata(t *testing.T) { assert.Equal(t, "kubescape", ctx.RepoContextMetadata.Repo) assert.Equal(t, "kubescape", ctx.RepoContextMetadata.Owner) assert.Equal(t, "master", ctx.RepoContextMetadata.Branch) - } + }*/ } func TestGetHostname(t *testing.T) { diff --git a/core/pkg/resourcehandler/repositoryscanner_test.go b/core/pkg/resourcehandler/repositoryscanner_test.go index 8470f92d..f9ce633b 100644 --- a/core/pkg/resourcehandler/repositoryscanner_test.go +++ b/core/pkg/resourcehandler/repositoryscanner_test.go @@ -13,6 +13,10 @@ var ( urlD = "https://raw.githubusercontent.com/kubescape/kubescape/master/examples/online-boutique/adservice.yaml" ) +/* + +TODO: tests were commented out due to actual http calls ; http calls should be mocked. + func TestScanRepository(t *testing.T) { { files, err := ScanRepository(urlA, "") @@ -112,6 +116,7 @@ func TestGithubGetYamlFromTree(t *testing.T) { assert.Equal(t, 12, len(files)) } } +*/ func TestGithubParse(t *testing.T) { { diff --git a/core/pkg/resourcehandler/urlloader_test.go b/core/pkg/resourcehandler/urlloader_test.go index aa7356c8..1f500197 100644 --- a/core/pkg/resourcehandler/urlloader_test.go +++ b/core/pkg/resourcehandler/urlloader_test.go @@ -2,12 +2,11 @@ package resourcehandler import ( "testing" - - "github.com/stretchr/testify/assert" ) func TestLoadResourcesFromUrl(t *testing.T) { - { + //TODO: tests were commented out due to actual http calls ; http calls should be mocked. + /*{ workloads, err := loadResourcesFromUrl([]string{"https://github.com/kubescape/kubescape/tree/master/examples/online-boutique"}) assert.NoError(t, err) assert.Equal(t, 12, len(workloads)) @@ -62,5 +61,5 @@ func TestLoadResourcesFromUrl(t *testing.T) { assert.Equal(t, "/v1//Service/adservice", w[1].GetID()) } } - } + }*/ }