This commit is contained in:
2025-12-15 17:55:32 +08:00
commit 28ab17324d
170 changed files with 18373 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
package testx
import (
"testing"
"quyun/v2/database"
"quyun/v2/providers/job"
"quyun/v2/providers/jwt"
"quyun/v2/providers/postgres"
"go.ipao.vip/atom"
"go.ipao.vip/atom/container"
"github.com/rogeecn/fabfile"
. "github.com/smartystreets/goconvey/convey"
)
func Default(providers ...container.ProviderContainer) container.Providers {
return append(container.Providers{
postgres.DefaultProvider(),
jwt.DefaultProvider(),
job.DefaultProvider(),
database.DefaultProvider(),
}, providers...)
}
func Serve(providers container.Providers, t *testing.T, invoke any) {
Convey("tests boot up", t, func() {
file := fabfile.MustFind("config.toml")
// localEnv := os.Getenv("ENV_LOCAL")
// if localEnv != "" {
// file = fabfile.MustFind("config." + localEnv + ".toml")
// }
So(atom.LoadProviders(file, providers), ShouldBeNil)
So(container.Container.Invoke(invoke), ShouldBeNil)
})
}