mirror of
https://github.com/azaion/loader.git
synced 2026-04-26 16:46:32 +00:00
Update .gitignore, remove obsolete Woodpecker build file, and add e2e-runner service to docker-compose
- Added 'e2e/results/' to .gitignore to exclude end-to-end test results. - Deleted the outdated Woodpecker build-arm.yml file as it is no longer needed. - Introduced a new e2e-runner service in docker-compose.test.yml to facilitate end-to-end testing with dependencies on other services.
This commit is contained in:
@@ -9,6 +9,7 @@ build/
|
||||
dist/
|
||||
.pytest_cache/
|
||||
e2e-results/
|
||||
e2e/results/
|
||||
test-results/
|
||||
Logs/
|
||||
*.enc
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
when:
|
||||
event: [push, pull_request, manual]
|
||||
branch: [dev, stage, main]
|
||||
|
||||
labels:
|
||||
platform: arm64
|
||||
|
||||
steps:
|
||||
- name: e2e
|
||||
image: docker:24
|
||||
environment:
|
||||
COMPOSE_PROJECT_NAME: loader-e2e
|
||||
commands:
|
||||
- cd e2e
|
||||
- mkdir -p results
|
||||
- docker compose -f docker-compose.test.yml up --build --abort-on-container-exit --exit-code-from e2e-runner
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
|
||||
- name: e2e-report
|
||||
image: docker:24
|
||||
when:
|
||||
status: [success, failure]
|
||||
environment:
|
||||
COMPOSE_PROJECT_NAME: loader-e2e
|
||||
commands:
|
||||
- cd e2e
|
||||
- docker compose -f docker-compose.test.yml down -v || true
|
||||
- test -f results/report.csv && cat results/report.csv || echo "no report"
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
@@ -2,8 +2,20 @@ when:
|
||||
event: [push, manual]
|
||||
branch: [dev, stage, main]
|
||||
|
||||
depends_on:
|
||||
- 01-test
|
||||
|
||||
# Multi-arch matrix. One workflow file, one entry per architecture. Adding
|
||||
# amd64 = appending an entry below; no second pipeline file required.
|
||||
matrix:
|
||||
include:
|
||||
- PLATFORM: arm64
|
||||
TAG_SUFFIX: arm
|
||||
# - PLATFORM: amd64
|
||||
# TAG_SUFFIX: amd
|
||||
|
||||
labels:
|
||||
platform: arm64
|
||||
platform: ${PLATFORM}
|
||||
|
||||
steps:
|
||||
- name: build-push
|
||||
@@ -17,7 +29,7 @@ steps:
|
||||
from_secret: registry_token
|
||||
commands:
|
||||
- echo "$REGISTRY_TOKEN" | docker login "$REGISTRY_HOST" -u "$REGISTRY_USER" --password-stdin
|
||||
- export TAG=${CI_COMMIT_BRANCH}-arm
|
||||
- export TAG=${CI_COMMIT_BRANCH}-${TAG_SUFFIX}
|
||||
- export BUILD_DATE=$(date -u +%Y-%m-%dT%H:%M:%SZ)
|
||||
- |
|
||||
docker build -f Dockerfile \
|
||||
@@ -30,10 +42,11 @@ steps:
|
||||
- docker save $REGISTRY_HOST/azaion/loader:$TAG -o loader-image.tar
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
|
||||
- name: publish-artifact
|
||||
image: python:3.11-slim
|
||||
commands:
|
||||
- pip install --no-cache-dir boto3==1.40.9 cryptography==44.0.2 requests==2.32.4
|
||||
- export PUBLISH_DEV_STAGE=$CI_COMMIT_BRANCH
|
||||
- export TAG=${CI_COMMIT_BRANCH}-arm
|
||||
- python scripts/publish_artifact.py --file loader-image.tar --resource-name loader --dev-stage "$PUBLISH_DEV_STAGE" --architecture arm64 --version "$CI_COMMIT_SHA"
|
||||
- export TAG=${CI_COMMIT_BRANCH}-${TAG_SUFFIX}
|
||||
- python scripts/publish_artifact.py --file loader-image.tar --resource-name loader --dev-stage "$PUBLISH_DEV_STAGE" --architecture ${PLATFORM} --version "$CI_COMMIT_SHA"
|
||||
@@ -0,0 +1,16 @@
|
||||
FROM docker:24
|
||||
|
||||
RUN apk add --no-cache python3 py3-pip bash
|
||||
|
||||
WORKDIR /e2e
|
||||
|
||||
COPY requirements.txt ./
|
||||
RUN python3 -m venv /opt/venv \
|
||||
&& /opt/venv/bin/pip install --no-cache-dir --upgrade pip \
|
||||
&& /opt/venv/bin/pip install --no-cache-dir -r requirements.txt pytest-csv
|
||||
|
||||
ENV PATH=/opt/venv/bin:$PATH
|
||||
|
||||
COPY . /e2e
|
||||
|
||||
CMD ["pytest", "--csv=/results/report.csv", "-v"]
|
||||
@@ -54,6 +54,27 @@ services:
|
||||
networks:
|
||||
- e2e-net
|
||||
|
||||
e2e-runner:
|
||||
build: .
|
||||
depends_on:
|
||||
swtpm:
|
||||
condition: service_started
|
||||
mock-api:
|
||||
condition: service_started
|
||||
mock-cdn:
|
||||
condition: service_started
|
||||
system-under-test:
|
||||
condition: service_started
|
||||
environment:
|
||||
LOADER_URL: http://system-under-test:8080
|
||||
MINIO_URL: http://mock-cdn:9000
|
||||
COMPOSE_PROJECT_NAME: ${COMPOSE_PROJECT_NAME:-loader-e2e}
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- ./results:/results
|
||||
networks:
|
||||
- e2e-net
|
||||
|
||||
networks:
|
||||
e2e-net:
|
||||
driver: bridge
|
||||
|
||||
Reference in New Issue
Block a user