Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
**/.concrete/DEV_MODE
**/erl_crash.dump

# Standard Rust gitignore to be applied to all apps
**/target/

# rebar 2.x
**/.rebar
**/rel/example_project
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/astarte-e2e-next-test-build-workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Astarte end-to-end test build

on:
workflow_call:

jobs:
end-to-end-build:
name: End-to-end build
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
- uses: docker/setup-buildx-action@v3
- name: Build branch slug env variable (job-scoped)
run: |
# Slugify branch/tag name for Docker tag safety and consistency
echo "BRANCH_SLUG=$(echo "${GITHUB_REF_NAME}" | sha1sum | cut -f 1 -d ' ')" >> $GITHUB_ENV
- name: Build Astarte E2E
uses: docker/build-push-action@v6
with:
context: tools/astarte-e2e-next
target: tester
tags: astarte-e2e-next-test
outputs: type=docker,dest=${{ runner.temp }}/astarte-e2e-next-test.tar
cache-from: type=gha,scope=astarte-e2e-next-test-${{ env.BRANCH_SLUG }}
cache-to: type=gha,mode=max,scope=astarte-e2e-next-test-${{ env.BRANCH_SLUG }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: astarte-e2e-next-test-image
path: ${{ runner.temp }}/astarte-e2e-next-test.tar
80 changes: 80 additions & 0 deletions .github/workflows/astarte-end-to-end-test-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ env:
jobs:
e2e-build:
uses: ./.github/workflows/astarte-e2e-build-workflow.yaml
e2e-next-test-build:
uses: ./.github/workflows/astarte-e2e-next-test-build-workflow.yaml
astarte-build:
uses: ./.github/workflows/astarte-build-workflow.yaml

Expand Down Expand Up @@ -100,3 +102,81 @@ jobs:
run: docker compose logs
- name: Bring down Astarte docker-compose
run: docker compose down

end-to-end-next-test:
needs: [e2e-next-test-build, astarte-build]
name: End-to-end Next Test
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: Initialize docker compose files
run: docker run -v $(pwd)/compose:/compose astarte/docker-compose-initializer
- name: Restore astarte images
uses: actions/download-artifact@v4
with:
# Download all app images; merge them into the same directory for loading
pattern: astarte-images-*
merge-multiple: true
path: ${{ runner.temp }}
- name: Restore astarte e2e image
uses: actions/download-artifact@v4
with:
name: astarte-e2e-next-test-image
path: ${{ runner.temp }}
- name: Load astarte images
run: ls ${{ runner.temp }}/*.tar | xargs --max-args 1 docker load --input
- name: Start all Astarte services
run: docker compose up --no-build --pull missing -d
- name: Install astartectl
run: |
wget https://github.com/astarte-platform/astartectl/releases/download/v22.11.02/astartectl_22.11.02_linux_x86_64.tar.gz
tar xf astartectl_22.11.02_linux_x86_64.tar.gz
chmod +x astartectl
- name: Generate realm keypair and JWT
run: |
./astartectl utils gen-keypair test
E2E_HOUSEKEEPING_API_JWT=$(./astartectl utils gen-jwt housekeeping -k compose/astarte-keys/housekeeping_private.pem)
echo "E2E_HOUSEKEEPING_API_JWT=$E2E_HOUSEKEEPING_API_JWT" >> $GITHUB_ENV
- name: Generate JWT
run: |
JWT=$(./astartectl utils gen-jwt appengine channels pairing realm-management -k test_private.pem)
echo "E2E_JWT=$JWT" >> $GITHUB_ENV
- name: Wait for Astarte to come up
run: |
wget https://github.com/astarte-platform/wait-for-astarte-docker-compose/releases/download/v1.1.0/wait-for-astarte-docker-compose_1.1.0_linux_amd64.tar.gz
tar xf wait-for-astarte-docker-compose_1.1.0_linux_amd64.tar.gz
./wait-for-astarte-docker-compose
- name: Create realm
run: |
./astartectl utils gen-keypair test
./astartectl housekeeping realms create test --astarte-url http://api.astarte.localhost --realm-public-key test_public.pem -k compose/astarte-keys/housekeeping_private.pem -y
echo "E2E_REALM=test" >> $GITHUB_ENV
sleep 5
- name: Install e2e test interfaces
run: |
./astartectl realm-management interfaces sync --astarte-url http://api.astarte.localhost -k test_private.pem -r $E2E_REALM -y tools/astarte-e2e-next/astarte-e2e/interfaces/**.json
- name: Register device
run: |
DEVICE_ID=$(./astartectl utils device-id generate-random)
echo "E2E_DEVICE_ID=$DEVICE_ID" >> $GITHUB_ENV
CREDENTIALS_SECRET=$(./astartectl pairing agent register $DEVICE_ID --astarte-url http://api.astarte.localhost -k test_private.pem -r $E2E_REALM | grep "Credentials Secret is" | cut -d '"' -f 2)
echo "E2E_CREDENTIALS_SECRET=$CREDENTIALS_SECRET" >> $GITHUB_ENV
- name: Run Astarte E2E
env:
E2E_HOST: "astarte-e2e"
E2E_PAIRING_URL: http://api.astarte.localhost/pairing/
E2E_APPENGINE_URL: http://api.astarte.localhost/appengine/
E2E_IGNORE_SSL_ERRORS: true
E2E_CHECK_INTERVAL_SECONDS: 5
E2E_CHECK_REPETITIONS: 5
run: |
docker run \
--env-file=<(env | grep '^E2E_') \
--network astarte \
--hostname "$E2E_HOST" \
astarte-e2e-next-test
- name: Check Docker
if: ${{ failure() }}
run: docker compose logs
- name: Bring down Astarte docker-compose
run: docker compose down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ apps/*/config/*.secret.exs
*.plt
apps/*/.concrete/DEV_MODE

# Standard Rust gitignore to be applied to all apps
target

# rebar 2.x
.rebar
apps/*/rel/example_project
Expand Down
4 changes: 4 additions & 0 deletions apps/astarte_appengine_api/lib/astarte_appengine_api.ex
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,8 @@ defmodule Astarte.AppEngine.API do
Contexts are also responsible for managing your data, regardless
if it comes from the database, an external API or others.
"""

def cacca do
a =
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ defmodule Astarte.AppEngine.API.Application do
Astarte.AppEngine.APIWeb.Endpoint
]

a = Con

# See https://hexdocs.pm/elixir/Supervisor.html
# for other strategies and supported options
opts = [strategy: :one_for_one, name: Astarte.AppEngine.API.Supervisor]
Expand Down
Loading
Loading