The GenNet platform includes comprehensive test coverage across all components:
@pytest.mark.unit)
services/*/tests/test_*.py@pytest.mark.integration)
services/*/tests/test_*_api.py@pytest.mark.e2e)
tests/integration/make test
make test-unit
make test-integration
make test-e2e
make test-coverage
pytest services/auth-service/tests/
pytest services/auth-service/tests/test_auth.py
docker-compose up -d
@pytest.mark.unit
def test_password_hashing():
password = "testpassword"
hashed = get_password_hash(password)
assert verify_password(password, hashed)
@pytest.mark.integration
def test_create_network(client, auth_token):
response = client.post(
"/networks",
json={"name": "Test", "nodes": [], "edges": []},
headers={"Authorization": f"Bearer {auth_token}"}
)
assert response.status_code == 201
@pytest.mark.e2e
def test_workflow_e2e():
# Register user
# Create network
# Run workflow
# Check results
Common fixtures are defined in conftest.py:
client: FastAPI test clientdb: Test database sessionauth_token: Authentication tokentest_user: Sample userFrontend uses Jest and React Testing Library:
cd frontend/web
npm test
Tests run automatically on:
.github/workflows/ci.yml