-
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
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
this adds a way to skip tests by setting the env variable CRC_IN_DISCONNECTED_ENV to true this is added to skip the tests primarily in brew environment where outside connectivity is not present and hence the test fails
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.
Overall looks good to me, I'd just drop the crc.spec.in changes.
@@ -60,7 +60,7 @@ export GOFLAGS="-mod=vendor" | |||
mkdir embed-files | |||
cp /usr/bin/crc-driver-libvirt embed-files | |||
cp /usr/bin/crc-admin-helper embed-files/crc-admin-helper-linux | |||
make COMMIT_SHA=__COMMIT_SHA__ GO_EXTRA_LDFLAGS="-B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n')" GO_EXTRA_BUILDFLAGS="" CUSTOM_EMBED=true EMBED_DOWNLOAD_DIR=embed-files/ release | |||
make CRC_IN_DISCONNECTED_ENV=true COMMIT_SHA=__COMMIT_SHA__ GO_EXTRA_LDFLAGS="-B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n')" GO_EXTRA_BUILDFLAGS="" CUSTOM_EMBED=true EMBED_DOWNLOAD_DIR=embed-files/ release |
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.
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
I'd just use LookupEnv
and would not try to parse it/... If it's set, ignore the test. But I'm fine with the way you wrote it.
// skip the test when running in disconnected env | ||
if disconnected, _ := strconv.ParseBool(os.Getenv("CRC_IN_DISCONNECTED_ENV")); disconnected { | ||
t.Skip("Skipping test since running in disconnected env") | ||
} |
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.
Since we are ignoring the error then why not just ?
if os.Getenv("CRC_IN_DISCONNECTED_ENV") == "true" {
...
}
@anjannath: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
@anjannath since we are agreed to make this change downstream, should we close this now? |
@praveenkumar Yes, closing it! |
this is added to skip the tests primarily in brew environment where outside connectivity is not present and hence the test fails