Refactor e2e tests to use testify y httpexpect
This commit is contained in:
parent
046e2d959d
commit
f9624cbe46
80 changed files with 2280 additions and 2631 deletions
|
|
@ -17,8 +17,9 @@ 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"
|
||||
)
|
||||
|
|
@ -26,11 +27,11 @@ import (
|
|||
var _ = framework.DescribeAnnotation("enable-access-log enable-rewrite-log", func() {
|
||||
f := framework.NewDefaultFramework("log")
|
||||
|
||||
BeforeEach(func() {
|
||||
f.NewEchoDeploymentWithReplicas(2)
|
||||
ginkgo.BeforeEach(func() {
|
||||
f.NewEchoDeployment()
|
||||
})
|
||||
|
||||
It("set access_log off", func() {
|
||||
ginkgo.It("set access_log off", func() {
|
||||
host := "log.foo.com"
|
||||
annotations := map[string]string{
|
||||
"nginx.ingress.kubernetes.io/enable-access-log": "false",
|
||||
|
|
@ -41,11 +42,11 @@ var _ = framework.DescribeAnnotation("enable-access-log enable-rewrite-log", fun
|
|||
|
||||
f.WaitForNginxServer(host,
|
||||
func(server string) bool {
|
||||
return Expect(server).Should(ContainSubstring(`access_log off;`))
|
||||
return strings.Contains(server, `access_log off;`)
|
||||
})
|
||||
})
|
||||
|
||||
It("set rewrite_log on", func() {
|
||||
ginkgo.It("set rewrite_log on", func() {
|
||||
host := "log.foo.com"
|
||||
annotations := map[string]string{
|
||||
"nginx.ingress.kubernetes.io/enable-rewrite-log": "true",
|
||||
|
|
@ -56,7 +57,7 @@ var _ = framework.DescribeAnnotation("enable-access-log enable-rewrite-log", fun
|
|||
|
||||
f.WaitForNginxServer(host,
|
||||
func(server string) bool {
|
||||
return Expect(server).Should(ContainSubstring(`rewrite_log on;`))
|
||||
return strings.Contains(server, `rewrite_log on;`)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue