kiiteä sleep retry logiikkaan
CI Feature / Load example-gitea-env.conf to pipeline env (push) Successful in 19s
unit-tests Link to Bats reports
CI Feature / Bats tests (push) Successful in 1m36s
acc-tests Link to Cucumber reports
CI Feature / Cucumber tests (push) Successful in 1m5s
CI Feature / Report Summary (push) Successful in 5s
CI Feature / Load example-gitea-env.conf to pipeline env (push) Successful in 19s
unit-tests Link to Bats reports
CI Feature / Bats tests (push) Successful in 1m36s
acc-tests Link to Cucumber reports
CI Feature / Cucumber tests (push) Successful in 1m5s
CI Feature / Report Summary (push) Successful in 5s
This commit is contained in:
@@ -24,6 +24,14 @@ _wait_port_free() {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_wait_port_ready() {
|
||||||
|
local i=0
|
||||||
|
while ! lsof -ti ":$MOCK_PORT" >/dev/null 2>&1 && [ $i -lt 5 ]; do
|
||||||
|
sleep 0.2
|
||||||
|
i=$((i + 1))
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
mock_set_sequence() {
|
mock_set_sequence() {
|
||||||
MOCK_SEQUENCE_FILE=$(mktemp)
|
MOCK_SEQUENCE_FILE=$(mktemp)
|
||||||
echo "$1" | jq -c '.' > "$MOCK_SEQUENCE_FILE"
|
echo "$1" | jq -c '.' > "$MOCK_SEQUENCE_FILE"
|
||||||
@@ -55,7 +63,7 @@ mock_start() {
|
|||||||
nohup python3 "$(dirname "${BASH_SOURCE[0]}")/mock-server.py" "$MOCK_PORT" "$MOCK_CONFIG_FILE" "$MOCK_REQUEST_FILE" \
|
nohup python3 "$(dirname "${BASH_SOURCE[0]}")/mock-server.py" "$MOCK_PORT" "$MOCK_CONFIG_FILE" "$MOCK_REQUEST_FILE" \
|
||||||
</dev/null >/dev/null 2>&1 &
|
</dev/null >/dev/null 2>&1 &
|
||||||
MOCK_PID=$!
|
MOCK_PID=$!
|
||||||
sleep 1
|
_wait_port_ready
|
||||||
}
|
}
|
||||||
|
|
||||||
mock_stop() {
|
mock_stop() {
|
||||||
|
|||||||
Reference in New Issue
Block a user