Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

anjannath
Copy link
Member

this is added to skip the tests primarily in brew environment where outside connectivity is not present and hence the test fails

@openshift-ci openshift-ci bot requested review from cfergeau and evidolob September 27, 2023 08:08
@openshift-ci
Copy link

openshift-ci bot commented Sep 27, 2023

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from anjannath. For more information see the Kubernetes Code Review Process.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

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
Copy link
Contributor

@cfergeau cfergeau left a 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
Copy link
Contributor

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 {
Copy link
Contributor

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")
}
Copy link
Member

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" {
 ...
}

@openshift-ci
Copy link

openshift-ci bot commented Sep 27, 2023

@anjannath: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-crc c64ad2e link true /test e2e-crc

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.

@praveenkumar
Copy link
Member

@anjannath since we are agreed to make this change downstream, should we close this now?

@anjannath
Copy link
Member Author

@praveenkumar Yes, closing it!

@anjannath anjannath closed this Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants