Skip to content

Commit

Permalink
chore: rename Stop to Shutdown (#771)
Browse files Browse the repository at this point in the history
* chore: rename Stop to Shutdown

* address comments
  • Loading branch information
hwbrzzl authored Dec 18, 2024
1 parent ecceca3 commit 1a81ebb
Show file tree
Hide file tree
Showing 29 changed files with 134 additions and 134 deletions.
4 changes: 2 additions & 2 deletions contracts/route/route.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ type Route interface {
RunTLSWithCert(host, certFile, keyFile string) error
// ServeHTTP serves HTTP requests.
ServeHTTP(writer http.ResponseWriter, request *http.Request)
// Stop gracefully stop the serve.
Stop(ctx ...context.Context) error
// Shutdown gracefully stop the serve.
Shutdown(ctx ...context.Context) error
// Test method to simulate HTTP requests (Fiber driver only)
Test(request *http.Request) (*http.Response, error)
}
Expand Down
4 changes: 2 additions & 2 deletions contracts/schedule/schedule.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ type Schedule interface {
Register(events []Event)
// Run schedules.
Run()
// Stop schedules.
Stop(ctx ...context.Context) error
// Shutdown schedules.
Shutdown(ctx ...context.Context) error
}
4 changes: 2 additions & 2 deletions contracts/testing/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ type DatabaseDriver interface {
Image(image Image)
// Ready checks if the database is ready, the Build method needs to be called first.
Ready() error
// Stop the database.
Stop() error
// Shutdown the database.
Shutdown() error
}

type DatabaseConfig struct {
Expand Down
10 changes: 5 additions & 5 deletions database/gorm/query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (s *QueryTestSuite) SetupTest() {}

func (s *QueryTestSuite) TearDownSuite() {
if s.queries[database.DriverSqlite] != nil {
s.NoError(s.queries[database.DriverSqlite].Docker().Stop())
s.NoError(s.queries[database.DriverSqlite].Docker().Shutdown())
}
}

Expand Down Expand Up @@ -3638,7 +3638,7 @@ func TestCustomConnection(t *testing.T) {
assert.NotNil(t, query.Create(&person))
assert.True(t, person.ID == 0)

assert.NoError(t, sqliteDocker.Stop())
assert.NoError(t, sqliteDocker.Shutdown())
}

func TestFilterFindConditions(t *testing.T) {
Expand Down Expand Up @@ -3801,8 +3801,8 @@ func TestReadWriteSeparate(t *testing.T) {
})
}

assert.NoError(t, dbs[database.DriverSqlite]["read"].Docker().Stop())
assert.NoError(t, dbs[database.DriverSqlite]["write"].Docker().Stop())
assert.NoError(t, dbs[database.DriverSqlite]["read"].Docker().Shutdown())
assert.NoError(t, dbs[database.DriverSqlite]["write"].Docker().Shutdown())
}

func TestTablePrefixAndSingular(t *testing.T) {
Expand All @@ -3827,7 +3827,7 @@ func TestTablePrefixAndSingular(t *testing.T) {
}

if dbs[database.DriverSqlite] != nil {
assert.NoError(t, dbs[database.DriverSqlite].Docker().Stop())
assert.NoError(t, dbs[database.DriverSqlite].Docker().Shutdown())
}
}

Expand Down
2 changes: 1 addition & 1 deletion database/migration/sql_migrator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (s *SqlMigratorSuite) SetupTest() {
func (s *SqlMigratorSuite) TearDownTest() {
s.NoError(file.Remove("database"))
if s.driverToTestQuery[contractsdatabase.DriverSqlite] != nil {
s.NoError(s.driverToTestQuery[contractsdatabase.DriverSqlite].Docker().Stop())
s.NoError(s.driverToTestQuery[contractsdatabase.DriverSqlite].Docker().Shutdown())
}
}

Expand Down
2 changes: 1 addition & 1 deletion database/orm/orm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (s *OrmSuite) SetupTest() {

func (s *OrmSuite) TearDownSuite() {
if s.testQueries[database.DriverSqlite] != nil {
s.NoError(s.testQueries[database.DriverSqlite].Docker().Stop())
s.NoError(s.testQueries[database.DriverSqlite].Docker().Shutdown())
}
}

Expand Down
2 changes: 1 addition & 1 deletion database/schema/schema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (s *SchemaSuite) SetupTest() {

func (s *SchemaSuite) TearDownTest() {
if s.driverToTestQuery[database.DriverSqlite] != nil {
s.NoError(s.driverToTestQuery[database.DriverSqlite].Docker().Stop())
s.NoError(s.driverToTestQuery[database.DriverSqlite].Docker().Shutdown())
}
}

Expand Down
2 changes: 1 addition & 1 deletion mail/application_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func TestApplicationTestSuite(t *testing.T) {
redisPort: redisDocker.Config().Port,
})

assert.Nil(t, redisDocker.Stop())
assert.Nil(t, redisDocker.Shutdown())
}

func (s *ApplicationTestSuite) SetupTest() {}
Expand Down
118 changes: 59 additions & 59 deletions mocks/route/Route.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 11 additions & 11 deletions mocks/schedule/Schedule.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 11 additions & 11 deletions mocks/testing/Database.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1a81ebb

Please sign in to comment.