Skip to content

Commit

Permalink
fix acceptance tests
Browse files Browse the repository at this point in the history
  • Loading branch information
missylbytes committed Jun 8, 2023
1 parent 4ffae4d commit d262fd1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
13 changes: 12 additions & 1 deletion acceptance/tests/api-gateway/api_gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,17 @@ func TestAPIGateway_Basic(t *testing.T) {
k8s.RunKubectlAndGetOutputE(t, ctx.KubectlOptions(t), "delete", "-k", "../fixtures/bases/api-gateway")
})

// Create certificate secret, we do this separately since
// applying the secret will make an invalid certificate that breaks other tests
logger.Log(t, "creating certificate secret")
out, err = k8s.RunKubectlAndGetOutputE(t, ctx.KubectlOptions(t), "apply", "-f", "../fixtures/bases/api-gateway/certificate.yaml")
require.NoError(t, err, out)
helpers.Cleanup(t, cfg.NoCleanupOnFailure, func() {
// Ignore errors here because if the test ran as expected
// the custom resources will have been deleted.
k8s.RunKubectlAndGetOutputE(t, ctx.KubectlOptions(t), "delete", "-f", "../fixtures/bases/api-gateway/certificate.yaml")
})

// patch certificate with data
logger.Log(t, "patching certificate secret with generated data")
certificate := generateCertificate(t, nil, "gateway.test.local")
Expand Down Expand Up @@ -259,7 +270,7 @@ func TestAPIGateway_Basic(t *testing.T) {

// Test that we can make a call to the api gateway
// via the static-client pod. It should route to the static-server pod.
logger.Log(t, "trying calls to api gateway http: ", targetHTTPAddress) // TODO: Melisa remove before merging
logger.Log(t, "trying calls to api gateway http")
k8s.CheckStaticServerConnectionSuccessful(t, k8sOptions, StaticClientName, targetHTTPAddress)

logger.Log(t, "trying calls to api gateway tcp")
Expand Down
6 changes: 1 addition & 5 deletions acceptance/tests/fixtures/bases/api-gateway/httproute.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,4 @@ metadata:
name: http-route
spec:
parentRefs:
- name: gateway
rules:
- backendRefs:
- kind: Service
name: static-server
- name: gateway
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ resources:
- gatewayclass.yaml
- apigateway.yaml
- httproute.yaml
- meshservice.yaml
- certificate.yaml
- meshservice.yaml

0 comments on commit d262fd1

Please sign in to comment.