FOCUSCurrently working on ScheduleSomething and LayerdEvents algorithmsLearn More
FOCUSCurrently working on ScheduleSomething and LayerdEvents algorithmsLearn More
FOCUSCurrently working on ScheduleSomething and LayerdEvents algorithmsLearn More
FOCUSCurrently working on ScheduleSomething and LayerdEvents algorithmsLearn More
CONTRIBUTING.MdDeveloper Guide
Testing Methodology
DocsCONTRIBUTING.mdDeveloper GuideTesting Methodology
GitHub Live Sync

Testing Methodology

Live technical documentation fetched from GitHub repository omghante/metapilot/docs/developer/testing.md

Automated Testing Strategy Guide

Instructions for running and extending automated tests across MetaPilot.

Running Backend Unit & Integration Tests

MetaPilot supports both the standard Django Test Runner and Pytest.

1. Running Standard Django Tests

From
services/api
:
bash
python manage.py test
To run tests for a specific application:
bash
python manage.py test tenants
python manage.py test users

2. Running Pytest Suite

bash
# Run specific test file
python -m pytest tests/unit/security/test_tenant_encryption.py

# Run all unit tests
python -m pytest tests/unit/

Writing Model & API Tests

Example: Testing Fernet Encryption (
test_tenant_encryption.py
)

python
@pytest.mark.skipif(not _has_cryptography(), reason='cryptography not installed')
def test_encrypt_decrypt_roundtrip(self):
    """Encrypting then decrypting returns original value."""
    fernet, key = self._make_fernet()
    config = self._make_config(key)

    config.set_value('my_secret_api_token_12345')
    decrypted = config.get_value()

    assert decrypted == 'my_secret_api_token_12345'

Running Frontend Tests & Linters

From
apps
:
bash
yarn lint
yarn build