|
|
@ -124,6 +124,8 @@ var _ = Describe("API test", func() { |
|
|
|
var c context.Context |
|
|
|
var c context.Context |
|
|
|
var cancel context.CancelFunc |
|
|
|
var cancel context.CancelFunc |
|
|
|
var tmpdir string |
|
|
|
var tmpdir string |
|
|
|
|
|
|
|
commonOpts := []options.AppOption{options.WithDebug(false), |
|
|
|
|
|
|
|
options.WithDisableMessage(true)} |
|
|
|
|
|
|
|
|
|
|
|
Context("API with ephemeral models", func() { |
|
|
|
Context("API with ephemeral models", func() { |
|
|
|
BeforeEach(func() { |
|
|
|
BeforeEach(func() { |
|
|
@ -159,9 +161,10 @@ var _ = Describe("API test", func() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
app, err = App( |
|
|
|
app, err = App( |
|
|
|
options.WithContext(c), |
|
|
|
append(commonOpts, |
|
|
|
options.WithGalleries(galleries), |
|
|
|
options.WithContext(c), |
|
|
|
options.WithModelLoader(modelLoader), options.WithBackendAssets(backendAssets), options.WithBackendAssetsOutput(tmpdir)) |
|
|
|
options.WithGalleries(galleries), |
|
|
|
|
|
|
|
options.WithModelLoader(modelLoader), options.WithBackendAssets(backendAssets), options.WithBackendAssetsOutput(tmpdir))...) |
|
|
|
Expect(err).ToNot(HaveOccurred()) |
|
|
|
Expect(err).ToNot(HaveOccurred()) |
|
|
|
go app.Listen("127.0.0.1:9090") |
|
|
|
go app.Listen("127.0.0.1:9090") |
|
|
|
|
|
|
|
|
|
|
@ -400,13 +403,14 @@ var _ = Describe("API test", func() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
app, err = App( |
|
|
|
app, err = App( |
|
|
|
options.WithContext(c), |
|
|
|
append(commonOpts, |
|
|
|
options.WithAudioDir(tmpdir), |
|
|
|
options.WithContext(c), |
|
|
|
options.WithImageDir(tmpdir), |
|
|
|
options.WithAudioDir(tmpdir), |
|
|
|
options.WithGalleries(galleries), |
|
|
|
options.WithImageDir(tmpdir), |
|
|
|
options.WithModelLoader(modelLoader), |
|
|
|
options.WithGalleries(galleries), |
|
|
|
options.WithBackendAssets(backendAssets), |
|
|
|
options.WithModelLoader(modelLoader), |
|
|
|
options.WithBackendAssetsOutput(tmpdir), |
|
|
|
options.WithBackendAssets(backendAssets), |
|
|
|
|
|
|
|
options.WithBackendAssetsOutput(tmpdir))..., |
|
|
|
) |
|
|
|
) |
|
|
|
Expect(err).ToNot(HaveOccurred()) |
|
|
|
Expect(err).ToNot(HaveOccurred()) |
|
|
|
go app.Listen("127.0.0.1:9090") |
|
|
|
go app.Listen("127.0.0.1:9090") |
|
|
@ -500,7 +504,9 @@ var _ = Describe("API test", func() { |
|
|
|
c, cancel = context.WithCancel(context.Background()) |
|
|
|
c, cancel = context.WithCancel(context.Background()) |
|
|
|
|
|
|
|
|
|
|
|
var err error |
|
|
|
var err error |
|
|
|
app, err = App(options.WithContext(c), options.WithModelLoader(modelLoader)) |
|
|
|
app, err = App( |
|
|
|
|
|
|
|
append(commonOpts, |
|
|
|
|
|
|
|
options.WithContext(c), options.WithModelLoader(modelLoader))...) |
|
|
|
Expect(err).ToNot(HaveOccurred()) |
|
|
|
Expect(err).ToNot(HaveOccurred()) |
|
|
|
go app.Listen("127.0.0.1:9090") |
|
|
|
go app.Listen("127.0.0.1:9090") |
|
|
|
|
|
|
|
|
|
|
@ -674,7 +680,12 @@ var _ = Describe("API test", func() { |
|
|
|
c, cancel = context.WithCancel(context.Background()) |
|
|
|
c, cancel = context.WithCancel(context.Background()) |
|
|
|
|
|
|
|
|
|
|
|
var err error |
|
|
|
var err error |
|
|
|
app, err = App(options.WithContext(c), options.WithModelLoader(modelLoader), options.WithConfigFile(os.Getenv("CONFIG_FILE"))) |
|
|
|
app, err = App( |
|
|
|
|
|
|
|
append(commonOpts, |
|
|
|
|
|
|
|
options.WithContext(c), |
|
|
|
|
|
|
|
options.WithModelLoader(modelLoader), |
|
|
|
|
|
|
|
options.WithConfigFile(os.Getenv("CONFIG_FILE")))..., |
|
|
|
|
|
|
|
) |
|
|
|
Expect(err).ToNot(HaveOccurred()) |
|
|
|
Expect(err).ToNot(HaveOccurred()) |
|
|
|
go app.Listen("127.0.0.1:9090") |
|
|
|
go app.Listen("127.0.0.1:9090") |
|
|
|
|
|
|
|
|
|
|
|