summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwackxu <xushiwei5@huawei.com>2022-11-10 10:02:02 +0800
committerwackxu <xushiwei5@huawei.com>2023-01-14 17:42:48 +0800
commit2d238d1e9abc76712a128abeff817eafc8550933 (patch)
treeb0a87df524e7d31c1e235dc541b235df983a6d2a
parentMerge pull request #4282 from vincentgoat/localup (diff)
downloadkubeedge-2d238d1e9abc76712a128abeff817eafc8550933.tar.gz
revert ginkgo to v1
Signed-off-by: wackxu <xushiwei5@huawei.com>
-rw-r--r--.github/workflows/main.yaml10
-rw-r--r--edge/test/integration/appdeployment/application_suite_test.go2
-rw-r--r--edge/test/integration/appdeployment/application_test.go2
-rw-r--r--edge/test/integration/device/device_suite_test.go2
-rwxr-xr-xedge/test/integration/device/device_test.go2
-rw-r--r--edge/test/integration/metaserver/metaserver_suite_test.go2
-rw-r--r--edge/test/integration/metaserver/metaserver_test.go2
-rwxr-xr-xedge/test/integration/utils/common/log.go8
-rw-r--r--go.mod4
-rw-r--r--tests/e2e/deployment/deployment_test.go16
-rw-r--r--tests/e2e/deployment/device_crd_test.go16
-rw-r--r--tests/e2e/deployment/e2e_test.go2
-rw-r--r--tests/e2e/deployment/rule_crd_test.go8
-rw-r--r--tests/e2e/edgesite/edgesite_test.go12
-rw-r--r--tests/e2e/keadm/keadm_suite_test.go2
-rw-r--r--tests/e2e/keadm/keadm_test.go8
-rwxr-xr-xtests/e2e/scripts/execute.sh25
-rw-r--r--tests/e2e/testsuite/testsuite.go2
-rw-r--r--tests/e2e/utils/log.go8
19 files changed, 58 insertions, 75 deletions
diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml
index e5d842c5f..92874870c 100644
--- a/.github/workflows/main.yaml
+++ b/.github/workflows/main.yaml
@@ -19,7 +19,7 @@ on:
env:
CONTAINER_RUN_OPTIONS: " "
- GINKGO_VERSION: "v2.1.4"
+ GINKGO_VERSION: "v1.16.4"
jobs:
lint:
@@ -129,7 +129,7 @@ jobs:
- name: Install dependences
run: |
- command -v ginkgo || go install github.com/onsi/ginkgo/v2/ginkgo@${{ env.GINKGO_VERSION }}
+ command -v ginkgo || go install github.com/onsi/ginkgo/ginkgo@${{ env.GINKGO_VERSION }}
- name: Checkout code
uses: actions/checkout@v3
@@ -181,7 +181,7 @@ jobs:
- name: Install dependences
run: |
- command -v ginkgo || go install github.com/onsi/ginkgo/v2/ginkgo@${{ env.GINKGO_VERSION }}
+ command -v ginkgo || go install github.com/onsi/ginkgo/ginkgo@${{ env.GINKGO_VERSION }}
go install sigs.k8s.io/kind@v0.11.1
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.22.6/bin/linux/amd64/kubectl && sudo install kubectl /usr/local/bin/kubectl
@@ -240,7 +240,7 @@ jobs:
- name: Install dependences
run: |
- command -v ginkgo || go install github.com/onsi/ginkgo/v2/ginkgo@${{ env.GINKGO_VERSION }}
+ command -v ginkgo || go install github.com/onsi/ginkgo/ginkgo@${{ env.GINKGO_VERSION }}
go install sigs.k8s.io/kind@v0.11.1
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.22.6/bin/linux/amd64/kubectl && sudo install kubectl /usr/local/bin/kubectl
@@ -280,7 +280,7 @@ jobs:
- name: Install dependences
run: |
- command -v ginkgo || go install github.com/onsi/ginkgo/v2/ginkgo@${{ env.GINKGO_VERSION }}
+ command -v ginkgo || go install github.com/onsi/ginkgo/ginkgo@${{ env.GINKGO_VERSION }}
go install sigs.k8s.io/kind@v0.11.1
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.22.6/bin/linux/amd64/kubectl && sudo install kubectl /usr/local/bin/kubectl
diff --git a/edge/test/integration/appdeployment/application_suite_test.go b/edge/test/integration/appdeployment/application_suite_test.go
index c4a959434..dadd24a3c 100644
--- a/edge/test/integration/appdeployment/application_suite_test.go
+++ b/edge/test/integration/appdeployment/application_suite_test.go
@@ -19,7 +19,7 @@ package application_test
import (
"testing"
- . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/kubeedge/kubeedge/edge/test/integration/utils"
diff --git a/edge/test/integration/appdeployment/application_test.go b/edge/test/integration/appdeployment/application_test.go
index 2208cf89d..6b51020b4 100644
--- a/edge/test/integration/appdeployment/application_test.go
+++ b/edge/test/integration/appdeployment/application_test.go
@@ -20,7 +20,7 @@ import (
"net/http"
"time"
- . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
diff --git a/edge/test/integration/device/device_suite_test.go b/edge/test/integration/device/device_suite_test.go
index 1565c29ab..3e421cc44 100644
--- a/edge/test/integration/device/device_suite_test.go
+++ b/edge/test/integration/device/device_suite_test.go
@@ -21,7 +21,7 @@ import (
"testing"
"time"
- . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/kubeedge/kubeedge/edge/pkg/devicetwin/dtcommon"
diff --git a/edge/test/integration/device/device_test.go b/edge/test/integration/device/device_test.go
index 14451b384..23b1bff56 100755
--- a/edge/test/integration/device/device_test.go
+++ b/edge/test/integration/device/device_test.go
@@ -23,7 +23,7 @@ import (
MQTT "github.com/eclipse/paho.mqtt.golang"
_ "github.com/mattn/go-sqlite3"
- . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/kubeedge/kubeedge/edge/pkg/devicetwin/dtcommon"
diff --git a/edge/test/integration/metaserver/metaserver_suite_test.go b/edge/test/integration/metaserver/metaserver_suite_test.go
index a73ec3c14..e2998efbd 100644
--- a/edge/test/integration/metaserver/metaserver_suite_test.go
+++ b/edge/test/integration/metaserver/metaserver_suite_test.go
@@ -3,7 +3,7 @@ package metaserver_test
import (
"testing"
- . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/kubeedge/kubeedge/edge/test/integration/utils"
diff --git a/edge/test/integration/metaserver/metaserver_test.go b/edge/test/integration/metaserver/metaserver_test.go
index 09fb2eb07..681537919 100644
--- a/edge/test/integration/metaserver/metaserver_test.go
+++ b/edge/test/integration/metaserver/metaserver_test.go
@@ -3,7 +3,7 @@ package metaserver
import (
"net/http"
- . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"k8s.io/apimachinery/pkg/runtime/schema"
)
diff --git a/edge/test/integration/utils/common/log.go b/edge/test/integration/utils/common/log.go
index 92c856858..18be56712 100755
--- a/edge/test/integration/utils/common/log.go
+++ b/edge/test/integration/utils/common/log.go
@@ -20,7 +20,7 @@ import (
"fmt"
"time"
- "github.com/onsi/ginkgo/v2"
+ "github.com/onsi/ginkgo"
)
//Function to get time in millisec
@@ -49,11 +49,11 @@ func Infof(format string, args ...interface{}) {
//Function to print the test case name and status of execution
func PrintTestcaseNameandStatus() {
var Status string
- testSpecReport := ginkgo.CurrentSpecReport()
- if testSpecReport.Failed() {
+ testSpecReport := ginkgo.CurrentGinkgoTestDescription()
+ if testSpecReport.Failed {
Status = "FAILED"
} else {
Status = "PASSED"
}
- Infof("TestCase:%40s Status=%s", testSpecReport.LeafNodeText, Status)
+ Infof("TestCase:%40s Status=%s", testSpecReport.TestText, Status)
}
diff --git a/go.mod b/go.mod
index 885286bcb..6c24be906 100644
--- a/go.mod
+++ b/go.mod
@@ -24,8 +24,8 @@ require (
github.com/kubernetes-csi/csi-lib-utils v0.6.1
github.com/mattn/go-sqlite3 v1.14.9
github.com/mitchellh/go-ps v0.0.0-20190716172923-621e5597135b
- github.com/onsi/ginkgo/v2 v2.1.4
- github.com/onsi/gomega v1.19.0
+ github.com/onsi/ginkgo v1.16.4
+ github.com/onsi/gomega v1.15.0
github.com/prometheus/client_golang v1.11.0
github.com/shirou/gopsutil v2.21.11+incompatible
github.com/spf13/cobra v1.2.1
diff --git a/tests/e2e/deployment/deployment_test.go b/tests/e2e/deployment/deployment_test.go
index 00193ea82..c8fb1e969 100644
--- a/tests/e2e/deployment/deployment_test.go
+++ b/tests/e2e/deployment/deployment_test.go
@@ -21,7 +21,7 @@ import (
"fmt"
"time"
- . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
@@ -41,7 +41,7 @@ var DeploymentTestTimerGroup = utils.NewTestTimerGroup()
var _ = Describe("Application deployment test in E2E scenario", func() {
var UID string
var testTimer *utils.TestTimer
- var testSpecReport SpecReport
+ var testSpecReport GinkgoTestDescription
var clientSet clientset.Interface
@@ -52,9 +52,9 @@ var _ = Describe("Application deployment test in E2E scenario", func() {
Context("Test application deployment and delete deployment using deployment spec", func() {
BeforeEach(func() {
// Get current test SpecReport
- testSpecReport = CurrentSpecReport()
+ testSpecReport = CurrentGinkgoTestDescription()
// Start test timer
- testTimer = DeploymentTestTimerGroup.NewTestTimer(testSpecReport.LeafNodeText)
+ testTimer = DeploymentTestTimerGroup.NewTestTimer(testSpecReport.TestText)
})
AfterEach(func() {
@@ -121,9 +121,9 @@ var _ = Describe("Application deployment test in E2E scenario", func() {
Context("Test application deployment using Pod spec", func() {
BeforeEach(func() {
// Get current test SpecReport
- testSpecReport = CurrentSpecReport()
+ testSpecReport = CurrentGinkgoTestDescription()
// Start test timer
- testTimer = DeploymentTestTimerGroup.NewTestTimer(testSpecReport.LeafNodeText)
+ testTimer = DeploymentTestTimerGroup.NewTestTimer(testSpecReport.TestText)
})
AfterEach(func() {
// End test timer
@@ -228,9 +228,9 @@ var _ = Describe("Application deployment test in E2E scenario", func() {
Context("StatefulSet lifecycle test in edge node", func() {
BeforeEach(func() {
// Get current test SpecReport
- testSpecReport = CurrentSpecReport()
+ testSpecReport = CurrentGinkgoTestDescription()
// Start test timer
- testTimer = DeploymentTestTimerGroup.NewTestTimer(testSpecReport.LeafNodeText)
+ testTimer = DeploymentTestTimerGroup.NewTestTimer(testSpecReport.TestText)
})
AfterEach(func() {
diff --git a/tests/e2e/deployment/device_crd_test.go b/tests/e2e/deployment/device_crd_test.go
index fb8cd4f60..38d9cdfb7 100644
--- a/tests/e2e/deployment/device_crd_test.go
+++ b/tests/e2e/deployment/device_crd_test.go
@@ -21,7 +21,7 @@ import (
"net/http"
"time"
- . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -40,7 +40,7 @@ var CRDTestTimerGroup = utils.NewTestTimerGroup()
// Run Test cases
var _ = Describe("Device Management test in E2E scenario", func() {
var testTimer *utils.TestTimer
- var testSpecReport SpecReport
+ var testSpecReport GinkgoTestDescription
var clientSet clientset.Interface
var edgeClientSet edgeclientset.Interface
@@ -59,9 +59,9 @@ var _ = Describe("Device Management test in E2E scenario", func() {
Expect(err).To(BeNil())
}
// Get current test SpecReport
- testSpecReport = CurrentSpecReport()
+ testSpecReport = CurrentGinkgoTestDescription()
// Start test timer
- testTimer = CRDTestTimerGroup.NewTestTimer(testSpecReport.LeafNodeText)
+ testTimer = CRDTestTimerGroup.NewTestTimer(testSpecReport.TestText)
})
AfterEach(func() {
// End test timer
@@ -171,9 +171,9 @@ var _ = Describe("Device Management test in E2E scenario", func() {
}
utils.TwinResult = utils.DeviceTwinResult{}
// Get current test SpecReport
- testSpecReport = CurrentSpecReport()
+ testSpecReport = CurrentGinkgoTestDescription()
// Start test timer
- testTimer = CRDTestTimerGroup.NewTestTimer(testSpecReport.LeafNodeText)
+ testTimer = CRDTestTimerGroup.NewTestTimer(testSpecReport.TestText)
})
AfterEach(func() {
// End test timer
@@ -595,9 +595,9 @@ var _ = Describe("Device Management test in E2E scenario", func() {
}
utils.TwinResult = utils.DeviceTwinResult{}
// Get current test SpecReport
- testSpecReport = CurrentSpecReport()
+ testSpecReport = CurrentGinkgoTestDescription()
// Start test timer
- testTimer = CRDTestTimerGroup.NewTestTimer(testSpecReport.LeafNodeText)
+ testTimer = CRDTestTimerGroup.NewTestTimer(testSpecReport.TestText)
})
AfterEach(func() {
// End test timer
diff --git a/tests/e2e/deployment/e2e_test.go b/tests/e2e/deployment/e2e_test.go
index 883f2d5bf..9be6b9916 100644
--- a/tests/e2e/deployment/e2e_test.go
+++ b/tests/e2e/deployment/e2e_test.go
@@ -21,7 +21,7 @@ import (
"os"
"testing"
- . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/spf13/pflag"
diff --git a/tests/e2e/deployment/rule_crd_test.go b/tests/e2e/deployment/rule_crd_test.go
index fa39203e2..62e9281a4 100644
--- a/tests/e2e/deployment/rule_crd_test.go
+++ b/tests/e2e/deployment/rule_crd_test.go
@@ -5,7 +5,7 @@ import (
"net/http"
"time"
- . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
v1 "github.com/kubeedge/kubeedge/pkg/apis/rules/v1"
@@ -15,7 +15,7 @@ import (
var _ = Describe("Rule Management test in E2E scenario", func() {
var testTimer *utils.TestTimer
- var testSpecReport SpecReport
+ var testSpecReport GinkgoTestDescription
var edgeClientSet edgeclientset.Interface
BeforeEach(func() {
@@ -40,9 +40,9 @@ var _ = Describe("Rule Management test in E2E scenario", func() {
Expect(err).To(BeNil())
}
// Get current test SpecReport
- testSpecReport = CurrentSpecReport()
+ testSpecReport = CurrentGinkgoTestDescription()
// Start test timer
- testTimer = CRDTestTimerGroup.NewTestTimer(testSpecReport.LeafNodeText)
+ testTimer = CRDTestTimerGroup.NewTestTimer(testSpecReport.TestText)
})
AfterEach(func() {
// End test timer
diff --git a/tests/e2e/edgesite/edgesite_test.go b/tests/e2e/edgesite/edgesite_test.go
index 270d62d4e..fe035c61c 100644
--- a/tests/e2e/edgesite/edgesite_test.go
+++ b/tests/e2e/edgesite/edgesite_test.go
@@ -20,7 +20,7 @@ import (
"fmt"
"time"
- . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
metav1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
@@ -38,7 +38,7 @@ var DeploymentTestTimerGroup = utils.NewTestTimerGroup()
var _ = Describe("Application deployment test in E2E scenario using EdgeSite", func() {
var UID string
var testTimer *utils.TestTimer
- var testSpecReport SpecReport
+ var testSpecReport GinkgoTestDescription
var clientSet clientset.Interface
@@ -49,9 +49,9 @@ var _ = Describe("Application deployment test in E2E scenario using EdgeSite", f
Context("Test application deployment and delete deployment using deployment spec", func() {
BeforeEach(func() {
// Get current test SpecReport
- testSpecReport = CurrentSpecReport()
+ testSpecReport = CurrentGinkgoTestDescription()
// Start test timer
- testTimer = DeploymentTestTimerGroup.NewTestTimer(testSpecReport.LeafNodeText)
+ testTimer = DeploymentTestTimerGroup.NewTestTimer(testSpecReport.TestText)
})
AfterEach(func() {
@@ -117,9 +117,9 @@ var _ = Describe("Application deployment test in E2E scenario using EdgeSite", f
Context("Test application deployment using Pod spec using EdgeSite", func() {
BeforeEach(func() {
// Get current test SpecReport
- testSpecReport = CurrentSpecReport()
+ testSpecReport = CurrentGinkgoTestDescription()
// Start test timer
- testTimer = DeploymentTestTimerGroup.NewTestTimer(testSpecReport.LeafNodeText)
+ testTimer = DeploymentTestTimerGroup.NewTestTimer(testSpecReport.TestText)
})
AfterEach(func() {
diff --git a/tests/e2e/keadm/keadm_suite_test.go b/tests/e2e/keadm/keadm_suite_test.go
index 7b9b9aa12..a8bd3df26 100644
--- a/tests/e2e/keadm/keadm_suite_test.go
+++ b/tests/e2e/keadm/keadm_suite_test.go
@@ -21,7 +21,7 @@ import (
"os"
"testing"
- . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/spf13/pflag"
diff --git a/tests/e2e/keadm/keadm_test.go b/tests/e2e/keadm/keadm_test.go
index 022e336a4..d83056153 100644
--- a/tests/e2e/keadm/keadm_test.go
+++ b/tests/e2e/keadm/keadm_test.go
@@ -17,7 +17,7 @@ limitations under the License.
package keadm
import (
- . "github.com/onsi/ginkgo/v2"
+ . "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
@@ -33,7 +33,7 @@ var DeploymentTestTimerGroup = utils.NewTestTimerGroup()
//Run Test cases
var _ = Describe("Application deployment test in keadm E2E scenario", func() {
var testTimer *utils.TestTimer
- var testSpecReport SpecReport
+ var testSpecReport GinkgoTestDescription
var clientSet clientset.Interface
@@ -44,9 +44,9 @@ var _ = Describe("Application deployment test in keadm E2E scenario", func() {
Context("Test application deployment using Pod spec", func() {
BeforeEach(func() {
// Get current test SpecReport
- testSpecReport = CurrentSpecReport()
+ testSpecReport = CurrentGinkgoTestDescription()
// Start test timer
- testTimer = DeploymentTestTimerGroup.NewTestTimer(testSpecReport.LeafNodeText)
+ testTimer = DeploymentTestTimerGroup.NewTestTimer(testSpecReport.TestText)
})
AfterEach(func() {
// End test timer
diff --git a/tests/e2e/scripts/execute.sh b/tests/e2e/scripts/execute.sh
index c3ee96397..11f5b8b30 100755
--- a/tests/e2e/scripts/execute.sh
+++ b/tests/e2e/scripts/execute.sh
@@ -24,32 +24,15 @@ echo $PWD
GOPATH=${GOPATH:-$(go env GOPATH)}
-check_ginkgo_v2() {
- # check if ginkgo is installed
- which ginkgo &> /dev/null || (
- echo "ginkgo is not found, install first"
- go install github.com/onsi/ginkgo/v2/ginkgo@v2.1.4
- sudo cp $GOPATH/bin/ginkgo /usr/local/bin/
- return
- )
-
- # check if the ginkgo version is v2
- local -a ginkgo_version_output
- read -ra ginkgo_version_output <<< $(ginkgo version)
- # Assuming ginkgo version output format is:
- # Ginkgo Version 2.1.4
- if [[ "${ginkgo_version_output[2]}" != "2.1.4" ]]; then
- echo "ginkgo version is not v2.1.4, reinstall ginkgo v2.1.4"
- go install github.com/onsi/ginkgo/v2/ginkgo@v2.1.4
- sudo cp $GOPATH/bin/ginkgo /usr/local/bin/
- fi
-}
+which ginkgo &> /dev/null || (
+ go install github.com/onsi/ginkgo/ginkgo@latest
+ sudo cp $GOPATH/bin/ginkgo /usr/local/bin/
+)
cleanup() {
bash ${curpath}/tests/e2e/scripts/cleanup.sh
}
-check_ginkgo_v2
cleanup
E2E_DIR=${curpath}/tests/e2e
diff --git a/tests/e2e/testsuite/testsuite.go b/tests/e2e/testsuite/testsuite.go
index c8a1a7bcf..84bad9dbc 100644
--- a/tests/e2e/testsuite/testsuite.go
+++ b/tests/e2e/testsuite/testsuite.go
@@ -20,7 +20,7 @@ import (
"fmt"
"time"
- "github.com/onsi/ginkgo/v2"
+ "github.com/onsi/ginkgo"
"github.com/onsi/gomega"
"k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/labels"
diff --git a/tests/e2e/utils/log.go b/tests/e2e/utils/log.go
index 7268fd2d9..55b4dde98 100644
--- a/tests/e2e/utils/log.go
+++ b/tests/e2e/utils/log.go
@@ -19,7 +19,7 @@ import (
"fmt"
"time"
- "github.com/onsi/ginkgo/v2"
+ "github.com/onsi/ginkgo"
)
//Function to get time in millisec
@@ -54,11 +54,11 @@ func Infof(format string, args ...interface{}) {
//Function to print the test case name and status of execution
func PrintTestcaseNameandStatus() {
var Status string
- testSpecReport := ginkgo.CurrentSpecReport()
- if testSpecReport.Failed() {
+ testSpecReport := ginkgo.CurrentGinkgoTestDescription()
+ if testSpecReport.Failed {
Status = "FAILED"
} else {
Status = "PASSED"
}
- Infof("TestCase:%40s Status=%s", testSpecReport.LeafNodeText, Status)
+ Infof("TestCase:%40s Status=%s", testSpecReport.TestText, Status)
}