e2e Go-native test runner
- Dominant language
- Go
- Stars
- 4
- Forks
- 13
- PR merge metrics
- No merged PRs in 30d
Description
Rewrite the `e2e-tests.sh` script (https://github.com/knative/hack/blob/main/README.md#using-the-e2e-testssh-helper-script) into a Golang tool `knative.dev/toolbox/presubmit`.
Invent new Go-native extension interface, for example:
```sh
# will look for Go files with `e2e` build constraints, that register configuration
go run knative.dev/toolbox/e2e@latest --run-tests
```
An example configuration might look like:
```go
//go:build e2e
package test
import (
"fmt"
"os"
"github.com/bitfield/script"
"knative.dev/toolbox/e2e/pkg/config"
"knative.dev/toolbox/e2e/pkg/commands/knative"
"knative.dev/toolbox/e2e/pkg/commands/wait"
)
var waitForKnative = true
init {
config.Configure(config.Hooks{
KnativeSetup: function(ctx config.Context) error {
if err := knative.StartServingLatest(); err != nil {
return err
}
if waitForKnative {
return wait.UntilPodsRunning("knative-serving")
}
return nil
},
DefineFlags: function(fs *flag.FlagSet) {
fs.BoolVar(&waitForKnative, "wait-for-knative", true, "wait for Knative install?")
},
Tests: []config.E2eSuite{{
Name: "Istio",
Dir: "./...",
Flags: ["--istio"],
}},
})
}
```
Contributor guide
Research direction
Start with the e2e-tests.sh helper described in the Knative hack README, then review the proposed knative.dev/toolbox/presubmit tool and the example Go-native extension interface. Done means the existing helper workflow is represented by a Go tool with e2e build-constraint configuration, hooks, flags, and test suites as outlined in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, shell
- Domain
- testing-qa, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 20/100