Skip to content

e2e-tests-scheduled #1505

e2e-tests-scheduled

e2e-tests-scheduled #1505

# 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
# The end-to-end tests run against all shipping/supported versions of the service. Usually
# only one version is supported at any given time, but when a new major/minor version is
# released there's a six-month transition period where both the new and previous versions
# are supported. The main branch is the latest version (e.g., 1.n), and the release/1.x branch
# is the previous version (where x == n-1).
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:
- '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'
- 'ubuntu:24.04'
test_name:
- 'manual-symmetric-key'
- 'manual-x509'
- 'dps-symmetric-key'
- 'dps-x509'
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 }}"