starsz commented on a change in pull request #1571:
URL: https://github.com/apache/apisix-dashboard/pull/1571#discussion_r592023103



##########
File path: api/test/e2enew/ssl/ssl_test.go
##########
@@ -26,38 +26,80 @@ import (
        "time"
 
        "github.com/onsi/ginkgo"
+       "github.com/onsi/ginkgo/extensions/table"
        "github.com/stretchr/testify/assert"
 
        "e2enew/base"
 )
 
 var _ = ginkgo.Describe("SSL Basic", func() {
-       ginkgo.It("test ssl basic", func() {
-               // build test body
-               t := ginkgo.GinkgoT()
-               testCert, err := ioutil.ReadFile("../../certs/test2.crt")
-               assert.Nil(t, err)
-               testKey, err := ioutil.ReadFile("../../certs/test2.key")
-               assert.Nil(t, err)
-               apisixKey, err := ioutil.ReadFile("../../certs/apisix.key")
-               assert.Nil(t, err)
-               body, err := json.Marshal(map[string]interface{}{
-                       "id":   "1",
-                       "cert": string(testCert),
-                       "key":  string(testKey),
-                       "labels": map[string]string{
-                               "build":   "16",
-                               "env":     "production",
-                               "version": "v3",
+       t := ginkgo.GinkgoT()
+       var (

Review comment:
       Yes. I had used `ginkgo.BeforeEach()` before, but we use those variables 
as the parameter later.So the `BeforeEach` can't modify those variables.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to