diff --git a/go/examples/pingpong/pp_integration/pingpong.go b/go/examples/pingpong/pp_integration/pingpong.go index ea7d3e5bae..6507eb3ebd 100644 --- a/go/examples/pingpong/pp_integration/pingpong.go +++ b/go/examples/pingpong/pp_integration/pingpong.go @@ -43,7 +43,7 @@ func realMain() int { return 1 } // TODO(lukedirtwalker) we should enable logging - // depeding on the main log parameter it should either go to a file or to console stderr. + // depending on the main log parameter it should either go to a file or to console stderr. in := integration.NewBinaryIntegration("./bin/pingpong", []string{"-mode", "client", "-sciondFromIA", "-count", "1", "-local", integration.SrcIAReplace + ",[127.0.0.1]:0", @@ -62,7 +62,6 @@ func realMain() int { // In case of an error the function is terminated immediately. func runTests(in integration.Integration, pairs []integration.IAPair) error { return integration.ExecuteTimed(in.Name(), func() error { - // First run all servers dsts := integration.ExtractUniqueDsts(pairs) for _, dst := range dsts { @@ -72,7 +71,6 @@ func runTests(in integration.Integration, pairs []integration.IAPair) error { } defer c.Close() } - // Now start the clients for srcDest pair for i, conn := range pairs { log.Info(fmt.Sprintf("Test %v: %v -> %v (%v/%v)", diff --git a/go/lib/integration/integration.go b/go/lib/integration/integration.go index 05af9854dd..b5a68aba44 100644 --- a/go/lib/integration/integration.go +++ b/go/lib/integration/integration.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Package integration provides function to simplify the creation of integration tests. +// Package integration simplifies the creation of integration tests. package integration import ( @@ -152,8 +152,12 @@ func RunClient(in Integration, pair IAPair, timeout time.Duration) error { func ExecuteTimed(name string, f func() error) error { start := time.Now() err := f() + result := "successful" + if err != nil { + result = "failed" + } elapsed := time.Since(start) - fmt.Printf("Test %v successful, used %v\n", name, elapsed) + fmt.Printf("Test %s %s, used %v\n", name, result, elapsed) return err }