Skip to content

Commit

Permalink
fix args passing (#2010)
Browse files Browse the repository at this point in the history
  • Loading branch information
cofyc authored Mar 23, 2020
1 parent 1f09144 commit cd4302a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
18 changes: 9 additions & 9 deletions hack/run-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -325,11 +325,11 @@ e2e_args=(
--
--clean-start=true
--delete-namespace-on-failure=false
--repo-root=$ROOT
--repo-root="$ROOT"
# tidb-operator e2e flags
--operator-tag=e2e
--operator-image=${TIDB_OPERATOR_IMAGE}
--e2e-image=${E2E_IMAGE}
--operator-image="${TIDB_OPERATOR_IMAGE}"
--e2e-image="${E2E_IMAGE}"
# two tidb versions can be configuraed: <defaultVersion>,<upgradeToVersion>
--tidb-versions=v3.0.7,v3.0.8
--chart-dir=/charts
Expand All @@ -354,18 +354,18 @@ docker_args=(
if [ "$PROVIDER" == "eks" ]; then
e2e_args+=(
--provider=aws
--gce-zone ${AWS_REGION}
--gce-zone="${AWS_REGION}"
)
# aws credential is required to get token for EKS
docker_args+=(
-v $HOME/.aws:/root/.aws
)
elif [ "$PROVIDER" == "gke" ]; then
e2e_args+=(
--provider=${PROVIDER}
--gce-project ${GCP_PROJECT}
--gce-region ${GCP_REGION}
--gce-zone ${GCP_ZONE}
--provider="${PROVIDER}"
--gce-project="${GCP_PROJECT}"
--gce-region="${GCP_REGION}"
--gce-zone="${GCP_ZONE}"
)
docker_args+=(
-v ${GCP_CREDENTIALS}:${GCP_CREDENTIALS}
Expand All @@ -382,7 +382,7 @@ elif [ "$PROVIDER" == "gke" ]; then
)
else
e2e_args+=(
--provider=${PROVIDER}
--provider="${PROVIDER}"
)
fi

Expand Down
5 changes: 5 additions & 0 deletions tests/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"time"

e2econfig "github.com/pingcap/tidb-operator/tests/e2e/config"
"k8s.io/klog"
"k8s.io/kubernetes/test/e2e/framework"
"k8s.io/kubernetes/test/e2e/framework/config"
"k8s.io/kubernetes/test/e2e/framework/testfiles"
Expand Down Expand Up @@ -52,6 +53,10 @@ func TestMain(m *testing.M) {
// Register test flags, then parse flags.
handleFlags()

flag.CommandLine.VisitAll(func(flag *flag.Flag) {
klog.V(1).Infof("FLAG: --%s=%q", flag.Name, flag.Value)
})

// Now that we know which Viper config (if any) was chosen,
// parse it and update those options which weren't already set via command line flags
// (which have higher priority).
Expand Down

0 comments on commit cd4302a

Please sign in to comment.