Skip to content

Commit

Permalink
add option to run and system test with local code
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkTNO committed Jun 27, 2024
1 parent 6cb5024 commit 65bed53
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docker-compose.override.dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
services:

orchestrator:
image: omotes-orchestrator-dev
build:
context: ..
dockerfile: orchestrator/dev.Dockerfile
6 changes: 6 additions & 0 deletions scripts/start-dev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

. scripts/_select_docker_compose.sh

$DOCKER_COMPOSE --profile=manual_dev down orchestrator_postgres_db_dev
$DOCKER_COMPOSE --profile=manual_dev -f docker-compose.yml -f docker-compose.override.dev.yml up --build --wait
16 changes: 16 additions & 0 deletions scripts/test_system_dev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
. scripts/_select_docker_compose.sh

export COMPOSE_PROJECT_NAME=omotes_system_tests

ENV_FILE=".env.test"
DOCKER_COMPOSE_FILE="./docker-compose.yml -f system_tests/docker-compose.override.yml -f system_tests/docker-compose.override.dev.yml"

cp .env-template ${ENV_FILE}
sed -i 's/LOG_LEVEL=[a-z]*/LOG_LEVEL=WARNING/gi' ${ENV_FILE}

$DOCKER_COMPOSE --env-file ${ENV_FILE} -f $DOCKER_COMPOSE_FILE down -v
./scripts/setup_orchestrator_postgres_db.sh $ENV_FILE $DOCKER_COMPOSE_FILE
./scripts/setup_rabbitmq.sh $ENV_FILE $DOCKER_COMPOSE_FILE
./scripts/setup_influxdb.sh $ENV_FILE $DOCKER_COMPOSE_FILE
$DOCKER_COMPOSE --env-file ${ENV_FILE} -f $DOCKER_COMPOSE_FILE up --build --abort-on-container-exit
15 changes: 15 additions & 0 deletions system_tests/dev.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM python:3.11-slim

WORKDIR /app

COPY computation-engine/system_tests/requirements.txt /app/requirements.txt
RUN pip install -r /app/requirements.txt --no-cache-dir

COPY ../omotes-sdk-protocol/python/ /omotes-sdk-protocol/python/
COPY ../omotes-sdk-python/ /omotes-sdk-python/
RUN pip install -e /omotes-sdk-python/
RUN pip install -e /omotes-sdk-protocol/python/

COPY computation-engine/system_tests/src/ /app/

CMD ["pytest", "--timeout", "120"]
5 changes: 5 additions & 0 deletions system_tests/docker-compose.override.dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
services:
system_tests:
build:
context: ..
dockerfile: computation-engine/system_tests/dev.Dockerfile # This is referenced from root of repo due to how docker-compose works.

0 comments on commit 65bed53

Please sign in to comment.