aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorClement Delafargue <clement.delafargue@fretlink.com>2020-06-30 09:30:04 +0200
committerClement Delafargue <clement.delafargue@fretlink.com>2020-06-30 15:31:57 +0200
commit783f91c2e0228ef9e057b810b4b60c4f669ebab4 (patch)
treefefb7204dca70fbce021a0067bc79612d6ec11b3 /tests
parentfacc275a703d3bccc320e5577eb3d050f99dff0e (diff)
downloadansible-clever-783f91c2e0228ef9e057b810b4b60c4f669ebab4.tar.gz
ansible-clever-783f91c2e0228ef9e057b810b4b60c4f669ebab4.tar.zst
ansible-clever-783f91c2e0228ef9e057b810b4b60c4f669ebab4.zip
Make commit ids overridable in the script mock
Diffstat (limited to 'tests')
-rwxr-xr-xtests/fake.sh9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/fake.sh b/tests/fake.sh
index bbb4380..0303b61 100755
--- a/tests/fake.sh
+++ b/tests/fake.sh
@@ -1,14 +1,17 @@
1#!/usr/bin/env bash 1#!/usr/bin/env bash
2 2
3binary="${0/*\/}" 3binary="${0/*\/}"
4fakeCommit="aaa000aaa000aaa000aaa000aaa000aaa000aaa0" 4localCommit="${PRETEND_LOCAL_COMMIT:-aaa000aaa000aaa000aaa000aaa000aaa000aaa0}"
5remoteCommit="${PRETEND_REMOTE_COMMIT:-bbb000bbb000bbb000bbb000bbb000bbb000bbb0}"
5 6
6if [ "${binary}" = "clever" ] && [ "${1}" = "--version" ]; then 7if [ "${binary}" = "clever" ] && [ "${1}" = "--version" ]; then
7 echo "2.6.1" 8 echo "2.6.1"
8elif [ "${binary}" = "clever" ] && [ "${1}" = "activity" ]; then 9elif [ "${binary}" = "clever" ] && [ "${1}" = "activity" ]; then
9 echo "2020-02-02T20:20:02+02:00 OK DEPLOY ${fakeCommit} Git" 10 echo "2020-02-02T20:20:02+02:00 OK DEPLOY ${remoteCommit} Git"
11elif [ "${binary}" = "clever" ] && [ "${1}" = "status" ]; then
12 echo "test-app: running (1*pico, Commit: ${remoteCommit})"
10elif [ "${binary}" = "git" ]; then 13elif [ "${binary}" = "git" ]; then
11 echo "${fakeCommit}" 14 echo "${localCommit}"
12else 15else
13 echo "${1}" >> "${binary}-commands" 16 echo "${1}" >> "${binary}-commands"
14 echo "${binary} called with arguments: ${*}" 17 echo "${binary} called with arguments: ${*}"