Skip to content

Commit

Permalink
try all subnets
Browse files Browse the repository at this point in the history
  • Loading branch information
ab77 committed Apr 23, 2024
1 parent 7ead1c9 commit 576acfa
Showing 1 changed file with 8 additions and 36 deletions.
44 changes: 8 additions & 36 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ env:
AWS_EC2_LT_VERSION: 5
AWS_IAM_USERNAME: balena-tests-iam-User-1GXO3XP12N6LL
AWS_VPC_SECURITY_GROUP_IDS: sg-057937f4d89d9d51c
AWS_VPC_SUBNET_ID: 'subnet-02d18a08ea4058574 subnet-0a026eae1df907a09'
AWS_VPC_SUBNET_IDS: 'subnet-02d18a08ea4058574 subnet-0a026eae1df907a09'
DEBUG: '0' # https://github.com/balena-io/balena-cli/issues/2447
DEVICE_TYPE: generic-amd64
SUBDOMAIN: auto
Expand All @@ -54,15 +54,7 @@ env:
jobs:
test:
runs-on: [self-hosted, linux, X64]
if: |
(
github.event.pull_request.head.repo.full_name == github.repository &&
github.event_name == 'pull_request'
) || (
github.event.pull_request.head.repo.full_name != github.repository &&
github.event_name == 'pull_request_target'
)
timeout-minutes: 120
timeout-minutes: 60
strategy:
fail-fast: true

Expand All @@ -82,7 +74,6 @@ jobs:
# https://github.com/pdcastro/ssh-uuid#why
# https://github.com/pdcastro/ssh-uuid#linux-debian-ubuntu-others
- name: install additional dependencies
id: extra-dependencies
shell: bash
run: |
set -ue
Expand Down Expand Up @@ -150,7 +141,6 @@ jobs:
# https://github.com/balena-io/balena-cli/issues/1543
- name: pin device to draft release
id: pin-device
if: ${{ github.event_name == 'pull_request' && github.event.action != 'closed'}}
run: |
set -uae
Expand All @@ -172,12 +162,7 @@ jobs:
balena device ${{ steps.register-test-device.outputs.balena_device_uuid }}
app_id="$(balena fleet ${{ inputs.fleet }} | grep ^ID: | cut -c14-)"
echo "balena_app_id=${app_id}" >> "${GITHUB_OUTPUT}"
- name: configure test device environment
id: configure-test-env
if: ${{ github.event_name == 'pull_request' && github.event.action != 'closed'}}
run: |
set -ue
Expand Down Expand Up @@ -260,7 +245,6 @@ jobs:
--device '${{ steps.register-test-device.outputs.balena_device_uuid }}'
- name: configure test device secrets
id: configure-test-secrets
if: ${{ github.event_name == 'pull_request' && github.event.action != 'closed'}}
run: |
set -ue
Expand Down Expand Up @@ -335,7 +319,7 @@ jobs:
id: provision-ssh-key
# wait for cloud-config
# https://github.com/balena-os/cloud-config
timeout-minutes: 10
timeout-minutes: 5
if: ${{ github.event_name == 'pull_request' && github.event.action != 'closed'}}
run: |
set -ue
Expand Down Expand Up @@ -384,8 +368,7 @@ jobs:

# fall-back to QEMU software emulation when nested virtualisation is not available
- name: create dummy kvm device
id: nested-virtualisation-bypass
timeout-minutes: 10
timeout-minutes: 5
if: ${{ github.event_name == 'pull_request' && github.event.action != 'closed'}}
run: |
set -ue
Expand All @@ -406,8 +389,7 @@ jobs:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock

- name: wait for application
id: wait-application
timeout-minutes: 30
timeout-minutes: 10
if: ${{ github.event_name == 'pull_request' && github.event.action != 'closed'}}
run: |
set -ue
Expand Down Expand Up @@ -459,8 +441,7 @@ jobs:
# components are running with the latest configuration; preferred over restart via
# Supervisor API restart due to potential HTTP [timeouts](https://github.com/balena-os/balena-supervisor/issues/1157)
- name: restart components
id: restart-application
timeout-minutes: 15
timeout-minutes: 10
if: ${{ github.event_name == 'pull_request' && github.event.action != 'closed'}}
run: |
set -ue
Expand Down Expand Up @@ -495,8 +476,8 @@ jobs:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock

- name: device tests
id: device-tests
if: ${{ github.event_name == 'pull_request' && github.event.action != 'closed'}}
timeout-minutes: 20
# https://giters.com/gfx/example-github-actions-with-tty
# https://github.com/actions/runner/issues/241#issuecomment-924327172
shell: 'script -q -e -c "bash {0}"'
Expand All @@ -516,25 +497,18 @@ jobs:
--header 'authorization: Bearer ${{ secrets.BALENA_API_KEY }}' \
--header 'Content-Type:application/json' \
--data '{"uuid": "${{ steps.register-test-device.outputs.balena_device_uuid }}", "method": "GET"}' \
--compressed | jq -r '.[].services."${{ env.OPENBALENA_TESTS_SERVICE }}".status') =~ Run|run ]]; do
--compressed | jq -r '.[].services."${{ env.OPENBALENA_TESTS_SERVICE }}".status') =~ Stop|stop ]]; do
echo "::warning::Still working..."
sleep "$(( ( RANDOM % ${{ env.RETRY }} ) + ${{ env.RETRY }} ))s"
done
# (TBC) placeholder for a complete end-to-end test suite
with_backoff ssh-uuid -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
--service ${{ env.OPENBALENA_TESTS_SERVICE }} \
${{ steps.register-test-device.outputs.balena_device_uuid }}.balena \
'/root/run-tests.sh'
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
ATTEMPTS: 2

- name: remove SSH key
if: always()
id: remove-ssh-key
run: |
set -ue
Expand All @@ -551,7 +525,6 @@ jobs:
- name: destroy ephemeral test device
if: always()
id: destroy-test-device
run: |
set -ue
Expand All @@ -574,7 +547,6 @@ jobs:
# FIXME: clean up older _acme-challenge.auto TXT records
- name: cleanup-dns-records
if: always()
id: cloudflare-dns-cleanup
run: |
set -ue
Expand Down

0 comments on commit 576acfa

Please sign in to comment.