mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 10:51:29 +00:00
test: Add some default flags ginkgo flags for node e2e
Add the following ginkgo flags for each node e2e similar to the existing hack/ginkgo-e2e.sh script. * --no-color, colors aren't rendered properly in prow and make examining the log in text editors more difficult, so let's disable them. `hack/ginkgo-e2e.sh` (used for kind e2e tests) also disables them already. * -v, enable verbose logs. This is needed so we get more detailed info even when the tests pass. This is useful so we can compare successful runs to failed runs. Signed-off-by: David Porter <david@porter.me>
This commit is contained in:
parent
e9ecdf3534
commit
e001884594
@ -222,6 +222,10 @@ func main() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Append some default ginkgo flags. We use similar defaults here as hack/ginkgo-e2e.sh
|
||||||
|
allGinkgoFlags := fmt.Sprintf("%s --no-color -v", *ginkgoFlags)
|
||||||
|
fmt.Printf("Will use ginkgo flags as: %s", allGinkgoFlags)
|
||||||
|
|
||||||
var gceImages *internalImageConfig
|
var gceImages *internalImageConfig
|
||||||
if *mode == "gce" {
|
if *mode == "gce" {
|
||||||
if *hosts == "" && *imageConfigFile == "" && *images == "" {
|
if *hosts == "" && *imageConfigFile == "" && *images == "" {
|
||||||
@ -260,8 +264,9 @@ func main() {
|
|||||||
imageConfig := gceImages.images[shortName]
|
imageConfig := gceImages.images[shortName]
|
||||||
fmt.Printf("Initializing e2e tests using image %s/%s/%s.\n", shortName, imageConfig.project, imageConfig.image)
|
fmt.Printf("Initializing e2e tests using image %s/%s/%s.\n", shortName, imageConfig.project, imageConfig.image)
|
||||||
running++
|
running++
|
||||||
|
|
||||||
go func(image *internalGCEImage, junitFileName string) {
|
go func(image *internalGCEImage, junitFileName string) {
|
||||||
results <- testImage(image, junitFileName)
|
results <- testImage(image, junitFileName, allGinkgoFlags)
|
||||||
}(&imageConfig, shortName)
|
}(&imageConfig, shortName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -270,7 +275,7 @@ func main() {
|
|||||||
fmt.Printf("Initializing e2e tests using host %s.\n", host)
|
fmt.Printf("Initializing e2e tests using host %s.\n", host)
|
||||||
running++
|
running++
|
||||||
go func(host string, junitFileName string) {
|
go func(host string, junitFileName string) {
|
||||||
results <- testHost(host, *cleanup, "", junitFileName, *ginkgoFlags)
|
results <- testHost(host, *cleanup, "", junitFileName, allGinkgoFlags)
|
||||||
}(host, host)
|
}(host, host)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -532,18 +537,7 @@ func getGCEImage(imageRegex, imageFamily string, project string) (string, error)
|
|||||||
|
|
||||||
// Provision a gce instance using image and run the tests in archive against the instance.
|
// Provision a gce instance using image and run the tests in archive against the instance.
|
||||||
// Delete the instance afterward.
|
// Delete the instance afterward.
|
||||||
func testImage(imageConfig *internalGCEImage, junitFileName string) *TestResult {
|
func testImage(imageConfig *internalGCEImage, junitFileName string, ginkgoFlagsStr string) *TestResult {
|
||||||
ginkgoFlagsStr := *ginkgoFlags
|
|
||||||
// Check whether the test is for benchmark.
|
|
||||||
if len(imageConfig.tests) > 0 {
|
|
||||||
// Benchmark needs machine type non-empty.
|
|
||||||
if imageConfig.machine == "" {
|
|
||||||
imageConfig.machine = defaultMachine
|
|
||||||
}
|
|
||||||
// Use the Ginkgo focus in benchmark config.
|
|
||||||
ginkgoFlagsStr += (" " + testsToGinkgoFocus(imageConfig.tests))
|
|
||||||
}
|
|
||||||
|
|
||||||
host, err := createInstance(imageConfig)
|
host, err := createInstance(imageConfig)
|
||||||
if *deleteInstances {
|
if *deleteInstances {
|
||||||
defer deleteInstance(host)
|
defer deleteInstance(host)
|
||||||
|
Loading…
Reference in New Issue
Block a user