Skip to content

Commit

Permalink
Debugging
Browse files Browse the repository at this point in the history
Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
  • Loading branch information
marckhouzam committed Nov 19, 2019
1 parent cbfff2c commit a02e37e
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 28 deletions.
3 changes: 3 additions & 0 deletions scripts/acceptance.sh
Original file line number Diff line number Diff line change
Expand Up @@ -131,5 +131,8 @@ if [[ ! -d ${ROBOT_VENV_DIR} ]]; then
pip install ${ROBOT_PY_REQUIRES}
fi

export ROBOT_DEBUG_LEVEL=2
scripts/completion-tests/test-completion.sh
exit
# Run Robot Framework, output
robot --outputdir=${ROBOT_OUTPUT_DIR} ${SUITES_TO_RUN}
25 changes: 25 additions & 0 deletions scripts/completion-tests/completionTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,32 @@

source ${COMP_DIR}/lib/completionTests-base.sh

set -x
uname -a
export PATH=${COMP_DIR}/bin:$PATH
which helm
which kubectl
ls -l $(which helm)
ls -l $(which kubectl)
cd $(dirname $(which helm))
./helm0 version
./helm1 version
./helm2 version
./helm version
./helm4 version
./helm5 version
./helm6 version
cksum ./helm0
cksum ./helm1
cksum ./helm2
cksum ./helm
cksum ./helm4
cksum ./helm5
cksum ./helm6
cd $(dirname $(which kubectl))
./kubectl version
cksum ./kubectl
set +x

# Don't use the new source <() form as it does not work with bash v3
source /dev/stdin <<- EOF
Expand Down
60 changes: 35 additions & 25 deletions scripts/completion-tests/test-completion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,40 +67,49 @@ if [[ "${GITHUB_SHA}" == "" ]]; then
cp ${CHECK_BINARY_PATH} ${COMP_DIR}/bin
else
echo "Running on GitHub Actions CI - using system-wide Helm 3 binary."
cp $(which helm0) ${COMP_DIR}/bin
cp $(which helm1) ${COMP_DIR}/bin
cp $(which helm2) ${COMP_DIR}/bin
cp $(which helm) ${COMP_DIR}/bin
cp $(which helm4) ${COMP_DIR}/bin
cp $(which helm5) ${COMP_DIR}/bin
cp $(which helm6) ${COMP_DIR}/bin
cp $(which kubectl) ${COMP_DIR}/bin
fi

# kubectl stub
cat > ${COMP_DIR}/bin/kubectl << EOF
#!/bin/sh
# return some fake namespaces
if echo "\$*" | grep -q namespace; then
if echo "\$*" | grep -q -- --context; then
echo "braavos old-valyria yunkai"
exit 0
fi
if echo "\$*" | grep -q -- --kubeconfig; then
echo "meereen myr volantis"
exit 0
fi
# cat > ${COMP_DIR}/bin/kubectl << EOF
# #!/bin/sh
# # return some fake namespaces
# if echo "\$*" | grep -q namespace; then
# if echo "\$*" | grep -q -- --context; then
# echo "braavos old-valyria yunkai"
# exit 0
# fi

# if echo "\$*" | grep -q -- --kubeconfig; then
# echo "meereen myr volantis"
# exit 0
# fi

# echo "casterly-rock white-harbor winterfell"
# exit 0
# fi

# # return some fake contexts
# if echo "\$*" | grep -q context; then
# echo "accept dev1 dev2 prod"
# exit 0
# fi
# EOF
# chmod a+x ${COMP_DIR}/bin/kubectl
# cat ${COMP_DIR}/bin/kubectl

echo "casterly-rock white-harbor winterfell"
exit 0
fi
# return some fake contexts
if echo "\$*" | grep -q context; then
echo "accept dev1 dev2 prod"
exit 0
fi
EOF
chmod a+x ${COMP_DIR}/bin/kubectl
cat ${COMP_DIR}/bin/kubectl

# Now run all tests, even if there is a failure.
# But remember if there was any failure to report it at the end.
set +e
bash -c "source ${COMP_SCRIPT}"
GOT_FAILURE=0
trap "GOT_FAILURE=1" ERR

Expand All @@ -115,6 +124,7 @@ docker build -t ${BASH4_IMAGE} - <<- EOF
RUN apk update && apk add bash-completion
EOF
docker run --rm \
-v /var/run/docker.sock:/var/run/docker.sock \
-v ${COMP_DIR}:${COMP_DIR} \
-e ROBOT_HELM_V3=${ROBOT_HELM_V3} \
-e ROBOT_DEBUG_LEVEL=${ROBOT_DEBUG_LEVEL} \
Expand Down
12 changes: 9 additions & 3 deletions scripts/github-actions-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,16 @@ mkdir -p /tmp/gopath/src/helm.sh
pushd /tmp/gopath/src/helm.sh
git clone https://github.com/helm/helm.git -b master
pushd helm/
GOPATH=/tmp/gopath make build
GOPATH=/tmp/gopath make build build-cross
popd
popd
mv /tmp/gopath/src/helm.sh/helm/bin/helm bin/helm
mv /tmp/gopath/src/helm.sh/helm/bin/helm bin/helm0
mv /tmp/gopath/src/helm.sh/helm/_dist/darwin-amd64/helm bin/helm1
mv /tmp/gopath/src/helm.sh/helm/_dist/linux-386/helm bin/helm2
mv /tmp/gopath/src/helm.sh/helm/_dist/linux-amd64/helm bin/helm
mv /tmp/gopath/src/helm.sh/helm/_dist/linux-arm/helm bin/helm4
mv /tmp/gopath/src/helm.sh/helm/_dist/linux-arm64/helm bin/helm5
mv /tmp/gopath/src/helm.sh/helm/_dist/linux-ppc64le/helm bin/helm6
helm version
which helm

Expand Down Expand Up @@ -60,7 +66,7 @@ kubectl version --client
which kubectl

# Install kind
which helm || true
which kind || true
curl -LO https://github.com/kubernetes-sigs/kind/releases/download/${KIND_VERSION}/kind-linux-amd64
chmod +x kind-linux-amd64
mv kind-linux-amd64 bin/kind
Expand Down

0 comments on commit a02e37e

Please sign in to comment.