Skip to content

Commit

Permalink
Print timing and result info (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
symm authored Jul 2, 2017
1 parent 464aab3 commit 313ca8f
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@ import (
"fmt"
"log"
"os"
"time"
)

var vapeFile = flag.String("config", "Vapefile", "The full path to the Vape configuration file")

func main() {
var vapeFile = flag.String("config", "Vapefile", "The full path to the Vape configuration file")
start := time.Now()

flag.Parse()

args := flag.Args()
Expand All @@ -33,12 +37,26 @@ func main() {
vape := NewVape(DefaultClient, baseURL, resCh, errCh)
vape.Process(smokeTests)

passedCount := 0

for i := 0; i < testsLen; i++ {
select {
case res := <-resCh:
if res.Passed() {
passedCount++
}

fmt.Println(formatResult(res))
case err := <-errCh:
fmt.Println(err)
}
}

if passedCount < testsLen {
fmt.Println("\n🔥 Some tests failed. you may have a bad deployment")
os.Exit(2)
}

fmt.Printf("\n✨ [%d/%d] tests passed in %s\n", passedCount, testsLen, time.Since(start))

}

0 comments on commit 313ca8f

Please sign in to comment.