Skip to content

Commit

Permalink
feat(v2): fix e2e TestVersion (#1784)
Browse files Browse the repository at this point in the history
* feat(v2): fix e2e TestVersion

* f

* f
  • Loading branch information
emosbaugh authored Jan 31, 2025
1 parent 2f7229a commit 221241c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 199 deletions.
5 changes: 0 additions & 5 deletions cmd/buildtools/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,6 @@ var metadataExtractHelmChartImagesCommand = &cli.Command{

repos := metadata.Configs.Repositories
charts := metadata.Configs.Charts
//nolint:staticcheck // SA1019 explanation Using deprecated BuiltinConfigs for backwards compatibility
for _, chart := range metadata.BuiltinConfigs {
repos = append(repos, chart.Repositories...)
charts = append(charts, chart.Charts...)
}

images, err := extractImagesFromHelmExtensions(repos, charts, metadata.Versions["Kubernetes"])
if err != nil {
Expand Down
6 changes: 4 additions & 2 deletions cmd/installer/cli/install2.go
Original file line number Diff line number Diff line change
Expand Up @@ -784,8 +784,10 @@ func gatherVersionMetadata(withChannelRelease bool) (*types.ReleaseMetadata, err
for name, version := range addons2.Versions() {
versionsMap[name] = version
}
for name, version := range extensions.Versions() {
versionsMap[name] = version
if withChannelRelease {
for name, version := range extensions.Versions() {
versionsMap[name] = version
}
}

versionsMap["Kubernetes"] = versions.K0sVersion
Expand Down
40 changes: 1 addition & 39 deletions e2e/version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func TestVersion(t *testing.T) {
}
}

expectedCharts := []string{"openebs", "embedded-cluster-operator", "admin-console", "ingress-nginx", "goldpinger"}
expectedCharts := []string{"openebs", "embedded-cluster-operator", "admin-console", "velero", "seaweedfs", "docker-registry", "ingress-nginx", "goldpinger"}
if len(parsed.Configs.Charts) != len(expectedCharts) {
t.Log(output)
t.Fatalf("found %d charts in metadata, expected %d", len(parsed.Configs.Charts), len(expectedCharts))
Expand All @@ -132,44 +132,6 @@ func TestVersion(t *testing.T) {
}
}

expectedBuiltinConfigsCharts := []string{"velero", "seaweedfs", "registry", "registry-ha"}
//nolint:staticcheck // SA1019 explanation Using deprecated BuiltinConfigs for testing
if len(parsed.BuiltinConfigs) != len(expectedBuiltinConfigsCharts) {
t.Log(output)
//nolint:staticcheck // SA1019 explanation Using deprecated BuiltinConfigs for testing
t.Fatalf("found %d builtin charts in metadata, expected %d", len(parsed.BuiltinConfigs), len(expectedBuiltinConfigsCharts))
}
for _, expectedName := range expectedBuiltinConfigsCharts {
//nolint:staticcheck // SA1019 explanation Using deprecated BuiltinConfigs for testing
if _, ok := parsed.BuiltinConfigs[expectedName]; !ok {
t.Errorf("failed to find builtin chart %s in 'metadata' output", expectedName)
failed = true
}
}

expectedVeleroCharts := []string{"velero"}
//nolint:staticcheck // SA1019 explanation Using deprecated BuiltinConfigs for testing
if len(parsed.BuiltinConfigs["velero"].Charts) != len(expectedVeleroCharts) {
t.Log(output)
//nolint:staticcheck // SA1019 explanation Using deprecated BuiltinConfigs for testing
t.Fatalf("found %d velero charts in metadata, expected %d", len(parsed.BuiltinConfigs["velero"].Charts), len(expectedVeleroCharts))
}

for _, expectedName := range expectedVeleroCharts {
foundName := false
//nolint:staticcheck // SA1019 explanation Using deprecated BuiltinConfigs for testing
for _, foundChart := range parsed.BuiltinConfigs["velero"].Charts {
if foundChart.Name == expectedName {
foundName = true
break
}
}
if !foundName {
t.Errorf("failed to find velero chart %s in 'metadata' output", expectedName)
failed = true
}
}

expectedArtifacts := []string{"k0s", "kots", "operator", "local-artifact-mirror-image"}
if len(parsed.Artifacts) != len(expectedArtifacts) {
t.Log(output)
Expand Down
153 changes: 0 additions & 153 deletions operator/pkg/release/release_test.go

This file was deleted.

0 comments on commit 221241c

Please sign in to comment.