Skip to content

Commit

Permalink
Cleanup test code
Browse files Browse the repository at this point in the history
Signed-off-by: Yang Ding <[email protected]>
  • Loading branch information
Dyanngg committed Feb 25, 2022
1 parent 38c19ef commit 7d637a9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 162 deletions.
148 changes: 0 additions & 148 deletions ci/jenkins/clean-mc.sh

This file was deleted.

26 changes: 13 additions & 13 deletions ci/jenkins/test-mc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ DEFAULT_KUBECONFIG_PATH=$DEFAULT_WORKDIR/kube.conf
WORKDIR=$DEFAULT_WORKDIR
TESTCASE=""
TEST_FAILURE=false
DOCKER_REGISTRY=$(head -n1 "/var/lib/jenkins/antrea/ci/docker-registry")
GO_VERSION=$(head -n1 "/var/lib/jenkins/antrea/build/images/deps/go-version")
DOCKER_REGISTRY=$(head -n1 "${WORKSPACE}/ci/docker-registry")
GO_VERSION=$(head -n1 "${WORKSPACE}/build/images/deps/go-version")
IMAGE_PULL_POLICY="Always"
MULTICLUSTER_KUBECONFIG_PATH=$WORKDIR/.kube
LEADER_CLUSTER_CONFIG="--kubeconfig=$MULTICLUSTER_KUBECONFIG_PATH/leader"
Expand Down Expand Up @@ -115,11 +115,11 @@ function cleanup_multicluster_ns {
function cleanup_multicluster_controller {
echo "====== Cleanup Multicluster Controller Installation ======"
kubeconfig=$1
for multicluster_yml in /var/lib/jenkins/antrea/multicluster/test/yamls/*.yml; do
for multicluster_yml in ${WORKSPACE}/multicluster/test/yamls/*.yml; do
kubectl delete -f $multicluster_yml $kubeconfig --ignore-not-found=true --timeout=30s || true
done

for multicluster_yml in /var/lib/jenkins/antrea/multicluster/build/yamls/*.yml; do
for multicluster_yml in ${WORKSPACE}/multicluster/build/yamls/*.yml; do
kubectl delete -f $multicluster_yml $kubeconfig --ignore-not-found=true --timeout=30s || true
done
}
Expand Down Expand Up @@ -278,17 +278,17 @@ function run_multicluster_e2e {

done

# set +e
# mkdir -p `pwd`/antrea-multicluster-test-logs
# go test -v antrea.io/antrea/multicluster/test/e2e --logs-export-dir `pwd`/antrea-multicluster-test-logs
# if [[ "$?" != "0" ]]; then
# TEST_FAILURE=true
# fi
# set -e
set +e
mkdir -p `pwd`/antrea-multicluster-test-logs
go test -v antrea.io/antrea/multicluster/test/e2e --logs-export-dir `pwd`/antrea-multicluster-test-logs
if [[ "$?" != "0" ]]; then
TEST_FAILURE=true
fi
set -e
}

#trap clean_multicluster EXIT
#clean_tmp
trap clean_multicluster EXIT
clean_tmp

if [[ ${TESTCASE} =~ "e2e" ]]; then
deliver_antrea_multicluster
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ func (r *ResourceExport) Default() {
if namespaceLabelVal, exists := r.Labels[common.SourceNamespace]; !exists || namespaceLabelVal != "" {
r.Labels[common.SourceNamespace] = ""
}
// TODO: put sourceClusterID for leader cluster?
if kindLabelVal, exists := r.Labels[common.SourceKind]; !exists || kindLabelVal != common.AntreaClusterNetworkPolicyKind {
r.Labels[common.SourceKind] = common.AntreaClusterNetworkPolicyKind
}
Expand Down

0 comments on commit 7d637a9

Please sign in to comment.