|
| 1 | +#!/bin/bash |
| 2 | +# E2E Test: Pattern 11 - Testing Patterns |
| 3 | +# Tests that test pyramid structure exists and tests pass |
| 4 | + |
| 5 | +set -e |
| 6 | + |
| 7 | +echo "=== E2E Test: Pattern 11 - Testing Patterns ===" |
| 8 | + |
| 9 | +# Test 1: Verify tests directory exists |
| 10 | +echo "Test 1: Verify tests directory exists..." |
| 11 | +if [[ -d "tests" ]]; then |
| 12 | + echo "✅ tests directory exists" |
| 13 | +else |
| 14 | + echo "❌ tests directory missing" |
| 15 | + exit 1 |
| 16 | +fi |
| 17 | + |
| 18 | +# Test 2: Verify unit tests directory exists |
| 19 | +echo "Test 2: Verify unit tests directory..." |
| 20 | +if [[ -d "tests/unit" ]]; then |
| 21 | + echo "✅ tests/unit exists" |
| 22 | +else |
| 23 | + echo "❌ tests/unit missing" |
| 24 | + exit 1 |
| 25 | +fi |
| 26 | + |
| 27 | +# Test 3: Verify integration tests directory exists |
| 28 | +echo "Test 3: Verify integration tests directory..." |
| 29 | +if [[ -d "tests/integration" ]]; then |
| 30 | + echo "✅ tests/integration exists" |
| 31 | +else |
| 32 | + echo "❌ tests/integration missing" |
| 33 | + exit 1 |
| 34 | +fi |
| 35 | + |
| 36 | +# Test 4: Verify e2e tests directory exists |
| 37 | +echo "Test 4: Verify e2e tests directory..." |
| 38 | +if [[ -d "tests/e2e" ]]; then |
| 39 | + echo "✅ tests/e2e exists" |
| 40 | +else |
| 41 | + echo "❌ tests/e2e missing" |
| 42 | + exit 1 |
| 43 | +fi |
| 44 | + |
| 45 | +# Test 5: Verify pytest.ini exists |
| 46 | +echo "Test 5: Verify pytest.ini exists..." |
| 47 | +if [[ -f "pytest.ini" ]]; then |
| 48 | + echo "✅ pytest.ini exists" |
| 49 | +else |
| 50 | + echo "❌ pytest.ini missing" |
| 51 | + exit 1 |
| 52 | +fi |
| 53 | + |
| 54 | +# Test 6: Verify conftest.py exists |
| 55 | +echo "Test 6: Verify conftest.py exists..." |
| 56 | +if [[ -f "tests/conftest.py" ]]; then |
| 57 | + echo "✅ conftest.py exists" |
| 58 | +else |
| 59 | + echo "❌ conftest.py missing" |
| 60 | + exit 1 |
| 61 | +fi |
| 62 | + |
| 63 | +# Test 7: Run all tests |
| 64 | +echo "Test 7: Run full test suite..." |
| 65 | +if python -m pytest tests/ -v --tb=short 2>&1; then |
| 66 | + echo "✅ All tests passed" |
| 67 | +else |
| 68 | + echo "❌ Some tests failed" |
| 69 | + exit 1 |
| 70 | +fi |
| 71 | + |
| 72 | +echo "" |
| 73 | +echo "=== Pattern 11 (Testing): ALL TESTS PASSED ✅ ===" |
0 commit comments