This directory is organized into unit and integration tests.
tests/unit/: Fast unit tests that mock external dependencies (SSH, Git, etc.).tests/integration/: Docker-based integration tests that simulate a real SSH deployment environment.
make test
# OR
pytest tests/ -v -smake test-unit
# OR
pytest tests/unit/ -vpytest tests/integration/ -v -sPytest's default output capture mechanism interferes with the SSH connections used by Fabric/Paramiko. The -s flag (--capture=no) disables this capture, allowing the SSH connections to work properly.
The integration tests include:
- SSH Connection Test: Verifies basic SSH connectivity
- Git Tools Test: Confirms Git is installed on the remote
- Environment File Generation Test: Tests remote
.envfile creation - Deploy Simulation Test: Validates deployment command execution
- Container: Ubuntu 22.04 with SSH, Git, Python3
- Port: 2222 (mapped to container's port 22)
- Credentials: root/root
- Lifecycle: Automatically managed by pytest fixtures
The Docker container is automatically started before tests and stopped after completion.