fix(tests): wait for API to be available
Signed-off-by: mudler <mudler@localai.io>
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
package agent_test
|
package agent_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"net/http"
|
||||||
|
|
||||||
. "github.com/mudler/LocalAGI/core/agent"
|
. "github.com/mudler/LocalAGI/core/agent"
|
||||||
. "github.com/onsi/ginkgo/v2"
|
. "github.com/onsi/ginkgo/v2"
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
@@ -10,6 +12,14 @@ var _ = Describe("Agent test", func() {
|
|||||||
Context("identity", func() {
|
Context("identity", func() {
|
||||||
var agent *Agent
|
var agent *Agent
|
||||||
|
|
||||||
|
BeforeEach(func() {
|
||||||
|
Eventually(func() error {
|
||||||
|
// test apiURL is working and available
|
||||||
|
_, err := http.Get(apiURL + "/readyz")
|
||||||
|
return err
|
||||||
|
}, "10m", "10s").ShouldNot(HaveOccurred())
|
||||||
|
})
|
||||||
|
|
||||||
It("generates all the fields with random data", func() {
|
It("generates all the fields with random data", func() {
|
||||||
var err error
|
var err error
|
||||||
agent, err = New(
|
agent, err = New(
|
||||||
|
|||||||
Reference in New Issue
Block a user