From 811412938406c33a6d70c288ad7949a0aa33e184 Mon Sep 17 00:00:00 2001 From: Jusuf Date: Mon, 18 Nov 2024 11:05:20 +0100 Subject: [PATCH] Update astarte-ctl-test file -Add device ID generation and registration for E2E tests -Introduce support for E2E_DEVICE_TEST_2 environment variable. Signed-off-by: Jusuf --- .github/workflows/astarte-ctl-test.yaml | 3 +++ tests/conftest.py | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/astarte-ctl-test.yaml b/.github/workflows/astarte-ctl-test.yaml index 34c82ed..3631c74 100644 --- a/.github/workflows/astarte-ctl-test.yaml +++ b/.github/workflows/astarte-ctl-test.yaml @@ -131,6 +131,9 @@ jobs: TOKEN=$(astartectl utils gen-jwt all-realm-apis) echo "E2E_JWT=$TOKEN" >> $GITHUB_ENV echo "E2E_DEVICE_TEST_1=ogmcilZpRDeDWwuNfJr0yA" >> $GITHUB_ENV + E2E_DEVICE_TEST_2=$(astartectl utils device-id generate-random) + echo "E2E_DEVICE_TEST_2=$E2E_DEVICE_TEST_2" >> $GITHUB_ENV + $(astartectl pairing agent register --compact-output -- "$E2E_DEVICE_TEST_2") - name: Setup python uses: actions/setup-python@v2 diff --git a/tests/conftest.py b/tests/conftest.py index 870ed8a..5f9c30a 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -15,9 +15,10 @@ def astarte_env_vars(): realm = os.environ.get("E2E_REALM") jwt = os.environ.get("E2E_JWT") device_test_1 = os.environ.get("E2E_DEVICE_TEST_1") + device_test_2 = os.environ.get("E2E_DEVICE_TEST_2") assert ( - astarte_url and realm and jwt + astarte_url and realm and jwt and device_test_1 and device_test_2 ), "Environment variables for Astarte setup are not properly configured." return { @@ -25,4 +26,5 @@ def astarte_env_vars(): "realm": realm, "jwt": jwt, "device_test_1": device_test_1, + "device_test_2": device_test_2, }