Skip to content

Commit

Permalink
test ci
Browse files Browse the repository at this point in the history
  • Loading branch information
hwbrzzl committed Nov 15, 2024
1 parent d948621 commit 5a75fa6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions support/docker/container_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package docker

import (
"fmt"
"github.com/goravel/framework/support/carbon"
"github.com/goravel/framework/support/color"
"io"
"os"
Expand Down Expand Up @@ -68,7 +69,7 @@ func (r *ContainerManager) Get(containerType ContainerType) (testing.DatabaseDri
err error
)

color.Red().Printf("Test---Get: Ready to set lock, containerType: %v, tempfile: %s", containerType, r.file)
color.Red().Printf("Test---Get: Ready to set lock, containerType: %v, tempfile: %s, now: %s\n", containerType, r.file, carbon.Now().ToDateTimeString())
r.lock()
defer r.unlock()

Expand All @@ -83,15 +84,15 @@ func (r *ContainerManager) Get(containerType ContainerType) (testing.DatabaseDri
databaseDriver = r.databaseConfigToDatabaseDriver(containerType, containerTypeToDatabaseConfig[containerType])
}
}
color.Red().Printf("Test---Get: filtered containers: %+v\n", databaseDriver)
color.Red().Printf("Test---Get: filtered containers, databaseDriver: %+v, containerType: %v\n", databaseDriver, containerType)
if databaseDriver == nil {
database := fmt.Sprintf("goravel_%s", str.Random(6))
color.Red().Println("Test---Get: driver is empty, going to create new container", database)
databaseDriver, err = r.Create(containerType, database, r.username, r.password)
if err != nil {
return nil, err
}

Check warning on line 94 in support/docker/container_manager.go

View check run for this annotation

Codecov / codecov/patch

support/docker/container_manager.go#L93-L94

Added lines #L93 - L94 were not covered by tests
color.Red().Printf("Test---Get: created a new container: %+v\n", databaseDriver)
color.Red().Printf("Test---Get: created a new container, databaseDriver: %+v, containerType: %v\n", databaseDriver, containerType)
// Sqlite doesn't need to create a docker container, so it doesn't need to be added to the file, and create it every time.
if containerType != ContainerTypeSqlite {
color.Red().Printf("Test---Get: going to add the new container\n")
Expand Down Expand Up @@ -205,7 +206,7 @@ func (r *ContainerManager) lock() {
}

func (r *ContainerManager) unlock() {
color.Red().Printf("Test---unlock\n")
color.Red().Printf("Test---unlock, now: %s\n", carbon.Now().ToDateTimeString())
if err := file.Remove(r.lockFile); err != nil {
panic(err)

Check warning on line 211 in support/docker/container_manager.go

View check run for this annotation

Codecov / codecov/patch

support/docker/container_manager.go#L211

Added line #L211 was not covered by tests
}
Expand Down

0 comments on commit 5a75fa6

Please sign in to comment.