Skip to content

Commit

Permalink
Update astarte-ctl-test file
Browse files Browse the repository at this point in the history
-Add device ID generation and registration for E2E tests
-Introduce support for E2E_DEVICE_TEST_2 environment variable.

Signed-off-by: Jusuf <[email protected]>
  • Loading branch information
Jusuf95 committed Nov 18, 2024
1 parent 0d6977d commit 8114129
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/workflows/astarte-ctl-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@ 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 {
"astarte_url": astarte_url,
"realm": realm,
"jwt": jwt,
"device_test_1": device_test_1,
"device_test_2": device_test_2,
}

0 comments on commit 8114129

Please sign in to comment.