cmd
cmd copied to clipboard
If the test command fails to assert, set the Exit Status to non-zero.
If an assert fails in a test subcommand, it's not safe for automatic builds or deployments because the command can't tell if it's a success or a failure.
I would suggest setting the Exit Status to non-zero when an assert fails.
revel new -a foo
cat <<EOT > foo/tests/apptest.go
package tests
import (
"github.com/revel/revel/testing"
)
type AppTest struct {
testing.TestSuite
}
func (t *AppTest) TestThatIndexPageWorks() {
t.Get("/")
t.AssertNotFound() // !!
t.AssertContentType("text/html; charset=utf-8")
}
EOT
revel test foo
echo $?