Skip to content
Merged
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
31 changes: 31 additions & 0 deletions .github/workflows/anms-core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,34 @@ jobs:
run: |
FAIL_SRC=0
flake8 src || FAIL_SRC=$?
anms-core_integration-test:
runs-on: ubuntu-24.04
env:
ANMS_COMPOSE_OPTS: -f docker-compose.yml --profile light
TEST_COMPOSE_OPTS: -f anms-core/integration_test/docker-compose.yml
HOST_SOCKDIR: sockdir
CTR_SOCKDIR: /var/tmp/nm
DOCKER_CMD: docker
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Build ANMS
run: docker compose ${ANMS_COMPOSE_OPTS} build
- name: Build TEST
run: docker compose ${TEST_COMPOSE_OPTS} build
- name: Build Volume
run: |
./create_volume.sh ./puppet/modules/apl_test/files/anms/tls
sudo mkdir /run/anms
- name: run
run: |
docker compose ${ANMS_COMPOSE_OPTS} up -d --force-recreate --wait --wait-timeout 600
docker compose ${TEST_COMPOSE_OPTS} run test-fixture
- name: after_script
run: |
if [ "${CI_JOB_STATUS}" = 'failed' ]; then
docker logs anms-core
fi

43 changes: 0 additions & 43 deletions anms-core/integration_test/Dockerfile

This file was deleted.

56 changes: 11 additions & 45 deletions anms-core/integration_test/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,56 +21,22 @@
##

# Combine containers for anms-core and its test fixture
version: '3.9'
name: anms-integration-test

networks:
default:
name: ${DOCKER_CTR_PREFIX}anms
driver_opts:
com.docker.network.bridge.name: br-${DOCKER_CTR_PREFIX}anms
com.docker.network.driver.mtu: 65535
anms:
external: true


services:
# External dependencies first
postgres:
hostname: postgres
image: ${DOCKER_IMAGE_PREFIX}amp-sql:${DOCKER_IMAGE_TAG}
environment:
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: ${DB_NAME}
mqtt-broker:
hostname: mqtt-broker
image: ${DOCKER_IMAGE_PREFIX}mqtt-broker:${DOCKER_IMAGE_TAG}
transcoder:
hostname: transcoder
image: ${DOCKER_IMAGE_PREFIX}transcoder:${DOCKER_IMAGE_TAG}
depends_on:
mqtt-broker:
condition: service_healthy

# anms-core built from *this* working copy (not prebuilt image)
anms-core:
hostname: anms-core
build:
context: ..
volumes:
- /var/run/docker.sock:/var/run/docker.sock
depends_on:
postgres:
condition: service_healthy
mqtt-broker:
condition: service_healthy
environment:
DB_HOST: postgres
DB_USER: ${DB_USER}
DB_PASSWORD: ${DB_PASSWORD}
DB_NAME: ${DB_NAME}

test-fixture:
hostname: test-fixture
build:
context: .
depends_on:
anms-core:
condition: service_healthy
context: ../..
dockerfile: anms.Containerfile
target: anms-core-integration
networks:
- anms
depends_on: {}

10 changes: 10 additions & 0 deletions anms.Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,16 @@ EXPOSE 5555/tcp
HEALTHCHECK --start-period=10s --interval=60s --timeout=10s --retries=20 \
CMD ["curl", "-sq", "-o/dev/null", "http://localhost:5555/hello"]

# for anms-core integration test
FROM yarn-base AS anms-core-integration

# Install node+yarn from upstream
RUN npm install --ignore-scripts -g newman

COPY anms-core/integration_test /root/
WORKDIR /root
CMD ["./run_test.sh"]


# Build on more permissive CentOS image
# Run on RHEL UBI image
Expand Down