"'Benjamin Elder' via kubernetes-sig-testing"
<
kubernetes-...@googlegroups.com> writes:
>> I think that tags as I said previously address those concerns, if the tag
> is not set it will not even compile
>
> tags *and a dedicated set of packages* / target, so we know where to run
> those and can specifically test them, see previous comments.
Dedicated packages then would enable running inside e2e_node because
they can be imported to register the tests there. But as Antonio said,
that doesn't work for unit tests which need to access unexported
functions or fields.
Are you 100% sure that these tests cannot be rewritten as black-box
tests of the package?
In the PRs you suggested maintaining the list of packages which must be
tested like this in the test-infra job, combined with the build tag to
exclude them from "make test", aka pull-kubernetes-unit. That works, but
it's fragile: suppose someone adds such a unit test in a new
package. That package then has to be merged without running the tests.
Only then can the job can be updated to include it, potentially breaking
presubmit and periodic if the tests were broken.
This assumes that contributor and reviewer are careful and know that
test-infra needs to be updated. If they aren't, the new test will
silently not be executed. This is the risk that Ben called out. We've
had that before with unit tests that got added under hack/tools/* at a
time when test.sh didn't run unit tests outside of the workspace.
>> I just tested that user namespaces work in the prow-build cluster, I think
>> it works in gke COS nodes since 1.33.
Even if it works now, you are basically making assumptions about how
the Kubernetes Prow is configured. That feels a bit dirty.