Skip to content

Commit

Permalink
fix e2e test in ci
Browse files Browse the repository at this point in the history
Signed-off-by: NKDYX <2374087322@qq.com>
  • Loading branch information
NKDYX committed Sep 19, 2022
1 parent b86e618 commit 32b2b50
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 20 deletions.
Binary file modified build/helm/edgemesh-gateway.tgz
Binary file not shown.
Binary file modified build/helm/edgemesh.tgz
Binary file not shown.
9 changes: 3 additions & 6 deletions hack/local-up-edgemesh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ build_component_image() {
}

load_images_to_master() {
kind load --name $CLUSTER_NAME docker-image $SERVER_IMAGE
kind load --name $CLUSTER_NAME docker-image $AGENT_IMAGE
}

Expand All @@ -165,15 +164,13 @@ prepare_k8s_env() {

start_edgemesh() {
echo "using helm to install edgemesh"
helm install edgemesh \
--set server.image=${SERVER_IMAGE} \
--set server.nodeName=${MASTER_NODENAME} \
helm install edgemesh --namespace kubeedge \
--set agent.image=${AGENT_IMAGE} \
--set agent.kubeAPIConfig.master=${KUBEAPI_PROXY_ADDR} \
--set agent.modules.edgeDNS.cacheDNS.enable=true \
--set relayNodes[0].nodeName=${MASTER_NODENAME},relayNodes[0].advertiseAddress={${HOST_IP}} \
./build/helm/edgemesh

kubectl wait --timeout=${TIMEOUT} --for=condition=Ready pod -l kubeedge=edgemesh-server -n kubeedge
kubectl wait --timeout=${TIMEOUT} --for=condition=Ready pod -l kubeedge=edgemesh-agent -n kubeedge

add_debug_info "See edgemesh status: kubectl get pod -n $NAMESPACE"
Expand Down Expand Up @@ -267,7 +264,7 @@ do_up() {

create_istio_crd

build_component_image agent server
build_component_image agent
load_images_to_master

start_edgemesh
Expand Down
2 changes: 1 addition & 1 deletion hack/verify-helm-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ set -o pipefail

KUBE_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)"
EDGEMESH_HELM_DIR=${KUBE_ROOT}/build/helm/edgemesh
GATEWAY_HELM_DIR=${KUBE_ROOT}/build/helm/gateway
GATEWAY_HELM_DIR=${KUBE_ROOT}/build/helm/edgemesh-gateway
HELM_DIR=${KUBE_ROOT}/build/helm
_tmpdir=/tmp/edgemesh

Expand Down
25 changes: 13 additions & 12 deletions tests/e2e/scripts/fast_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,23 @@ cd ../

export MASTER_IP=`docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' test-control-plane`
export KUBECONFIG=$HOME/.kube/config

export CHECK_EDGECORE_ENVIRONMENT="false"

#Pre-configurations required for running the suite.
#Any new config addition required corresponding code changes.
cat >config.json<<END
{
"k8smasterforkubeedge":"https://$MASTER_IP:6443",
"kubeconfigpath":"$KUBECONFIG"
}
END

if [ $# -eq 0 ]
then
#run testcase
sudo ./traffic/traffic.test $debugflag 2>&1 | sudo tee -a /tmp/testcase.log
ginkgo -v ./traffic/traffic.test -- \
$debugflag \
--kube-master="https://$MASTER_IP:6443" \
--kubeconfig=$KUBECONFIG \
--test.v \
2>&1 | sudo tee -a /tmp/testcase.log
else
./$compilemodule/$compilemodule.test $debugflag $runtest 2>&1 | tee -a /tmp/testcase.log
ginkgo -v ./$compilemodule/$compilemodule.test -- \
$debugflag \
$runtest \
--kube-master="https://$MASTER_IP:6443" \
--kubeconfig=$KUBECONFIG \
--test.v \
2>&1 | tee -a /tmp/testcase.log
fi
13 changes: 12 additions & 1 deletion tests/e2e/traffic/traffic_suite_test.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
package traffic

import (
"flag"
"math/rand"
"os"
"testing"
"time"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/spf13/pflag"

"github.com/kubeedge/edgemesh/tests/e2e/k8s"
"github.com/kubeedge/kubeedge/tests/e2e/utils"
Expand All @@ -19,6 +22,14 @@ var (
busyboxToolName = "busybox-edge-tools-" + utils.GetRandomString(5)
)

func TestMain(m *testing.M) {
utils.CopyFlags(utils.Flags, flag.CommandLine)
utils.RegisterFlags(flag.CommandLine)
pflag.CommandLine.AddGoFlagSet(flag.CommandLine)
pflag.Parse()
os.Exit(m.Run())
}

func TestEdgeMeshTraffic(t *testing.T) {
rand.Seed(time.Now().Unix())
RegisterFailHandler(Fail)
Expand All @@ -41,5 +52,5 @@ func TestEdgeMeshTraffic(t *testing.T) {
err := k8s.CleanBusyBoxTool(busyboxToolName, ctx)
Expect(err).To(BeNil())
})
RunSpecs(t, "Traffic Suite")
RunSpecs(t, "EdgeMesh App Traffic Suite")
}

0 comments on commit 32b2b50

Please sign in to comment.