Skip to content

Commit

Permalink
Quality of life improvements from workshop delivery (#24)
Browse files Browse the repository at this point in the history
* allow for detached mode and building images from Makefile

* upgrade rabbit to in service version

* by default include 'applicationExporter' in tracetest config

* remove need for amd image for running tracetest docker compose

* fix: default is featured flag
  • Loading branch information
abangser authored Oct 3, 2023
1 parent ee0a323 commit 16eeaa5
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
11 changes: 9 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,26 @@ SRCDIR = docs/diagrams
OUTPUT_FORMAT = png
SRC = $(wildcard $(SRCDIR)/*.mdd)
OUT = ${SRC:.mdd=.$(OUTPUT_FORMAT)}
DETACHED ?= false
BUILD ?= false
FLAGS = ""

help: Makefile ## show list of commands
@echo "Choose a command run:"
@echo ""
@awk 'BEGIN {FS = ":.*?## "} /[a-zA-Z_-]+:.*?## / {sub("\\\\n",sprintf("\n%22c"," "), $$2);printf "\033[36m%-40s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) | sort

generate-flags:
if ${DETACHED}; then FLAGS += " --detach"; fi
if ${BUILD}; then FLAGS += " --build"; fi

generate-diagrams: $(OUT)

$(SRCDIR)/%.$(OUTPUT_FORMAT): $(SRCDIR)/%.mdd
npm run generate-diagram -- --input $< --output $@

run/pokeshop: ## run Pokeshop API on docker compose
docker compose -f docker-compose.yml -f ./docker-compose.stream.yml up
docker compose -f docker-compose.yml -f ./docker-compose.stream.yml up ${FLAGS}

down/pokeshop: ## stop Pokeshop API running on docker compose
docker compose -f docker-compose.yml -f ./docker-compose.stream.yml down
Expand All @@ -23,7 +30,7 @@ run/tracetests: ## run Trace-based tests on Pokeshop API with Tracetest
docker compose -f docker-compose.yml -f ./docker-compose.stream.yml -f ./tracetest/docker-compose.yml run tracebased-tests

run: ## run Pokeshop API on Docker Compose and run Trace-based tests with Tracetest
docker compose -f docker-compose.yml -f ./docker-compose.stream.yml -f ./tracetest/docker-compose.yml up
docker compose -f docker-compose.yml -f ./docker-compose.stream.yml -f ./tracetest/docker-compose.yml up ${FLAGS}

down: ## stop Pokeshop API on Docker Compose and run Trace-based tests with Tracetest
docker compose -f docker-compose.yml -f ./docker-compose.stream.yml -f ./tracetest/docker-compose.yml down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ services:
retries: 60

queue:
image: rabbitmq:3.9
image: rabbitmq:3.12
restart: unless-stopped
ports:
- 5672:5672
Expand Down Expand Up @@ -122,4 +122,4 @@ services:
jaeger:
condition: service_healthy
otel-collector:
condition: service_started
condition: service_started
1 change: 1 addition & 0 deletions tracetest/config/tracetest-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ telemetry:
server:
telemetry:
exporter: collector
applicationExporter: collector
4 changes: 1 addition & 3 deletions tracetest/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ version: '3'
services:
tracebased-tests:
image: kubeshop/tracetest:${TAG:-latest}
platform: linux/amd64
volumes:
- type: bind
source: ./tracetest/tests
Expand All @@ -26,7 +25,6 @@ services:

tracetest-server:
image: kubeshop/tracetest:${TAG:-latest}
platform: linux/amd64
volumes:
- type: bind
source: ./tracetest/config/tracetest-config.yaml
Expand Down Expand Up @@ -67,4 +65,4 @@ services:
test: pg_isready -U "$$POSTGRES_USER" -d "$$POSTGRES_DB"
interval: 1s
timeout: 5s
retries: 60
retries: 60
2 changes: 1 addition & 1 deletion web/src/gateways/pokemon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const PokemonGateway = () => ({

return pokemonList;
},
async create({ imageUrl, name, type, isFeatured }: TCreatePokemon) {
async create({ imageUrl, name, type, isFeatured = false }: TCreatePokemon) {
const pokemon = await request<TPokemon>({
url: `${BASE_API}`,
method: 'POST',
Expand Down

0 comments on commit 16eeaa5

Please sign in to comment.