internal/e2e: first version of the end-to-end module tests
GITHUB_TOKEN is required with the documented permissions for GITHUB_ORG.
The test should otherwise work without any other manual steps.
A cleanup go-build-ignored program is also included
which removes repositories left behind by GITHUB_KEEP=true or failures,
which also follows the GITHUB_TOKEN and GITHUB_ORG env vars.
We use a separate Go module since these tests use google/go-github,
and we don't want the root module to gain extra module dependencies.
The test module requires the root module via a replace directive;
we avoid using a Go workspace because it's unnecessary for two modules,
and because the test module should always use the git repo's CUE module.
We place the module in internal/e2e, and not somewhere under cmd/cue,
since in the near term we might also want to end-to-end test cue/load.
The module doesn't need to be inside an internal directory,
since the test/... module path alone already makes it non-importable,
but it's a helpful signal to developers that it's not a public library.
Note that this commit doesn't hook up the tests in CI yet.
A future commit will do that, adding a token secret and an Actions step.
Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Change-Id: Id65235a058acb78b544265e508c9462856b06b1e
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1171435
Reviewed-by: Roger Peppe <rogpeppe@gmail.com>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>