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 18, 2019
1 parent cbfff2c commit 5699554
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 27 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}
13 changes: 13 additions & 0 deletions scripts/completion-tests/completionTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,20 @@

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))
./helm version
cksum ./helm
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
55 changes: 29 additions & 26 deletions scripts/completion-tests/test-completion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,32 +71,34 @@ else
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
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
# 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

bash -c "source ${COMP_SCRIPT}"

# Now run all tests, even if there is a failure.
# But remember if there was any failure to report it at the end.
Expand All @@ -115,6 +117,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
2 changes: 1 addition & 1 deletion scripts/github-actions-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,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 5699554

Please sign in to comment.