0

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?

1
  • Rule of thumb with Go, which was co-invented by Ken Thompson, one of the heads behind UNIX: "No news are good news." Commented Apr 6, 2016 at 14:33

1 Answer 1

4

Passing tests aren't displayed by default. Hence the -v option…

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.