fix dates on mac
This commit is contained in:
parent
d5708f38ca
commit
d92bd8d272
|
@ -37,7 +37,7 @@ if [[ ! -f "$cypress_run_file" ]]; then
|
|||
echo "success,duration,start_time,end_time,frontend_url" >"$cypress_run_file"
|
||||
fi
|
||||
|
||||
frontend_url="${SPIFFWORKFLOW_FRONTEND_URL:localhost}"
|
||||
frontend_url="${SPIFFWORKFLOW_FRONTEND_URL:-localhost}"
|
||||
|
||||
for attempt in $(seq 1 "$ATTEMPTS" ); do
|
||||
echo "Running attempt: ${attempt}"
|
||||
|
@ -48,7 +48,14 @@ for attempt in $(seq 1 "$ATTEMPTS" ); do
|
|||
success="true"
|
||||
fi
|
||||
end_time=$(date +%s)
|
||||
if is_mac; then
|
||||
formatted_start_time=$(date -r "${start_time}" +"%Y-%m-%dT%H-%M-%S")
|
||||
formatted_end_time=$(date -r "${end_time}" +"%Y-%m-%dT%H-%M-%S")
|
||||
else
|
||||
formatted_start_time=$(date "-d@${start_time}" +"%Y-%m-%dT%H-%M-%S")
|
||||
formatted_end_time=$(date "-d@${end_time}" +"%Y-%m-%dT%H-%M-%S")
|
||||
fi
|
||||
|
||||
echo "${success},$(( end_time - start_time )),$(date "-d@${start_time}"),$(date "-d@${end_time}"),${frontend_url}" >>"$cypress_run_file"
|
||||
echo "${success},$(( end_time - start_time )),${formatted_start_time},${formatted_end_time},${frontend_url}" >>"$cypress_run_file"
|
||||
done
|
||||
echo "Recorded stats to ${cypress_run_file}"
|
||||
|
|
Loading…
Reference in New Issue