a9d81a1094
remove parallel to stabilize ci/cd
55 lines
1.3 KiB
Go
55 lines
1.3 KiB
Go
package endtoend_test
|
|
|
|
import (
|
|
"fmt"
|
|
"net/http"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
"queryorchestration/internal/test"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestQueryAPIAccessories(t *testing.T) {
|
|
ctx := t.Context()
|
|
|
|
cfg := &Config{}
|
|
|
|
c, cleanup := test.CreateAPINetwork(t, ctx, cfg, test.QueryAPI)
|
|
defer cleanup()
|
|
|
|
resp, err := http.Get(fmt.Sprintf("%s/swagger/doc.json", c.API.URI))
|
|
require.NoError(t, err)
|
|
defer resp.Body.Close()
|
|
assert.NotNil(t, resp)
|
|
assert.Equal(t, http.StatusOK, resp.StatusCode)
|
|
|
|
resp, err = http.Get(fmt.Sprintf("%s/swagger/doc.yaml", c.API.URI))
|
|
require.NoError(t, err)
|
|
defer resp.Body.Close()
|
|
assert.NotNil(t, resp)
|
|
assert.Equal(t, http.StatusOK, resp.StatusCode)
|
|
|
|
resp, err = http.Get(fmt.Sprintf("%s/swagger/index.html", c.API.URI))
|
|
require.NoError(t, err)
|
|
defer resp.Body.Close()
|
|
assert.NotNil(t, resp)
|
|
assert.Equal(t, http.StatusOK, resp.StatusCode)
|
|
|
|
resp, err = http.Get(fmt.Sprintf("%s/metrics", c.API.URI))
|
|
require.NoError(t, err)
|
|
defer resp.Body.Close()
|
|
assert.NotNil(t, resp)
|
|
assert.Equal(t, http.StatusOK, resp.StatusCode)
|
|
|
|
resp, err = http.Get(fmt.Sprintf("%s/health", c.API.URI))
|
|
require.NoError(t, err)
|
|
defer resp.Body.Close()
|
|
assert.NotNil(t, resp)
|
|
assert.Equal(t, http.StatusOK, resp.StatusCode)
|
|
|
|
test.PrintContainerLogs(t, c.API.Container)
|
|
}
|