I have the following test which is working but isn't giving the "official" output when running:
func TestDeployLive(t *testing.T) {
// EXPECTING PASS
un, pw := GetGlobalAdminLogins()
sc, err, _ := PostImage("apps/10130/icon", un, pw, "/valid.png")
sc2, err2, _ := PostImage("apps/10130/learn-more-image", un, pw, "/valid-learn-more.png")
if err != nil && err2 != nil {
t.Error("Fail")
} else {
if sc != 200 || sc2 != 200 {
t.Error("Fail")
} else {
deploy, err3, json := DeployApp("apps/10130/deploy", un, pw, "live")
fmt.Print(deploy)
if err3 != nil {
t.Error("Fail")
} else {
if deploy != 200 {
t.Error("Fail")
} else {
if json.Data[0].LiveDate != nil {
fmt.Println("Pass Live")
t.Logf("Success")
} else {
fmt.Println("Fail Live")
t.Error("Fail")
}
}
}
}
}
}
My output is: 200
Pass Live
Which as you can see means the test has passed but I am not getting the proper --- FAIL: TestIconImagePost (0.76s)
for example.
Do I have to do something to get the output to display - my other tests are displaying the output correctly?
UPDATE:
If i run with -v on the end it will show it, and shows its passing. But my question is, why do all my other tests show up without the need for -v
but this new test needs it?
Any ideas?
Passing tests aren't displayed by default. Hence the -v
option…