Skip to content

Bump fsfe/reuse-action from 4 to 5 #34

Bump fsfe/reuse-action from 4 to 5

Bump fsfe/reuse-action from 4 to 5 #34

# This file is part of Astarte.
#
# Copyright 2024 SECO Mind Srl
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
name: End to End test MQTT
on: [pull_request]
env:
PB_REL: https://github.com/protocolbuffers/protobuf/releases
jobs:
e2e-test-mqtt:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
concurrency:
group: e2e-test-mqtt-${{ matrix.python-version }}-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Create Astarte Cluster
uses: astarte-platform/astarte-cluster-action@v1
with:
astarte_version: "1.2.0"
- name: Install interface
working-directory: ./.github/workflows
timeout-minutes: 3
run: ./install_interfaces.sh $GITHUB_WORKSPACE/e2etest/interfaces
- name: Setup env variables common for all devices
run: |
echo "E2E_REALM=test" >> $GITHUB_ENV
APPENGINE_TOKEN=$(astartectl utils gen-jwt appengine)
echo "E2E_APPENGINE_TOKEN=$APPENGINE_TOKEN" >> $GITHUB_ENV
echo "E2E_APPENGINE_URL=https://api.autotest.astarte-platform.org/appengine" >> $GITHUB_ENV
echo "E2E_PAIRING_URL=https://api.autotest.astarte-platform.org/pairing" >> $GITHUB_ENV
- name: Setup env variables for device 1
run: |
DEVICE_1_ID=$(astartectl utils device-id generate-random)
echo "E2E_DEVICE_1_ID=$DEVICE_1_ID" >> $GITHUB_ENV
CREDENTIALS_SECRET_1=$(astartectl pairing agent register --compact-output -- "$DEVICE_1_ID")
echo "E2E_CREDENTIALS_SECRET_1=$CREDENTIALS_SECRET_1" >> $GITHUB_ENV
- name: Setup env variables for device 2
run: |
DEVICE_2_ID=$(astartectl utils device-id generate-random)
echo "E2E_DEVICE_2_ID=$DEVICE_2_ID" >> $GITHUB_ENV
CREDENTIALS_SECRET_2=$(astartectl pairing agent register --compact-output -- "$DEVICE_2_ID")
echo "E2E_CREDENTIALS_SECRET_2=$CREDENTIALS_SECRET_2" >> $GITHUB_ENV
- name: Setup env variables for device 3
run: |
DEVICE_3_ID=$(astartectl utils device-id generate-random)
echo "E2E_DEVICE_3_ID=$DEVICE_3_ID" >> $GITHUB_ENV
CREDENTIALS_SECRET_3=$(astartectl pairing agent register --compact-output -- "$DEVICE_3_ID")
echo "E2E_CREDENTIALS_SECRET_3=$CREDENTIALS_SECRET_3" >> $GITHUB_ENV
- name: Install the Astarte device Python module
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -e .[e2e]
- name: Run test base
uses: nick-fields/retry@v3
with:
timeout_seconds: 60
max_attempts: 2
command: |
export REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
python3 e2etest/base/main.py --mock_data_n 1
python3 e2etest/base/main.py --mock_data_n 2
- name: Run test for persistency
uses: nick-fields/retry@v3
with:
timeout_seconds: 30
max_attempts: 2
command: |
export REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
python3 e2etest/persistency/main.py
- name: Run test for reconnection
uses: nick-fields/retry@v3
with:
timeout_seconds: 30
max_attempts: 2
command: |
export REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
python3 e2etest/reconnection/main.py