Skip to content

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

Description

@yuki2006

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions