Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
ab77 committed Apr 30, 2024
1 parent ede70a5 commit 0e6a408
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -441,9 +441,9 @@ jobs:
with_backoff ssh-uuid -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
${{ steps.register-test-device.outputs.balena_device_uuid }}.balena \
'balena ps -q | xargs balena inspect \
| jq -re '.[] | select(.Name | (contains("_supervisor") or contains("sut_") or contains("dut_")) | not).Id' \
| xargs balena restart'
"balena ps -q | xargs balena inspect \
| jq -re '.[] | select(.Name | (contains(\"_supervisor\") or contains(\"sut_\") or contains(\"dut_\")) | not).Id' \
| xargs balena restart"
# wait for Docker healthchecks (ignore Supervisor and test services)
while with_backoff ssh-uuid -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
Expand Down Expand Up @@ -480,9 +480,9 @@ jobs:
# ensure SUT and DUT are running
with_backoff ssh-uuid -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
${{ steps.register-test-device.outputs.balena_device_uuid }}.balena \
"balena container ls -a --format='{{json .}}' \
| jq -re 'select(.Names | (startswith("sut_")) or startswith("dut_")).ID' \
| xargs balena start"
"balena ps -q | xargs balena inspect \
| jq -re '.[] | select(.Name | (contains(\"sut_\") or contains(\"dut_\"))).Id' \
| xargs balena restart"
# tests service is working while its status == running
status=''
Expand Down Expand Up @@ -514,13 +514,10 @@ jobs:
# .. check its exit code
expected_exit_code=0
response="$(with_backoff ssh-uuid -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
actual_exit_code="$(with_backoff ssh-uuid -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
${{ steps.register-test-device.outputs.balena_device_uuid }}.balena \
"balena container ls -a --format='{{json .}}' \
| jq -re 'select(.Names | startswith("sut_")).ID' \
| xargs balena inspect")"
actual_exit_code="$(echo "${response}" | jq -r '.[].State.ExitCode')"
"balena ps -q | xargs balena inspect \
| jq -re '.[] | select(.Name | contains(\"sut_\")).State.ExitCode'")
[[ $expected_exit_code -eq $actual_exit_code ]] || false
Expand Down

0 comments on commit 0e6a408

Please sign in to comment.