Skip to content

Commit

Permalink
fix: Update tests and migrate Relationships table
Browse files Browse the repository at this point in the history
Signed-off-by: Nithish <nithishkarthik01@gmail.com>
  • Loading branch information
humblenginr committed Dec 17, 2022
1 parent c2a79c3 commit 616ccf2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions utils/artifacthub/package_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package artifacthub

import "testing"
import (
"strings"
"testing"
)

func TestGetChartUrl(t *testing.T) {
var tests = []struct {
Expand All @@ -9,7 +12,7 @@ func TestGetChartUrl(t *testing.T) {
}{
// these might change in the future, so the tests have to be changed as well when the urls change
// because the urls will change with every new version update to the package
{AhPackage{Name: "consul", Repository: "bitnami", Organization: "", RepoUrl: "https://charts.bitnami.com/bitnami"}, "https://charts.bitnami.com/bitnami/consul-10.9.5.tgz"},
{AhPackage{Name: "consul", Repository: "bitnami", Organization: "", RepoUrl: "https://charts.bitnami.com/bitnami"}, "https://charts.bitnami.com/bitnami/consul"},
{AhPackage{Name: "crossplane-types", Repository: "crossplane", Organization: "", RepoUrl: "https://charts.crossplane.io/master"}, "https://charts.crossplane.io/master/crossplane-types-0.13.0-rc.191.g3a18fb7.tgz"},
}
for _, tt := range tests {
Expand All @@ -19,7 +22,7 @@ func TestGetChartUrl(t *testing.T) {
t.Errorf("error while updating package data = %v", err)
return
}
if tt.ahpkg.ChartUrl != tt.want {
if !strings.HasPrefix(tt.ahpkg.ChartUrl, tt.want) {
t.Errorf("got %v, want %v", tt.ahpkg.ChartUrl, tt.want)
}
})
Expand Down

0 comments on commit 616ccf2

Please sign in to comment.