-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Simone Orru <simone.orru@secomind.com>
- Loading branch information
Showing
8 changed files
with
209 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
# 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 | ||
|
||
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 | ||
id: astarte | ||
uses: astarte-platform/astarte-cluster-action@v1 | ||
with: | ||
astarte_version: "1.1.1" | ||
- name: Install interface | ||
run: | | ||
astartectl realm-management interfaces sync $GITHUB_WORKSPACE/e2etest/interfaces/*.json --non-interactive | ||
astartectl realm-management interfaces ls | ||
- 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
|
||
name: REUSE Compliance Check | ||
|
||
on: [push, pull_request, create] | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
check: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# 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: Upload code coverage | ||
|
||
on: | ||
workflow_run: | ||
workflows: ["build-and-unit"] | ||
types: [completed] | ||
|
||
permissions: | ||
contents: read | ||
actions: read | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
upload: | ||
runs-on: ubuntu-latest | ||
# Run only if originated from a PR | ||
if: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.workflow_run.head_sha }} | ||
- name: Download coverage artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: coverage | ||
github-token: ${{ github.token }} | ||
run-id: ${{ github.event.workflow_run.id }} | ||
- name: Get PR number | ||
run: | | ||
echo "PR_NUMBER=$(cat ./pr_number)" >> "$GITHUB_ENV" | ||
- name: Upload to codecov.io | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
token: ${{secrets.CODECOV_TOKEN}} | ||
fail_ci_if_error: true | ||
override_branch: ${{ github.event.workflow_run.head_branch }} | ||
override_commit: ${{ github.event.workflow_run.head_sha }} | ||
override_pr: ${{ env.PR_NUMBER }} |