Skip to content

e2e-tests-scheduled #511

e2e-tests-scheduled

e2e-tests-scheduled #511

# Runs the E2E tests against a set of branches every day.
#
# Note that the workflow file is always used from main, even when running against a different branch.
#
# DEVNOTE:
#
# Keep `jobs` in sync with e2e-tests-manual.yaml. Differences are:
#
# - manual has `on: workflow_dispatch` while scheduled has `on: schedule`
# - manual uses `github.event.inputs` for the branch while scheduled uses `strategy.matrix`
name: 'e2e-tests-scheduled'
on:
schedule:
- cron: '0 1 * * *'
jobs:
suite-setup:
if: "github.repository == 'Azure/iot-identity-service'"
runs-on:
- self-hosted
- 1ES.Pool=iot-identity-1es-hosted-linux-amd64
- 1ES.ImageOverride=agent-aziotedge-ubuntu-22.04-msmoby
strategy:
fail-fast: false
matrix:
branch:
- 'main'
- 'release/1.4'
max-parallel: 10
steps:
- uses: 'actions/checkout@v3'
with:
ref: "${{ matrix.branch }}"
- name: 'Run'
run: |
timeout 20m ./ci/e2e-tests/suite-setup.sh
env:
BRANCH: "${{ matrix.branch }}"
AZURE_RESOURCE_GROUP_NAME: "${{ secrets.AZURE_RESOURCE_GROUP_NAME }}"
AZURE_LOCATION: "${{ secrets.AZURE_LOCATION }}"
test-run:
if: "github.repository == 'Azure/iot-identity-service'"
needs: 'suite-setup'
runs-on:
- self-hosted
- 1ES.Pool=iot-identity-1es-hosted-linux-amd64
- 1ES.ImageOverride=agent-aziotedge-ubuntu-22.04-msmoby
strategy:
fail-fast: false
matrix:
branch:
- 'main'
- 'release/1.4'
os:
- 'centos:7'
- 'debian:10'
- 'debian:11'
- 'debian:12'
# EL8 VMs spontaneously lose ssh after installing updates. Disable it for now.
# - 'platform:el8'
- 'platform:el9'
- 'ubuntu:20.04'
- 'ubuntu:22.04'
test_name:
- 'manual-symmetric-key'
- 'manual-x509'
- 'dps-symmetric-key'
- 'dps-x509'
exclude:
# centos:7 and debian:10 are supported in 1.4, not 1.5
- os: 'centos:7'
branch: 'main'
- os: 'debian:10'
branch: 'main'
# The scheduled E2E test in the release/1.x branch would fail until the changes are merged. Excluding for now.
- os: 'ubuntu:22.04'
branch: 'release/1.4'
- os: 'platform:el9'
branch: 'release/1.4'
max-parallel: 10
steps:
- uses: 'actions/checkout@v3'
with:
ref: "${{ matrix.branch }}"
- name: 'Run'
run: |
timeout 30m ./ci/e2e-tests/test-run.sh '${{ matrix.test_name }}' &&
timeout 5m ./ci/e2e-tests/test-cleanup.sh '${{ matrix.test_name }}'
env:
BRANCH: "${{ matrix.branch }}"
OS: "${{ matrix.os }}"
AZURE_RESOURCE_GROUP_NAME: "${{ secrets.AZURE_RESOURCE_GROUP_NAME }}"
AZURE_LOCATION: "${{ secrets.AZURE_LOCATION }}"
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: 'Clean up on failure'
run: |
timeout 5m ./ci/e2e-tests/test-cleanup.sh ${{ matrix.test_name }}
exit 1 # Force the workflow to fail even if this step succeeds
if: "${{ failure() }}"
env:
BRANCH: "${{ matrix.branch }}"
OS: "${{ matrix.os }}"
AZURE_RESOURCE_GROUP_NAME: "${{ secrets.AZURE_RESOURCE_GROUP_NAME }}"
AZURE_LOCATION: "${{ secrets.AZURE_LOCATION }}"
suite-cleanup:
if: "${{ github.repository == 'Azure/iot-identity-service' && success() }}"
needs: 'test-run'
runs-on:
- self-hosted
- 1ES.Pool=iot-identity-1es-hosted-linux-amd64
- 1ES.ImageOverride=agent-aziotedge-ubuntu-22.04-msmoby
strategy:
fail-fast: false
matrix:
branch:
- 'main'
- 'release/1.4'
max-parallel: 10
steps:
- uses: 'actions/checkout@v3'
with:
ref: "${{ matrix.branch }}"
- name: 'Clean up'
run: |
timeout 5m ./ci/e2e-tests/suite-cleanup.sh
env:
BRANCH: "${{ matrix.branch }}"
AZURE_RESOURCE_GROUP_NAME: "${{ secrets.AZURE_RESOURCE_GROUP_NAME }}"
AZURE_LOCATION: "${{ secrets.AZURE_LOCATION }}"
suite-cleanup-fail:
needs: 'test-run'
if: "${{ failure() }}"
runs-on:
- self-hosted
- 1ES.Pool=iot-identity-1es-hosted-linux-amd64
- 1ES.ImageOverride=agent-aziotedge-ubuntu-22.04-msmoby
strategy:
fail-fast: false
matrix:
branch:
- 'main'
- 'release/1.4'
max-parallel: 10
steps:
- uses: 'actions/checkout@v3'
with:
ref: "${{ matrix.branch }}"
- name: 'Clean up on failure'
run: |
timeout 5m ./ci/e2e-tests/suite-cleanup.sh
exit 1 # Force the workflow to fail even if this step succeeds
env:
BRANCH: "${{ matrix.branch }}"
AZURE_RESOURCE_GROUP_NAME: "${{ secrets.AZURE_RESOURCE_GROUP_NAME }}"
AZURE_LOCATION: "${{ secrets.AZURE_LOCATION }}"