mirror of
https://github.com/luxfi/mpc.git
synced 2026-09-24 00:26:24 +00:00
51 lines
1.3 KiB
Makefile
51 lines
1.3 KiB
Makefile
.PHONY: test setup clean deps
|
|
|
|
# Default target
|
|
test: deps setup
|
|
@echo "Running E2E tests..."
|
|
go test -v -timeout=10m ./...
|
|
|
|
# Setup test environment
|
|
setup:
|
|
@echo "๐ง Setting up test environment..."
|
|
@if ! command -v mpc >/dev/null 2>&1; then \
|
|
echo "โ mpc binary not found in PATH. Please run 'make' in the root directory first."; \
|
|
exit 1; \
|
|
fi
|
|
@if ! command -v mpc-cli >/dev/null 2>&1; then \
|
|
echo "โ mpc-cli binary not found in PATH. Please run 'make' in the root directory first."; \
|
|
exit 1; \
|
|
fi
|
|
@echo "โ
Binaries found"
|
|
|
|
# Install dependencies
|
|
deps:
|
|
@echo "๐ฆ Installing dependencies..."
|
|
go mod tidy
|
|
go mod download
|
|
|
|
# Clean up test artifacts
|
|
clean:
|
|
@echo "๐งน Cleaning up test artifacts..."
|
|
rm -rf test_db/
|
|
rm -rf test_node*/
|
|
rm -f test_event_initiator.*
|
|
rm -rf logs
|
|
rm -f config.test.yaml
|
|
docker compose -f docker-compose.test.yaml down --remove-orphans 2>/dev/null || true
|
|
|
|
# Quick test (skip setup)
|
|
test-quick:
|
|
@echo "โก Running quick E2E tests..."
|
|
go test -v -timeout=10m ./...
|
|
|
|
# Help
|
|
help:
|
|
@echo "Available targets:"
|
|
@echo " test - Run E2E tests with full setup"
|
|
@echo " test-quick - Run E2E tests without setup"
|
|
@echo " setup - Setup test environment"
|
|
@echo " deps - Install dependencies"
|
|
@echo " clean - Clean up test artifacts"
|
|
@echo " help - Show this help message"
|