This repository was archived by the owner on Jul 28, 2026. It is now read-only.
TestEnqueueRequestForSelector: only run test if -online flag is set - #776
Merged
Merged
Conversation
rfratto
reviewed
Jul 23, 2021
rfratto
left a comment
Contributor
There was a problem hiding this comment.
Cool, thanks! I've been on the fence about build tags and flags, but after playing around with tags for #773 I think this approach is better.
We'll likely move that flag into its own util package soon so other packages can make use of it but this is fine for now.
flokli
force-pushed
the
network-access-tests
branch
from
July 23, 2021 07:27
6ae1454 to
9b40355
Compare
rfratto
reviewed
Jul 23, 2021
This test does download and invoke kubebuilder-tools, to make sure there is no extra steps needed just to run this one test. (grafana-cold-storage#731 (comment)). However, distros usually build and run tests in a sandbox with network access disabled, causing this test to fail. Introduce a `online` flag, defaulting to false, and skip this test as long as `-online` is not passed. CI, which invokes `make test` deliberately sets this to true, to have coverage for that test provided by CI. Fixes grafana-cold-storage#731.
flokli
force-pushed
the
network-access-tests
branch
from
July 23, 2021 15:44
9b40355 to
17e51a0
Compare
Contributor
Author
|
@rfratto this seems to have changed / reverted during the merge of #773. I found https://github.com/grafana/agent/pull/773/files#r687958362 mentioning build flags, but I don't set that flag, and in a networkless build of 0.18.2, the test still seems to get executed, and fail: |
mattdurham
pushed a commit
that referenced
this pull request
Nov 11, 2021
…776) * TestEnqueueRequestForSelector: only run test if -online flag is set This test does download and invoke kubebuilder-tools, to make sure there is no extra steps needed just to run this one test. (#731 (comment)). However, distros usually build and run tests in a sandbox with network access disabled, causing this test to fail. Introduce a `online` flag, defaulting to false, and skip this test as long as `-online` is not passed. CI, which invokes `make test` deliberately sets this to true, to have coverage for that test provided by CI. Fixes #731. * fix flag passing Co-authored-by: Robert Fratto <robertfratto@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This test does download and invoke kubebuilder-tools, to make sure there
is no extra steps needed just to run this one test.
(#731 (comment)).
However, distros usually build and run tests in a sandbox with network
access disabled, causing this test to fail.
Introduce a
onlineflag, defaulting to false, and skip this test aslong as
-onlineis not passed.CI, which invokes
make testdeliberately sets this to true, to havecoverage for that test provided by CI.
Fixes #731.
PR Description
Which issue(s) this PR fixes
Notes to the Reviewer
PR Checklist