Skip to content

Commit

Permalink
Merge pull request #284 from Clariteia/0.0.3
Browse files Browse the repository at this point in the history
0.0.3
  • Loading branch information
Sergio García Prado authored Sep 21, 2021
2 parents f6b383c + 1198e57 commit ddb798e
Show file tree
Hide file tree
Showing 229 changed files with 61,749 additions and 1,931 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
name: Integration Tests

on: push

jobs:
Expand All @@ -14,4 +16,12 @@ jobs:
run: make integration-tests

- name: Stop System
run: make down
run: make export-logs down
if: always()

- name: Archive Artifacts
uses: actions/upload-artifact@v2
with:
name: system-logs
path: logs.txt
if: always()
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
on:
push:
paths:
- 'microservices/user/**'
name: Unit Tests - Authentication

on: push

jobs:
build:
Expand All @@ -11,7 +10,7 @@ jobs:
postgres:
image: postgres
env:
POSTGRES_DB: user_db
POSTGRES_DB: auth_db
POSTGRES_USER: minos
POSTGRES_PASSWORD: min0s
ports:
Expand All @@ -32,7 +31,7 @@ jobs:
KAFKA_ADVERTISED_HOST_NAME: kafka
defaults:
run:
working-directory: ./microservices/user
working-directory: ./microservices/authentication

env:
MINOS_REPOSITORY_HOST: postgres
Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/microservice-cart-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Unit Tests - Cart

on: push

jobs:
build:
runs-on: ubuntu-latest
container: python:3.9-buster
services:
postgres:
image: postgres
env:
POSTGRES_DB: cart_db
POSTGRES_USER: minos
POSTGRES_PASSWORD: min0s
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

zookeeper:
image: wurstmeister/zookeeper:latest
ports:
- 2181:2181

kafka:
image: wurstmeister/kafka:latest
ports:
- 9092:9092
env:
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_HOST_NAME: kafka
defaults:
run:
working-directory: ./microservices/cart

env:
MINOS_REPOSITORY_HOST: postgres
MINOS_SNAPSHOT_HOST: postgres
MINOS_BROKER_QUEUE_HOST: postgres
MINOS_BROKER_HOST: kafka

steps:
- name: Check out repository code
uses: actions/checkout@v2

- name: Install Poetry
uses: snok/[email protected]

- name: Install dependencies
run: poetry install

- name: Run tests
run: poetry run pytest
53 changes: 53 additions & 0 deletions .github/workflows/microservice-customer-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Unit Tests - Customer

on: push

jobs:
build:
runs-on: ubuntu-latest
container: python:3.9-buster
services:
postgres:
image: postgres
env:
POSTGRES_DB: customer_db
POSTGRES_USER: minos
POSTGRES_PASSWORD: min0s
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

zookeeper:
image: wurstmeister/zookeeper:latest
ports:
- 2181:2181

kafka:
image: wurstmeister/kafka:latest
ports:
- 9092:9092
env:
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_HOST_NAME: kafka
defaults:
run:
working-directory: ./microservices/customer

env:
MINOS_REPOSITORY_HOST: postgres
MINOS_SNAPSHOT_HOST: postgres
MINOS_BROKER_QUEUE_HOST: postgres
MINOS_BROKER_HOST: kafka

steps:
- name: Check out repository code
uses: actions/checkout@v2

- name: Install Poetry
uses: snok/[email protected]

- name: Install dependencies
run: poetry install

- name: Run tests
run: poetry run pytest
7 changes: 3 additions & 4 deletions .github/workflows/microservice-order-tests.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
on:
push:
paths:
- 'microservices/order/**'
name: Unit Tests - Order

on: push

jobs:
build:
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/microservice-payment-tests.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
on:
push:
paths:
- 'microservices/payment/**'
name: Unit Tests - Payment

on: push

jobs:
build:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/microservice-product-tests.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
on:
push:
paths:
- 'microservices/product/**'
name: Unit Tests - Product

on: push

jobs:
build:
Expand Down Expand Up @@ -44,6 +43,7 @@ jobs:
MINOS_SAGA_QUEUE_HOST: postgres

steps:

- name: Check out repository code
uses: actions/checkout@v2

Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/microservice-review-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Unit Tests - Review

on: push

jobs:
build:
runs-on: ubuntu-latest
container: python:3.9-buster
services:
postgres:
image: postgres
env:
POSTGRES_DB: review_db
POSTGRES_USER: minos
POSTGRES_PASSWORD: min0s
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

zookeeper:
image: wurstmeister/zookeeper:latest
ports:
- 2181:2181

kafka:
image: wurstmeister/kafka:latest
ports:
- 9092:9092
env:
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_HOST_NAME: kafka
defaults:
run:
working-directory: ./microservices/review

env:
MINOS_REPOSITORY_HOST: postgres
MINOS_SNAPSHOT_HOST: postgres
MINOS_BROKER_QUEUE_HOST: postgres
MINOS_BROKER_HOST: kafka

steps:
- name: Check out repository code
uses: actions/checkout@v2

- name: Install Poetry
uses: snok/[email protected]

- name: Install dependencies
run: poetry install

- name: Run tests
run: poetry run pytest
8 changes: 4 additions & 4 deletions .github/workflows/microservice-ticket-tests.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
on:
push:
paths:
- 'microservices/ticket/**'
name: Unit Tests - Ticket

on: push

jobs:
build:
Expand Down Expand Up @@ -41,6 +40,7 @@ jobs:
MINOS_BROKER_HOST: kafka

steps:

- name: Check out repository code
uses: actions/checkout@v2

Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
build:
docker-compose build --parallel
docker-compose build --progres plain

up: build
echo "Starting containers..."
Expand All @@ -13,6 +13,10 @@ logs:
echo "Showing logs..."
docker-compose logs --follow

export-logs:
echo "Showing logs..."
docker-compose logs --no-color > logs.txt

integration-tests:
echo "Running Integration Tests..."
docker-compose run tavern
73 changes: 4 additions & 69 deletions api_gateway/config.yml
Original file line number Diff line number Diff line change
@@ -1,80 +1,15 @@
rest:
host: 0.0.0.0
port: 5566
endpoints:

- name: AddOrder
route: /orders
method: POST
controller: minos.api_gateway.rest.DefaultController
action: default

- name: GetOrders
route: /orders
method: GET
controller: minos.api_gateway.rest.DefaultController
action: default

- name: AddPayment
route: /payments
method: POST
controller: minos.api_gateway.rest.DefaultController
action: default

- name: GetPayments
route: /payments
method: GET
controller: minos.api_gateway.rest.DefaultController
action: default

- name: AddProduct
route: /products
method: POST
controller: minos.api_gateway.rest.DefaultController
action: default

- name: GetProducts
route: /products
method: GET
controller: minos.api_gateway.rest.DefaultController
action: default

- name: DeleteProduct
route: /products/{id}
method: DELETE
controller: minos.api_gateway.rest.DefaultController
action: default

- name: UpdateInventory
route: /products/{uuid}/inventory
method: PUT
controller: minos.api_gateway.rest.DefaultController
action: default

- name: UpdateInventoryDiff
route: /products/{uuid}/inventory
method: PATCH
controller: minos.api_gateway.rest.DefaultController
action: default

- name: GetTickets
route: /tickets
method: GET
controller: minos.api_gateway.rest.DefaultController
action: default

- name: CreateUser
route: /users
method: POST
controller: minos.api_gateway.rest.DefaultController
action: default

endpoints: []
discovery:
host: localhost
port: 5567
path: /discover
path: ""
endpoints: []
db:
host: localhost
port: 6379
password:
cors:
enabled: true
Loading

0 comments on commit ddb798e

Please sign in to comment.