From 667cfa750db93c7349ac9581e73052a66cd7d2ba Mon Sep 17 00:00:00 2001 From: James Date: Fri, 18 Aug 2017 13:44:44 -0700 Subject: [PATCH] Do cleanupt defer won't work --- test/fn-api-tests/init_test.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/test/fn-api-tests/init_test.go b/test/fn-api-tests/init_test.go index ad94e1942..bf6151ded 100644 --- a/test/fn-api-tests/init_test.go +++ b/test/fn-api-tests/init_test.go @@ -1,6 +1,7 @@ package tests import ( + "fmt" "os" "testing" ) @@ -8,7 +9,11 @@ import ( func TestMain(m *testing.M) { // call flag.Parse() here if TestMain uses flags s := SetupDefaultSuite() - defer Cleanup() - defer s.Cancel() - os.Exit(m.Run()) + result := m.Run() + Cleanup() + s.Cancel() + if result == 0 { + fmt.Fprintln(os.Stdout, "😀 👍 🎗") + } + os.Exit(result) }