Add support to run e2e tests serially
This commit is contained in:
parent
1109db2d09
commit
09e2466671
2 changed files with 43 additions and 25 deletions
|
@ -43,14 +43,27 @@ SCRIPT_ROOT=$(dirname ${BASH_SOURCE})/..
|
||||||
|
|
||||||
ginkgo build ./test/e2e
|
ginkgo build ./test/e2e
|
||||||
|
|
||||||
exec -- \
|
echo "Running e2e test suite..."
|
||||||
ginkgo \
|
ginkgo \
|
||||||
-randomizeSuites \
|
-randomizeSuites \
|
||||||
-randomizeAllSpecs \
|
-randomizeAllSpecs \
|
||||||
-flakeAttempts=2 \
|
-flakeAttempts=2 \
|
||||||
--focus=${FOCUS} \
|
-focus=${FOCUS} \
|
||||||
|
-skip="\[Serial\]" \
|
||||||
-p \
|
-p \
|
||||||
-trace \
|
-trace \
|
||||||
-nodes=${E2E_NODES} \
|
-nodes=${E2E_NODES} \
|
||||||
-slowSpecThreshold=${SLOW_E2E_THRESHOLD} \
|
-slowSpecThreshold=${SLOW_E2E_THRESHOLD} \
|
||||||
test/e2e/e2e.test
|
test/e2e/e2e.test
|
||||||
|
|
||||||
|
echo "Running e2e test suite with tests that require serial execution..."
|
||||||
|
ginkgo \
|
||||||
|
-randomizeSuites \
|
||||||
|
-randomizeAllSpecs \
|
||||||
|
-flakeAttempts=2 \
|
||||||
|
-focus="\[Serial\]" \
|
||||||
|
-p \
|
||||||
|
-trace \
|
||||||
|
-nodes=1 \
|
||||||
|
-slowSpecThreshold=${SLOW_E2E_THRESHOLD} \
|
||||||
|
test/e2e/e2e.test
|
||||||
|
|
|
@ -17,10 +17,12 @@ limitations under the License.
|
||||||
package settings
|
package settings
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
. "github.com/onsi/ginkgo"
|
. "github.com/onsi/ginkgo"
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
|
"github.com/parnurzeal/gorequest"
|
||||||
|
|
||||||
appsv1beta1 "k8s.io/api/apps/v1beta1"
|
appsv1beta1 "k8s.io/api/apps/v1beta1"
|
||||||
corev1 "k8s.io/api/core/v1"
|
corev1 "k8s.io/api/core/v1"
|
||||||
|
@ -36,7 +38,7 @@ const (
|
||||||
ingressControllerPSP = "ingress-controller-psp"
|
ingressControllerPSP = "ingress-controller-psp"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = framework.IngressNginxDescribe("Pod Security Policies", func() {
|
var _ = framework.IngressNginxDescribe("[Serial] Pod Security Policies", func() {
|
||||||
f := framework.NewDefaultFramework("pod-security-policies")
|
f := framework.NewDefaultFramework("pod-security-policies")
|
||||||
|
|
||||||
BeforeEach(func() {
|
BeforeEach(func() {
|
||||||
|
@ -75,8 +77,6 @@ var _ = framework.IngressNginxDescribe("Pod Security Policies", func() {
|
||||||
f.NewEchoDeployment()
|
f.NewEchoDeployment()
|
||||||
})
|
})
|
||||||
|
|
||||||
// running tests in parallel can update the cluster roles, which introduce a failure
|
|
||||||
/*
|
|
||||||
AfterEach(func() {
|
AfterEach(func() {
|
||||||
role, err := f.KubeClientSet.RbacV1().ClusterRoles().Get("nginx-ingress-clusterrole", metav1.GetOptions{})
|
role, err := f.KubeClientSet.RbacV1().ClusterRoles().Get("nginx-ingress-clusterrole", metav1.GetOptions{})
|
||||||
Expect(err).NotTo(HaveOccurred(), "getting ingress controller cluster role")
|
Expect(err).NotTo(HaveOccurred(), "getting ingress controller cluster role")
|
||||||
|
@ -98,15 +98,20 @@ var _ = framework.IngressNginxDescribe("Pod Security Policies", func() {
|
||||||
|
|
||||||
role.Rules = append(role.Rules[:index], role.Rules[index+1:]...)
|
role.Rules = append(role.Rules[:index], role.Rules[index+1:]...)
|
||||||
_, err = f.KubeClientSet.RbacV1().ClusterRoles().Update(role)
|
_, err = f.KubeClientSet.RbacV1().ClusterRoles().Update(role)
|
||||||
Expect(err).NotTo(HaveOccurred(), "updating ingress controller cluster role to use a pod security policy")
|
Expect(err).NotTo(HaveOccurred(), "updating ingress controller cluster role to not use a pod security policy")
|
||||||
})
|
})
|
||||||
*/
|
|
||||||
|
|
||||||
It("should be running with a Pod Security Policy", func() {
|
It("should be running with a Pod Security Policy", func() {
|
||||||
f.WaitForNginxConfiguration(
|
f.WaitForNginxConfiguration(
|
||||||
func(cfg string) bool {
|
func(cfg string) bool {
|
||||||
return strings.Contains(cfg, "server_tokens on")
|
return strings.Contains(cfg, "server_tokens on")
|
||||||
})
|
})
|
||||||
|
|
||||||
|
resp, _, _ := gorequest.New().
|
||||||
|
Get(f.IngressController.HTTPURL).
|
||||||
|
Set("Host", "foo.bar.com").
|
||||||
|
End()
|
||||||
|
Expect(resp.StatusCode).Should(Equal(http.StatusNotFound))
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue