End-to-end testing infrastructure for the LumeWeb Portal application. This repository provides automated testing for portal functionality using docker-compose services, a shared script library, and integrated GitHub Actions workflows.
This repository does not contain the portal source code. Instead, it provides infrastructure and automation to:
- Run infrastructure services via Docker Compose
- Build the portal application using the external
portal-builderimage - Configure the portal via environment variables generated from YAML configs
- Execute end-to-end tests against the running portal
The portal application is built using ghcr.io/lumeweb/portal-builder:ubuntu with a portal-plugins.yaml manifest specifying plugins (ipfs, dashboard, core) at @develop versions.
docker-compose.yml- Infrastructure service definitions with health checksMakefile- Local development commands.github/workflows/e2e-tests.yml- CI/CD automation.github/actions/- Reusable composite actions.github/config/portal-core.yml- Core portal configuration templateconfig/portal-mysql.yml- MySQL configuration referencescripts/- Shared bash scripts (used by Makefile and GitHub Actions)
Docker Compose Services
mysql- Percona Server 8.4 on port 3306maildev- Email catcher on ports 1025 (SMTP) and 1080 (Web UI)gofakes3- S3-compatible storage on port 9000services-ready- Synchronization container
External Services
renterd- External Sia storage service configured via environment variablesportal- Built and run separately using portal-builder image
- Base Config:
.github/config/portal-core.ymlprovides minimal portal settings - DB Config:
config/portal-mysql.ymlprovides MySQL-specific settings - Env Generation:
scripts/setup-env.shandscripts/yaml_to_env.pyconvert YAML toPORTAL__*environment variables in.env - Renterd Override:
RENTERD_*env vars are preserved and mapped toPORTAL__CORE__STORAGE__SIA__*
Key mappings:
RENTERD_URL→PORTAL__CORE__STORAGE__SIA__URLRENTERD_API_PASSWORD→PORTAL__CORE__STORAGE__SIA__KEY
- Docker and Docker Compose installed
yqinstalled (YAML processor - available via Go installation)- Access to external renterd service
- Renterd credentials (URL, API password)
# 1. Configure environment
cp .env.example .env
# Edit .env with RENTERD_URL and RENTERD_API_PASSWORD
# 2. Start services
make up
# 3. Build and run portal
make test# Service management
make up # Start all Docker services
make down # Stop all Docker services
make restart # Restart all Docker services
make logs # View service logs
make ps # Show running containers
# Portal build & run
make ensure-portal-built # Build portal with plugins
make setup-env # Generate environment variables
make start-portal # Build and run portal in background
make stop-portal # Stop running portal
# Testing & cycles
make test # Full e2e test cycle with teardown
make e2e # Quick e2e test (up -> _test -> down)
make setup # Setup environment (no teardown)
make teardown # Tear down environment
# Cleanup
make clean # Clean up all resourcesNEVER manually manipulate environment variables. Always regenerate from YAML configs:
- Update configuration in
config/portal-mysql.yml(or.github/config/portal-core.ymlfor base settings) - Run
make setup-envto regenerate.env - Source
.envbefore running commands
This ensures consistent configuration across local and CI/CD environments.
-
make up make ensure-portal-built make setup-env make start-portal
-
Source the environment and verify portal:
. .env curl -H "Host: localhost:$PORTAL__CORE__PORT" http://localhost:$PORTAL__CORE__PORT/api/meta
-
Run tests manually or via the test cycle:
make _test make teardown
Always use scripts/run-tests.sh to run tests. This script loads the .env file before execution.
# Run all e2e tests
./scripts/run-tests.sh
# Run tests with verbose output
./scripts/run-tests.sh --godog.format=pretty
# Run specific scenario using tag
./scripts/run-tests.sh --godog.tags="@delete-api-key"
# Run specific feature file
./scripts/run-tests.sh features/account_management.featureThe e2e tests use godog (Cucumber for Go):
features/- BDD scenariossteps/- Step definitionshelpers/- Shared test utilities
Each scenario must have a unique tag for individual execution.
The workflow triggers on push/PR to main or develop branches:
- Uses shared bash scripts from
scripts/ - Runs MySQL, Maildev, and Gofakes3 as GitHub Actions services
- Uploads build artifacts
- Runs full e2e test suite
Configure these in your GitHub repository:
RENTERD_URL- URL to external renterd serviceRENTERD_API_PASSWORD- API password for renterd authentication
All scripts in scripts/ work in both local and GitHub Actions environments:
# Create plugin manifest
./scripts/create-plugin-manifest.sh
# Generate environment variables
./scripts/setup-env.sh mysql
# Start portal in background with logging
# Uses PORTAL_PORT from environment (default: 8080)
./scripts/start-portal.sh
# Wait for services (timeouts configurable via env vars)
./scripts/wait-mysql.sh
./scripts/wait-gofakes3.sh
./scripts/wait-portal.sh
./scripts/wait-stop-portal.sh 10
# DNS server
./scripts/start-dns.sh
./scripts/stop-dns.shThe portal HTTP endpoint (port 8080) may take several seconds to become available. This is because the portal loads all plugins before starting the HTTP server. The wait scripts ensure tests only run after the portal is ready.
The portal uses vhost routing with different subdomains for different plugin APIs:
# Core/meta endpoints
curl -H "Host: localhost:8080" http://localhost:8080/api/meta
# Account/authentication endpoints
curl -H "Host: account.localhost:8080" \
-H "Content-Type: application/json" \
-d '{"email":"test@example.com","password":"Test123!"}' \
http://localhost:8080/api/auth/registerHost headers by plugin:
- Core/meta:
Host: localhost:8080 - Account/auth:
Host: account.localhost:8080
- Maildev Web UI: http://localhost:1080
- Gofakes3: http://localhost:9000
# Check service logs
docker-compose logs <service-name>
# Check service status
docker-compose ps
# Verify service health
docker-compose ps# Verify MySQL is healthy
docker-compose ps mysqlVerify your .env file contains correct values:
RENTERD_URLRENTERD_API_PASSWORD
For CI/CD, ensure GitHub secrets are configured.
Check test logs in GitHub Actions artifacts or review locally:
make _testLocal (Docker Compose):
- MySQL:
mysqladmin ping -h localhost -u root -prootpassword - Maildev: HTTP check on port 1080
- Gofakes3: Port check on 9000
The services-ready container depends on all services being healthy, providing a synchronization point for external processes.
GitHub Actions:
- MySQL runs as a service with health checks configured in the workflow
scripts/wait-mysql.shdetects environment and uses appropriate connection method:- GitHub Actions:
mysqladmin ping -h localhost(service connection) - Local:
docker compose exec -T mysql mysqladmin ping
- GitHub Actions:
scripts/wait-gofakes3.shchecks exposed port 9000 on localhost for gofakes3 readiness (works in both CI and local)
The following plugins are configured at @develop versions:
- IPFS plugin:
go.lumeweb.com/portal-plugin-ipfs - Dashboard plugin:
go.lumeweb.com/portal-plugin-dashboard - Core plugin:
go.lumeweb.com/portal-plugin-core
Plugins are specified in portal-plugins.yaml, created by scripts/create-plugin-manifest.sh. The portal-builder image uses this manifest to build the portal with the correct plugins.