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
20 changes: 1 addition & 19 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,7 @@ jobs:
with:
go-version-file: 'lib/go.mod'
- name: Test quickly without Docker
run: |
echo "Testing lib module..."
cd lib && go test -v ./...
echo "Testing reservations module..."
cd ../reservations && go test -v ./...
echo "Testing machines module..."
cd ../machines && go test -v ./...
echo "Testing decisions module..."
cd ../decisions && go test -v ./...
echo "Testing scheduler module..."
cd ../scheduler && go test -v ./...
echo "Testing descheduler module..."
cd ../descheduler && go test -v ./...
echo "Testing extractor module..."
cd ../extractor && go test -v ./...
echo "Testing kpis module..."
cd ../kpis && go test -v ./...
echo "Testing sync module..."
cd ../sync && go test -v ./...
run: make test-fast

test-with-docker:
# We don't need to run this longer test if the previous one already failed.
Expand Down
25 changes: 25 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Declare test targets as phony targets (not file names)
.PHONY: test test-fast test-full

# Default test command - runs without Docker (fast)
test: test-fast

# Run tests without Docker/PostgreSQL container (faster, but some tests may be skipped)
test-fast:
@echo "Running tests without PostgreSQL container..."
@for dir in */; do \
if [ -f "$$dir/go.mod" ]; then \
echo "Testing in $$dir..."; \
cd "$$dir" && POSTGRES_CONTAINER=0 go test ./... && cd ..; \
fi; \
done

# Run tests with Docker/PostgreSQL container (slower, but runs all tests)
test-full:
@echo "Running tests with PostgreSQL container..."
@for dir in */; do \
if [ -f "$$dir/go.mod" ]; then \
echo "Testing in $$dir..."; \
cd "$$dir" && POSTGRES_CONTAINER=1 go test ./... && cd ..; \
fi; \
done
Loading