Skip to content

Commit

Permalink
run_remote.go: move registerGceHostIP() call to testImage()
Browse files Browse the repository at this point in the history
I.e. don't assume that `testHost` is called on a GCE host. Prep for
future patch.
  • Loading branch information
jlebon committed Nov 22, 2021
1 parent 36233b9 commit 032dbd2
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions test/e2e_node/runner/remote/run_remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -453,14 +453,6 @@ func registerGceHostIP(host string) error {

// Run tests in archive against host
func testHost(host string, deleteFiles bool, imageDesc, junitFileName, ginkgoFlagsStr string) *TestResult {
if err := registerGceHostIP(host); err != nil {
return &TestResult{
err: err,
host: host,
exitOk: false,
}
}

path, err := arc.getArchive()
if err != nil {
// Don't log fatal because we need to do any needed cleanup contained in "defer" statements
Expand Down Expand Up @@ -555,6 +547,14 @@ func testImage(imageConfig *internalGCEImage, junitFileName string) *TestResult
// If we are going to delete the instance, don't bother with cleaning up the files
deleteFiles := !*deleteInstances && *cleanup

if err = registerGceHostIP(host); err != nil {
return &TestResult{
err: err,
host: host,
exitOk: false,
}
}

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.
// TODO(random-liu): Extract out and unify log collection logic with cluste e2e.
Expand Down

0 comments on commit 032dbd2

Please sign in to comment.