Skip to content

Commit 1bb33e6

Browse files
authored
Refactor e2e suite and cleanup (#384)
* Refactor e2e suite and cleanup Signed-off-by: Fiachra Corcoran <fiachra.corcoran@est.tech> * Ensure hanging repo deleted Signed-off-by: Fiachra Corcoran <fiachra.corcoran@est.tech> * Add README for api tests Signed-off-by: Fiachra Corcoran <fiachra.corcoran@est.tech> * Remove redundant testdata Signed-off-by: Fiachra Corcoran <fiachra.corcoran@est.tech> * Refactor to table driven and cleanup Signed-off-by: Fiachra Corcoran <fiachra.corcoran@est.tech> * Revert set-annotations on pkg update Signed-off-by: Fiachra Corcoran <fiachra.corcoran@est.tech> * Add edit task assertions Signed-off-by: Fiachra Corcoran <fiachra.corcoran@est.tech> --------- Signed-off-by: Fiachra Corcoran <fiachra.corcoran@est.tech>
1 parent 4495204 commit 1bb33e6

26 files changed

Lines changed: 2947 additions & 3218 deletions

.github/workflows/porch-e2e-ci-jobs.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,12 @@ jobs:
8686
include:
8787
- name: "Porch E2E Tests"
8888
make_target: "run-in-kind"
89-
test_path: "${GITHUB_WORKSPACE}/test/e2e"
89+
test_path: "${GITHUB_WORKSPACE}/test/e2e/api"
9090
test_env: "E2E=1"
9191
log_name: "porch-e2e-server.log"
9292
- name: "Porch E2E Tests (DB Cache)"
9393
make_target: "run-in-kind-db-cache"
94-
test_path: "${GITHUB_WORKSPACE}/test/e2e"
94+
test_path: "${GITHUB_WORKSPACE}/test/e2e/api"
9595
test_env: "E2E=1 DB_CACHE=1"
9696
log_name: "porch-e2e-dbcache-server.log"
9797
- name: "Porch CLI E2E Tests"

test/e2e/api/README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Porch E2E API Tests
2+
3+
## Prerequisites
4+
```bash
5+
export E2E=1
6+
```
7+
8+
## Running Tests
9+
10+
### Run Entire Suite
11+
```bash
12+
E2E=1 go test -v ./test/e2e/api
13+
```
14+
15+
### Run Single Test
16+
```bash
17+
E2E=1 go test -v ./test/e2e/api -run "TestE2E/TestGitRepository"
18+
```
19+
20+
### Run Table-Driven Sub-Test
21+
```bash
22+
E2E=1 go test -v ./test/e2e/api -run "TestE2E/TestBasicLifecycle/ProposeApprove"
23+
```
24+
25+
### Pattern Matching
26+
```bash
27+
E2E=1 go test -v ./test/e2e/api -run "TestE2E/.*Evaluator"
28+
```
29+
30+
### List All Available Tests
31+
```bash
32+
# List all test method names with source files
33+
grep "func.*Test" ./test/e2e/api/*_test.go | grep -o "[^/]*_test.go:.*Test[A-Za-z0-9]*" | sort
34+
```
35+
36+
## Test Structure
37+
38+
- **Suite-based**: All tests run under `TestE2E` using testify/suite
39+
- **Individual methods**: `TestCloneFromUpstream`, `TestConcurrentEdits`, etc.
40+
- **Table-driven sub-tests**: Some tests have sub-cases with `/` separator
41+
42+
## Common Issues
43+
44+
1. **"no tests to run"**: Use correct test method name (e.g., `TestCloneFromUpstream`)
45+
2. **Missing E2E env var**: Set `E2E=1` before running
46+
3. **Timeout issues**: Tests may take several minutes in slow environments

0 commit comments

Comments
 (0)