-
Notifications
You must be signed in to change notification settings - Fork 243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
skip TestGetVerifiedHash when internet connectivity is slow or missing #3849
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,8 @@ package bundle | |
import ( | ||
"encoding/json" | ||
"fmt" | ||
"os" | ||
"strconv" | ||
"strings" | ||
"testing" | ||
"unicode" | ||
|
@@ -188,6 +190,11 @@ func TestGetBundleType(t *testing.T) { | |
} | ||
|
||
func TestVerifiedHash(t *testing.T) { | ||
// skip the test when running in disconnected env | ||
if disconnected, _ := strconv.ParseBool(os.Getenv("CRC_IN_DISCONNECTED_ENV")); disconnected { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd just use |
||
t.Skip("Skipping test since running in disconnected env") | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since we are ignoring the error then why not just ?
|
||
|
||
sha256sum, err := getVerifiedHash("https://developers.redhat.com/content-gateway/file/pub/openshift-v4/clients/crc/bundles/openshift/4.13.0/sha256sum.txt.sig", "crc_libvirt_4.13.0_amd64.crcbundle") | ||
require.NoError(t, err) | ||
require.Equal(t, "6aad57019aaab95b670378f569b3f4a16398da0358dd1057996453a8d6d92212", sha256sum) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CRC_IN_DISCONNECTED_ENV=1
is more common imo. However, I would not add this check here, as the rpm builds we are making on github for example are not disconnected. This can go in the spec file used on platforms where the builders don't have network access.