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

@ -17,19 +17,21 @@ limitations under the License.
package annotations
import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"strings"
"github.com/onsi/ginkgo"
"k8s.io/ingress-nginx/test/e2e/framework"
)
var _ = framework.DescribeAnnotation("upstream-vhost", func() {
f := framework.NewDefaultFramework("upstreamvhost")
BeforeEach(func() {
f.NewEchoDeploymentWithReplicas(2)
ginkgo.BeforeEach(func() {
f.NewEchoDeployment()
})
It("set host to upstreamvhost.bar.com", func() {
ginkgo.It("set host to upstreamvhost.bar.com", func() {
host := "upstreamvhost.foo.com"
annotations := map[string]string{
"nginx.ingress.kubernetes.io/upstream-vhost": "upstreamvhost.bar.com",
@ -40,7 +42,7 @@ var _ = framework.DescribeAnnotation("upstream-vhost", func() {
f.WaitForNginxServer(host,
func(server string) bool {
return Expect(server).Should(ContainSubstring(`proxy_set_header Host "upstreamvhost.bar.com";`))
return strings.Contains(server, `proxy_set_header Host "upstreamvhost.bar.com";`)
})
})
})