Skip to content
Latchkey

Go testify Suite Tests Not Running - Missing the suite Entry Point

A testify/suite test runs only if a normal func TestXxx(t *testing.T) calls suite.Run(t, new(MySuite)). Without that entry point - or with mis-named methods - go test finds no tests and the suite silently does nothing.

What this error means

go test reports "ok" with "no tests to run" (or 0 assertions) even though the suite file has many Test... methods. The methods are defined on the suite struct but never execute because nothing bootstraps them.

go test output
--- ok  example/users  0.002s  [no tests to run]

// users_test.go defines (s *UserSuite) TestCreate(), TestDelete()
// but there is no func TestUserSuite(t *testing.T) { suite.Run(...) }

Common causes

No top-level Test function calls suite.Run

go test only invokes functions matching func TestXxx(t *testing.T). Suite methods are not discovered directly - a single TestXxx must call suite.Run(t, new(Suite)) to drive them.

Method names not prefixed with Test

testify runs only suite methods whose names start with Test. A method named CreateUser (no Test prefix) is treated as a helper and never run.

How to fix it

Add the suite entry point

Provide one TestXxx that runs the suite; name test methods with a Test prefix.

users_test.go
func TestUserSuite(t *testing.T) {
    suite.Run(t, new(UserSuite))
}

func (s *UserSuite) TestCreate() { /* ... */ }
func (s *UserSuite) TestDelete() { /* ... */ }

Check receivers and naming

  1. Ensure the suite embeds suite.Suite and methods use a pointer receiver.
  2. Prefix every runnable method with Test.
  3. Run go test -v to confirm each suite method now appears in the output.

How to prevent it

  • Always pair a suite with a TestXxx that calls suite.Run.
  • Name suite test methods with the Test prefix.
  • Use go test -v to verify suite methods are discovered.

Frequently asked questions

What causes "testify suite skipped"?
go test only invokes functions matching func TestXxx(t *testing.T). Suite methods are not discovered directly - a single TestXxx must call suite.Run(t, new(Suite)) to drive them.
How do I fix testify suite skipped?
Provide one TestXxx that runs the suite; name test methods with a Test prefix.

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card