Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
yuki2006 opened this issue Sep 7, 2020 · 0 comments
Open

Comments

@yuki2006
Copy link
Contributor

yuki2006 commented Sep 7, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant