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
33 changes: 27 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,12 @@ jobs:

- name: Setup Go and system deps
uses: ./.github/actions/setup-env


- name: Install dependencies
run: go mod download

- name: Run integration tests
run: go test -v -p 1 -count=1 -tags=integration ./...
run: go test -v ./tests/integration/...

system-tests:
name: system-tests
Expand All @@ -51,13 +54,31 @@ jobs:
uses: ./.github/actions/setup-env

- name: Install dependencies
run: cd tests/system && go mod download
run: |
go mod download
cd tests/system && go mod download

- name: Install lumera
run: cd tests/scripts && ./install-lumera.sh
- name: Install Lumera
run: |
cd tests/scripts
chmod +x ./install-lumera.sh
sudo ./install-lumera.sh

- name: Setup Supernode environments
run: |
cd tests/scripts
chmod +x ./setup-supernodes.sh
./setup-supernodes.sh all \
../../supernode/main.go \
../system/supernode-data \
../system/config.test-1.yml \
../system/supernode-data2 \
../system/config.test-2.yml \
../system/supernode-data3 \
../system/config.test-3.yml

- name: Copy CSV file to home directory
run: cp claims.csv ~/

- name: Run system tests
run: cd tests/system && go test -tags=system_test -v .
run: cd tests/system && go test -v .
43 changes: 23 additions & 20 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: test-unit test-integration test-system tests-system-setup
.PHONY: test-unit test-integration test-system install-lumera setup-supernodes system-test-setup

# Run unit tests (regular tests with code)
test-unit:
Expand Down Expand Up @@ -30,24 +30,27 @@ CONFIG_FILE=tests/system/config.test-1.yml
CONFIG_FILE2=tests/system/config.test-2.yml
CONFIG_FILE3=tests/system/config.test-3.yml

# Setup script
SETUP_SCRIPT=tests/scripts/setup-supernodes.sh

# Setup the supernode test environment
install-supernode:
@echo "Setting up supernode test environment..."
@bash tests/scripts/install-sn.sh $(SUPERNODE_SRC) $(DATA_DIR) $(CONFIG_FILE)


# Install Lumera
install-lumera:
cd tests/scripts && ./install-lumera.sh

install-nodes:
@echo "Setting up additional supernode environments..."
@bash tests/scripts/multinode.sh $(DATA_DIR) $(DATA_DIR2) $(CONFIG_FILE2) $(DATA_DIR3) $(CONFIG_FILE3)

setup-all:
@echo "Cleaning up existing data directories..."
@rm -rf $(DATA_DIR) $(DATA_DIR2) $(DATA_DIR3)
@echo "Running installation targets..."
@$(MAKE) install-supernode
@$(MAKE) install-nodes
@echo "Setup complete."
@echo "Installing Lumera..."
@chmod +x tests/scripts/install-lumera.sh
@sudo tests/scripts/install-lumera.sh

# Setup supernode environments
setup-supernodes:
@echo "Setting up all supernode environments..."
@chmod +x $(SETUP_SCRIPT)
@bash $(SETUP_SCRIPT) all $(SUPERNODE_SRC) $(DATA_DIR) $(CONFIG_FILE) $(DATA_DIR2) $(CONFIG_FILE2) $(DATA_DIR3) $(CONFIG_FILE3)

# Complete system test setup (Lumera + Supernodes)
system-test-setup: install-lumera setup-supernodes
@echo "System test environment setup complete."
@if [ -f claims.csv ]; then cp claims.csv ~/; echo "Copied claims.csv to home directory."; fi

# Run system tests with complete setup
test-system-full: system-test-setup
@echo "Running system tests..."
@cd tests/system && go test -tags=system_test -v .
Loading
Loading