Commit 6b9ecf7
committed
feat: add comprehensive e2e test suite with multi-node distributed testing
## Summary
Introduces a completely separate end-to-end testing infrastructure independent from unit tests:
- **Multi-node distributed tests**: 15 tests using LocalCluster for real Erlang clusters
- Leader election and failover scenarios (3 tests)
- Network partition handling (4 tests)
- Data consistency and replication (5 tests)
- Node failure and recovery (3 tests)
- **Complete separation from unit tests**: Uses MIX_ENV=e2e_test with isolated dependencies
- Separate configuration in config/e2e_test.exs
- Independent data directories
- Dedicated Mix aliases (mix test.e2e, mix test.e2e.distributed)
- **Comprehensive helper utilities**: ClusterHelper module (500+ lines)
- Cluster lifecycle management (start, stop, restart)
- Network partition simulation and healing
- Node failure injection
- Raft leader detection and waiting
- **GitHub Actions CI/CD integration**: Dedicated e2e-test.yml workflow
- Runs distributed tests on every push/PR (~5 min)
- Nightly runs with full test suite
- Manual workflow dispatch support
- **Extensive documentation** (600+ lines total)
- Quick start guide (2-minute setup)
- Comprehensive README with examples
- Setup summary document
- Updated CLAUDE.md project documentation
## Dependencies Added
- local_cluster ~> 2.0 (only e2e_test environment)
- httpoison ~> 2.0 (only e2e_test environment)
## Files Created
- e2e_test/test_helper.exs
- e2e_test/support/e2e_cluster_helper.ex
- e2e_test/distributed/leader_election_test.exs
- e2e_test/distributed/network_partition_test.exs
- e2e_test/distributed/data_consistency_test.exs
- e2e_test/distributed/node_failure_test.exs
- e2e_test/README.md
- e2e_test/QUICKSTART.md
- config/e2e_test.exs
- .github/workflows/e2e-test.yml
- E2E_SETUP_SUMMARY.md
## Files Modified
- mix.exs: Added dependencies, elixirc_paths, and Mix aliases
- CLAUDE.md: Added e2e testing documentation
- .gitignore: Added e2e test artifacts
## Quick Start
```bash
# One-time setup
epmd -daemon
MIX_ENV=e2e_test mix deps.get
MIX_ENV=e2e_test mix compile
# Run tests
mix test.e2e.distributed
```
## Testing
Run e2e tests locally:
```bash
# All distributed tests
mix test.e2e.distributed
# Specific test file
MIX_ENV=e2e_test mix test e2e_test/distributed/leader_election_test.exs
# Verbose output
MIX_ENV=e2e_test mix test e2e_test/ --trace
```
GitHub Actions will run automatically on:
- Every push/PR to main/develop
- Nightly at 2 AM UTC
- Manual workflow dispatch1 parent 6a9edb6 commit 6b9ecf7
File tree
15 files changed
+1742
-5
lines changed- .github/workflows
- config
- e2e_test
- distributed
- support
15 files changed
+1742
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
30 | 39 | | |
31 | 40 | | |
32 | 41 | | |
| |||
192 | 201 | | |
193 | 202 | | |
194 | 203 | | |
195 | | - | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
196 | 208 | | |
197 | 209 | | |
198 | 210 | | |
199 | 211 | | |
200 | 212 | | |
201 | 213 | | |
202 | | - | |
203 | | - | |
204 | 214 | | |
205 | 215 | | |
206 | 216 | | |
| |||
210 | 220 | | |
211 | 221 | | |
212 | 222 | | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
213 | 256 | | |
214 | 257 | | |
215 | 258 | | |
| |||
235 | 278 | | |
236 | 279 | | |
237 | 280 | | |
238 | | - | |
| 281 | + | |
239 | 282 | | |
240 | 283 | | |
241 | 284 | | |
| |||
249 | 292 | | |
250 | 293 | | |
251 | 294 | | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
252 | 299 | | |
253 | 300 | | |
254 | 301 | | |
| |||
0 commit comments