run_remote.go: move registerGceHostIP() call to testImage()

I.e. don't assume that `testHost` is called on a GCE host. Prep for
future patch.
This commit is contained in:
Jonathan Lebon 2021-11-05 11:59:14 -04:00
parent 36233b985b
commit 032dbd2063

View File

@ -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
@ -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.