Skip to content

Commit

Permalink
feat(test): check healthServer of apiserver
Browse files Browse the repository at this point in the history
  • Loading branch information
paralta committed Aug 9, 2023
1 parent 338aaa2 commit d397a9a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
7 changes: 3 additions & 4 deletions end_to_end_test/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ import (
"github.com/go-logr/logr"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/openclarity/vmclarity/api/models"
"github.com/openclarity/vmclarity/end_to_end_test/testenv"
"github.com/openclarity/vmclarity/pkg/shared/backendclient"
"net/http"
"os"
"strconv"
"testing"
Expand Down Expand Up @@ -86,11 +86,10 @@ func beforeSuite(ctx context.Context) {
client, err = backendclient.Create(fmt.Sprintf("%s://%s/%s", u.Scheme, u.Host, u.Path))
Expect(err).NotTo(HaveOccurred())

// todo(adam.tagscherer): create a proper readyz endpoint for the api
By("waiting until VMClarity API is ready")
Eventually(func() bool {
_, err = client.GetScanConfigs(ctx, models.GetScanConfigsParams{})
return err == nil
resp, err := http.Get("http://localhost:8081/healthz/ready")
return err == nil && resp.StatusCode == http.StatusOK
}, time.Second*5).Should(BeTrue())
}

Expand Down
1 change: 1 addition & 0 deletions installation/docker/dockercompose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ services:
- info
ports:
- "8888:8888"
- "8081:8081"
env_file: ./apiserver.env
deploy:
mode: replicated
Expand Down

0 comments on commit d397a9a

Please sign in to comment.