cmd icon indicating copy to clipboard operation
cmd copied to clipboard

If the test command fails to assert, set the Exit Status to non-zero.

Open yuki2006 opened this issue 3 years ago • 0 comments

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 $?

yuki2006 avatar Sep 07 '20 01:09 yuki2006