Feat: add healthz
This commit is contained in:
27
tests/00_healthz_test.go
Normal file
27
tests/00_healthz_test.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package tests
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/go-resty/resty/v2"
|
||||
)
|
||||
|
||||
var client *resty.Client
|
||||
|
||||
func Test_00_Healthz(t *testing.T) {
|
||||
for i := 0; i < 10; i++ {
|
||||
resp, err := client.R().
|
||||
Get("http://localhost:8080/healthz")
|
||||
if err == nil && resp.StatusCode() == http.StatusOK {
|
||||
return
|
||||
}
|
||||
time.Sleep(time.Second)
|
||||
}
|
||||
t.Fatal("server did not ready")
|
||||
}
|
||||
|
||||
func init() {
|
||||
client = resty.New()
|
||||
}
|
||||
Reference in New Issue
Block a user