fix(tests): wait for API to be available

Signed-off-by: mudler <mudler@localai.io>
This commit is contained in:
mudler
2025-04-09 15:26:53 +02:00
parent 70282535d4
commit cb15f926e8

View File

@@ -1,6 +1,8 @@
package agent_test
import (
"net/http"
. "github.com/mudler/LocalAGI/core/agent"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
@@ -10,6 +12,14 @@ var _ = Describe("Agent test", func() {
Context("identity", func() {
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() {
var err error
agent, err = New(