mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-04 09:49:50 +00:00
e2e_node: remote runner: junitFilePrefix -> junitFileName
This commit is contained in:
parent
07d3a92ce6
commit
7dbbfe38e1
@ -65,8 +65,7 @@ func CreateTestArchive(suite TestSuite, systemSpecName string) (string, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// RunRemote returns the command output, whether the exit was ok, and any errors
|
// RunRemote returns the command output, whether the exit was ok, and any errors
|
||||||
// TODO(random-liu): junitFilePrefix is not prefix actually, the file name is junit-junitFilePrefix.xml. Change the variable name.
|
func RunRemote(suite TestSuite, archive string, host string, cleanup bool, imageDesc, junitFileName, testArgs, ginkgoArgs, systemSpecName, extraEnvs, runtimeConfig string) (string, bool, error) {
|
||||||
func RunRemote(suite TestSuite, archive string, host string, cleanup bool, imageDesc, junitFilePrefix, testArgs, ginkgoArgs, systemSpecName, extraEnvs, runtimeConfig string) (string, bool, error) {
|
|
||||||
// Create the temp staging directory
|
// Create the temp staging directory
|
||||||
klog.V(2).Infof("Staging test binaries on %q", host)
|
klog.V(2).Infof("Staging test binaries on %q", host)
|
||||||
workspace := newWorkspaceDir()
|
workspace := newWorkspaceDir()
|
||||||
@ -111,7 +110,7 @@ func RunRemote(suite TestSuite, archive string, host string, cleanup bool, image
|
|||||||
}
|
}
|
||||||
|
|
||||||
klog.V(2).Infof("Running test on %q", host)
|
klog.V(2).Infof("Running test on %q", host)
|
||||||
output, err := suite.RunTest(host, workspace, resultDir, imageDesc, junitFilePrefix, testArgs, ginkgoArgs, systemSpecName, extraEnvs, runtimeConfig, *testTimeout)
|
output, err := suite.RunTest(host, workspace, resultDir, imageDesc, junitFileName, testArgs, ginkgoArgs, systemSpecName, extraEnvs, runtimeConfig, *testTimeout)
|
||||||
|
|
||||||
aggErrs := []error{}
|
aggErrs := []error{}
|
||||||
// Do not log the output here, let the caller deal with the test output.
|
// Do not log the output here, let the caller deal with the test output.
|
||||||
|
@ -340,16 +340,16 @@ 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, junitFilePrefix string) {
|
go func(image *internalGCEImage, junitFileName string) {
|
||||||
results <- testImage(image, junitFilePrefix)
|
results <- testImage(image, junitFileName)
|
||||||
}(&imageConfig, shortName)
|
}(&imageConfig, shortName)
|
||||||
}
|
}
|
||||||
if *hosts != "" {
|
if *hosts != "" {
|
||||||
for _, host := range strings.Split(*hosts, ",") {
|
for _, host := range strings.Split(*hosts, ",") {
|
||||||
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, junitFilePrefix string) {
|
go func(host string, junitFileName string) {
|
||||||
results <- testHost(host, *cleanup, "", junitFilePrefix, *ginkgoFlags)
|
results <- testHost(host, *cleanup, "", junitFileName, *ginkgoFlags)
|
||||||
}(host, host)
|
}(host, host)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -436,7 +436,7 @@ func getImageMetadata(input string) *compute.Metadata {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run tests in archive against host
|
// Run tests in archive against host
|
||||||
func testHost(host string, deleteFiles bool, imageDesc, junitFilePrefix, ginkgoFlagsStr string) *TestResult {
|
func testHost(host string, deleteFiles bool, imageDesc, junitFileName, ginkgoFlagsStr string) *TestResult {
|
||||||
instance, err := computeService.Instances.Get(*project, *zone, host).Do()
|
instance, err := computeService.Instances.Get(*project, *zone, host).Do()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return &TestResult{
|
return &TestResult{
|
||||||
@ -466,7 +466,7 @@ func testHost(host string, deleteFiles bool, imageDesc, junitFilePrefix, ginkgoF
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
output, exitOk, err := remote.RunRemote(suite, path, host, deleteFiles, imageDesc, junitFilePrefix, *testArgs, ginkgoFlagsStr, *systemSpecName, *extraEnvs, *runtimeConfig)
|
output, exitOk, err := remote.RunRemote(suite, path, host, deleteFiles, imageDesc, junitFileName, *testArgs, ginkgoFlagsStr, *systemSpecName, *extraEnvs, *runtimeConfig)
|
||||||
return &TestResult{
|
return &TestResult{
|
||||||
output: output,
|
output: output,
|
||||||
err: err,
|
err: err,
|
||||||
@ -526,7 +526,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, junitFilePrefix string) *TestResult {
|
func testImage(imageConfig *internalGCEImage, junitFileName string) *TestResult {
|
||||||
ginkgoFlagsStr := *ginkgoFlags
|
ginkgoFlagsStr := *ginkgoFlags
|
||||||
// Check whether the test is for benchmark.
|
// Check whether the test is for benchmark.
|
||||||
if len(imageConfig.tests) > 0 {
|
if len(imageConfig.tests) > 0 {
|
||||||
@ -552,7 +552,7 @@ func testImage(imageConfig *internalGCEImage, junitFilePrefix string) *TestResul
|
|||||||
// If we are going to delete the instance, don't bother with cleaning up the files
|
// If we are going to delete the instance, don't bother with cleaning up the files
|
||||||
deleteFiles := !*deleteInstances && *cleanup
|
deleteFiles := !*deleteInstances && *cleanup
|
||||||
|
|
||||||
result := testHost(host, deleteFiles, imageConfig.imageDesc, junitFilePrefix, ginkgoFlagsStr)
|
result := testHost(host, deleteFiles, imageConfig.imageDesc, junitFileName, ginkgoFlagsStr)
|
||||||
// This is a temporary solution to collect serial node serial log. Only port 1 contains useful information.
|
// This is a temporary solution to collect serial node serial log. Only port 1 contains useful information.
|
||||||
// TODO(random-liu): Extract out and unify log collection logic with cluste e2e.
|
// TODO(random-liu): Extract out and unify log collection logic with cluste e2e.
|
||||||
serialPortOutput, err := computeService.Instances.GetSerialPortOutput(*project, *zone, host).Port(1).Do()
|
serialPortOutput, err := computeService.Instances.GetSerialPortOutput(*project, *zone, host).Port(1).Do()
|
||||||
|
Loading…
Reference in New Issue
Block a user