Refactor e2e tests to use testify y httpexpect

This commit is contained in:
Manuel Alejandro de Brito Fontes 2020-02-19 00:08:56 -03:00
parent 046e2d959d
commit f9624cbe46
80 changed files with 2280 additions and 2631 deletions

View file

@ -20,8 +20,8 @@ import (
"regexp"
"strings"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/onsi/ginkgo"
"github.com/stretchr/testify/assert"
"k8s.io/ingress-nginx/test/e2e/framework"
)
@ -29,17 +29,17 @@ import (
var _ = framework.DescribeSetting("Configmap change", func() {
f := framework.NewDefaultFramework("configmap-change")
BeforeEach(func() {
ginkgo.BeforeEach(func() {
f.NewEchoDeployment()
})
It("should reload after an update in the configuration", func() {
ginkgo.It("should reload after an update in the configuration", func() {
host := "configmap-change"
ing := framework.NewSingleIngress(host, "/", host, f.Namespace, framework.EchoService, 80, nil)
f.EnsureIngress(ing)
By("adding a whitelist-source-range")
ginkgo.By("adding a whitelist-source-range")
f.UpdateNginxConfigMapData("whitelist-source-range", "1.1.1.1")
@ -56,9 +56,9 @@ var _ = framework.DescribeSetting("Configmap change", func() {
return strings.Contains(cfg, "allow 1.1.1.1;")
})
Expect(checksum).NotTo(BeEmpty())
assert.NotEmpty(ginkgo.GinkgoT(), checksum)
By("changing error-log-level")
ginkgo.By("changing error-log-level")
f.UpdateNginxConfigMapData("error-log-level", "debug")
@ -72,6 +72,6 @@ var _ = framework.DescribeSetting("Configmap change", func() {
return strings.ContainsAny(cfg, "error_log /var/log/nginx/error.log debug;")
})
Expect(checksum).NotTo(BeEquivalentTo(newChecksum))
assert.NotEqual(ginkgo.GinkgoT(), checksum, newChecksum)
})
})