Skip to content

Commit 75986e6

Browse files
authored
Merge pull request astarte-platform#432 from joshuachp/refactor/e2e-test
refactor(e2e): improve the e2e-test
2 parents 164cc1a + 664bddf commit 75986e6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+3403
-2305
lines changed

.github/workflows/e2e-test.yaml

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,10 @@ env:
2929
CARGO_TERM_COLOR: always
3030
SCCACHE_GHA_ENABLED: "true"
3131
RUSTC_WRAPPER: "sccache"
32-
RUST_LOG: debug
33-
ASTARTE_PROTOCOL: https
34-
ASTARTE_BASE_DOMAIN: autotest.astarte-platform.org
32+
# e2e-config
3533
E2E_REALM: "test"
36-
E2E_API_URL: https://api.autotest.astarte-platform.org/appengine
37-
E2E_PAIRING_URL: https://api.autotest.astarte-platform.org/pairing
34+
E2E_BASE_DOMAIN: autotest.astarte-platform.org
35+
E2E_SECURE_TRANSPORT: "true"
3836
jobs:
3937
e2e-test:
4038
runs-on: ubuntu-24.04
@@ -51,22 +49,21 @@ jobs:
5149
- uses: mozilla-actions/sccache-action@v0.0.9
5250
- name: Wait for Astarte to be healthy
5351
timeout-minutes: 10
54-
run: ./scripts/wait-for-astarte.sh
52+
# use the full command to use the sccache
53+
run: |
54+
cargo run --locked -p e2e-test -- healthy --wait
5555
- name: Install interface
5656
run: |
5757
astartectl realm-management interfaces sync $GITHUB_WORKSPACE/e2e-test/interfaces/*.json --non-interactive
58-
astartectl realm-management interfaces sync $GITHUB_WORKSPACE/e2e-test/interfaces/additional/*.json --non-interactive
58+
astartectl realm-management interfaces sync $GITHUB_WORKSPACE/e2e-test/interfaces/**/*.json --non-interactive
5959
astartectl realm-management interfaces ls
6060
- name: Register device
6161
run: |
62-
DEVICE_ID=$(astartectl utils device-id generate-random)
63-
echo "E2E_DEVICE_ID=$DEVICE_ID" >> $GITHUB_ENV
64-
PAIRING_TOKEN=$(astartectl utils gen-jwt pairing)
65-
echo "E2E_PAIRING_TOKEN=$PAIRING_TOKEN" >> $GITHUB_ENV
66-
TOKEN=$(astartectl utils gen-jwt appengine)
67-
echo "E2E_TOKEN=$TOKEN" >> $GITHUB_ENV
62+
echo "E2E_DEVICE_ID=$(astartectl utils device-id generate-random)" >> $GITHUB_ENV
63+
echo "E2E_TOKEN=$(astartectl utils gen-jwt all-realm-apis)" >> $GITHUB_ENV
64+
echo "E2E_PAIRING_TOKEN=$(astartectl utils gen-jwt pairing)" >> $GITHUB_ENV
6865
echo "E2E_STORE_DIR=$(mktemp -d)" >> $GITHUB_ENV
6966
- name: Run test
7067
# use the full command to use the sccache
7168
run: |
72-
cargo run -p e2e-test --locked
69+
cargo run --locked -p e2e-test -- run

0 commit comments

Comments
 (0)