Skip to content

Commit

Permalink
LITE-31232 docker compose is now used instead of docker-compose
Browse files Browse the repository at this point in the history
  • Loading branch information
maxipavlovic committed Oct 21, 2024
1 parent 901aac3 commit 9610845
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 35 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,8 @@ Unit testing

Run tests with various RDBMS:
- `cd integration_tests`
- `DB=postgres docker-compose -f docker-compose.yml -f rdbms.yml run app_test`
- `DB=mysql docker-compose -f docker-compose.yml -f rdbms.yml run app_test`
- `DB=postgres docker compose -f docker-compose.yml -f rdbms.yml run app_test`
- `DB=mysql docker compose -f docker-compose.yml -f rdbms.yml run app_test`

Check code style: `flake8`
Run tests: `pytest`
Expand All @@ -244,6 +244,6 @@ To generate HTML coverage reports use:

Integrational testing
------
1. docker-compose
1. docker compose
2. `cd integration_tests`
3. `docker-compose run master`
3. `docker compose run master`
12 changes: 6 additions & 6 deletions examples/demo_project/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ It's a simple demo project contains 2 services:
## Start project:

```
docker-compose up -d db_pgsql db_mysql
docker-compose run master ./manage.py migrate
docker-compose run replica ./manage.py migrate
docker-compose up -d
docker-compose run master ./manage.py cqrs_sync --cqrs-id=user -f={}
docker-compose run master ./manage.py cqrs_sync --cqrs-id=product -f={}
docker compose up -d db_pgsql db_mysql
docker compose run master ./manage.py migrate
docker compose run replica ./manage.py migrate
docker compose up -d
docker compose run master ./manage.py cqrs_sync --cqrs-id=user -f={}
docker compose run master ./manage.py cqrs_sync --cqrs-id=product -f={}
```

It starts master WEB app on [http://127.0.0.1:8000](http://127.0.0.1:8000) and replica on [http://127.0.0.1:8001](http://127.0.0.1:8001)
Expand Down
22 changes: 11 additions & 11 deletions integration_tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,40 @@
.DEFAULT_GOAL := pika

build:
docker-compose build
docker compose build

build_master_v1:
docker-compose -f docker-compose.yml -f masterV1.yml build
docker compose -f docker-compose.yml -f masterV1.yml build

build_replica_v1:
docker-compose -f docker-compose.yml -f replicaV1.yml build
docker compose -f docker-compose.yml -f replicaV1.yml build

pika: build
@echo "Run PIKA integration tests..."
docker-compose run master
docker compose run master
@echo "Stopping running containers..."
docker-compose down --remove-orphans
docker compose down --remove-orphans
@echo "Done!"

kombu: build
@echo "Run KOMBU integration tests..."
docker-compose -f docker-compose.yml -f kombu.yml run master
docker compose -f docker-compose.yml -f kombu.yml run master
@echo "Stopping running containers..."
docker-compose -f docker-compose.yml -f kombu.yml down --remove-orphans
docker compose -f docker-compose.yml -f kombu.yml down --remove-orphans
@echo "Done!"

master_v1: build_master_v1
@echo "Run regression tests Master v1.3.1..."
docker-compose -f docker-compose.yml -f masterV1.yml run master
docker compose -f docker-compose.yml -f masterV1.yml run master
@echo "Stopping running containers..."
docker-compose -f docker-compose.yml -f masterV1.yml down --remove-orphans
docker compose -f docker-compose.yml -f masterV1.yml down --remove-orphans
@echo "Done!"

replica_v1: build_replica_v1
@echo "Run regression tests Replica v1.3.1..."
docker-compose -f docker-compose.yml -f replicaV1.yml run master
docker compose -f docker-compose.yml -f replicaV1.yml run master
@echo "Stopping running containers..."
docker-compose -f docker-compose.yml -f replicaV1.yml down --remove-orphans
docker compose -f docker-compose.yml -f replicaV1.yml down --remove-orphans
@echo "Done!"

all: pika kombu master_v1 replica_v1
12 changes: 6 additions & 6 deletions travis_compat_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ if [ "$COMPAT_TESTS" == "yes" ]; then
echo "Running backward compatibility tests....."
cd integration_tests
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
docker-compose -f docker-compose.yml -f masterV1.yml build
docker-compose -f docker-compose.yml -f masterV1.yml run master
docker-compose -f docker-compose.yml -f masterV1.yml down --remove-orphans
docker compose -f docker-compose.yml -f masterV1.yml build
docker compose -f docker-compose.yml -f masterV1.yml run master
docker compose -f docker-compose.yml -f masterV1.yml down --remove-orphans

docker-compose -f docker-compose.yml -f replicaV1.yml build
docker-compose -f docker-compose.yml -f replicaV1.yml run master
docker-compose -f docker-compose.yml -f replicaV1.yml down --remove-orphans
docker compose -f docker-compose.yml -f replicaV1.yml build
docker compose -f docker-compose.yml -f replicaV1.yml run master
docker compose -f docker-compose.yml -f replicaV1.yml down --remove-orphans
cd ..
echo "Done!"
else
Expand Down
16 changes: 8 additions & 8 deletions travis_integration_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ if [ "$INTEGRATION_TESTS" == "yes" ]; then
echo "Running integration tests....."
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
cd integration_tests
docker-compose build
docker-compose run master
docker-compose down --remove-orphans
docker-compose -f docker-compose.yml -f kombu.yml run master
docker-compose -f docker-compose.yml -f kombu.yml down --remove-orphans
DB=postgres docker-compose -f docker-compose.yml -f rdbms.yml run app_test
DB=mysql docker-compose -f docker-compose.yml -f rdbms.yml run app_test
docker-compose -f docker-compose.yml -f rdbms.yml down --remove-orphans
docker compose build
docker compose run master
docker compose down --remove-orphans
docker compose -f docker-compose.yml -f kombu.yml run master
docker compose -f docker-compose.yml -f kombu.yml down --remove-orphans
DB=postgres docker compose -f docker-compose.yml -f rdbms.yml run app_test
DB=mysql docker compose -f docker-compose.yml -f rdbms.yml run app_test
docker compose -f docker-compose.yml -f rdbms.yml down --remove-orphans

cd ..
echo "Done!"
Expand Down

0 comments on commit 9610845

Please sign in to comment.