Skip to content

Commit

Permalink
add a sanity test for betas
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-zuyev committed Jun 29, 2021
1 parent 5f71acc commit 66e0d25
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions deploy/minikube/release_sanity_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// +build release

/*
Copyright 2016 The Kubernetes Authors All rights reserved.
Expand Down Expand Up @@ -47,13 +45,30 @@ func getSHAFromURL(url string) (string, error) {
return hex.EncodeToString(b[:]), nil
}

// TestBetaReleasesJSON checks if all *GA* releases
// enlisted in https://storage.googleapis.com/minikube/releases.json
// are available to download and have correct hashsum
func TestReleasesJSON(t *testing.T) {
releases, err := notify.GetAllVersionsFromURL(notify.GithubMinikubeReleasesURL)
releases, err := notify.AllVersionsFromURL(notify.GithubMinikubeReleasesURL)
if err != nil {
t.Fatalf("Error getting releases.json: %v", err)
}
checkReleases(t, releases)
}

// TestBetaReleasesJSON checks if all *BETA* releases
// enlisted in https://storage.googleapis.com/minikube/releases-beta.json
// are available to download and have correct hashsum
func TestBetaReleasesJSON(t *testing.T) {
releases, err := notify.AllVersionsFromURL(notify.GithubMinikubeBetaReleasesURL)
if err != nil {
t.Fatalf("Error getting releases-bets.json: %v", err)
}
checkReleases(t, releases)
}

for _, r := range releases {
func checkReleases(t *testing.T, rs notify.Releases) {
for _, r := range rs {
fmt.Printf("Checking release: %s\n", r.Name)
for platform, sha := range r.Checksums {
fmt.Printf("Checking SHA for %s.\n", platform)
Expand Down

0 comments on commit 66e0d25

Please sign in to comment.