Skip to content

Commit 04c51a1

Browse files
authored
test: add E2E integration tests with CI support (#27) (#27)
- Add tests/integration/e2e_test.go with 6 comprehensive E2E tests - TestE2E_VersionSelection_RealRepository - TestE2E_VersionSelection_EdgeCases (regression for v0.7.6 bug) - TestE2E_ResolveWorkflow - TestE2E_DependencyChain - TestE2E_AtomMatching - TestE2E_CachedRepository - Update integration.yml to run E2E tests in Gentoo container - Update CHANGELOG.md and ROADMAP.md for v0.7.7
1 parent 7bb7950 commit 04c51a1

File tree

4 files changed

+532
-10
lines changed

4 files changed

+532
-10
lines changed

.github/workflows/integration.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on:
1616
workflow_dispatch:
1717
inputs:
1818
test_filter:
19-
description: 'Test filter (e.g., TestAutotools, TestCMake, TestMeson)'
19+
description: 'Test filter (e.g., E2E, Autotools, CMake, Meson)'
2020
required: false
2121
default: ''
2222
timeout_minutes:
@@ -76,6 +76,19 @@ jobs:
7676
go build -v -o bin/grpm ./cmd/grpm
7777
./bin/grpm version || echo "Version check completed"
7878
79+
- name: Run E2E Tests
80+
if: ${{ !github.event.inputs.test_filter || contains(github.event.inputs.test_filter, 'E2E') }}
81+
run: |
82+
echo "=== E2E Integration Tests ==="
83+
echo "Testing version selection, resolve workflow, dependency chains..."
84+
go test -v -tags=integration -timeout=10m \
85+
-run 'TestE2E' \
86+
./tests/integration/...
87+
env:
88+
GRPM_REPO_PATH: /var/db/repos/gentoo
89+
GRPM_DIST_DIR: /var/cache/distfiles
90+
GRPM_TMP_DIR: /var/tmp/portage
91+
7992
- name: Run Autotools Tests
8093
if: ${{ !github.event.inputs.test_filter || contains(github.event.inputs.test_filter, 'Autotools') }}
8194
run: |

CHANGELOG.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,56 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1414

1515
---
1616

17+
## [0.7.7] - 2026-01-13
18+
19+
### E2E Integration Tests & CI Enhancement
20+
21+
> **Professional E2E test suite for full workflow validation**
22+
>
23+
> Adds comprehensive end-to-end tests that would have caught the v0.7.6
24+
> version selection bug automatically. Tests run in CI with real Gentoo.
25+
26+
### Added
27+
28+
#### E2E Integration Tests (`tests/integration/e2e_test.go`)
29+
- **TestE2E_VersionSelection_RealRepository** — Version selection on real Gentoo tree
30+
- Validates correct version is selected for app-misc/hello, dev-libs/openssl, app-shells/bash
31+
- Catches alphabetical vs PMS version comparison bugs
32+
- **TestE2E_VersionSelection_EdgeCases** — 5 edge cases with controlled repository
33+
- `patch_vs_base`: 2.12 vs 2.12.2
34+
- `numeric_comparison`: 1.9 vs 1.10 vs 1.11
35+
- `suffix_ordering`: 1.0_alpha < 1.0_beta < 1.0_rc1 < 1.0
36+
- `revision_comparison`: 2.0-r1 vs 2.0-r10 (numeric, not string)
37+
- `complex_gentoo_real`: Real-world version sets
38+
- **TestE2E_ResolveWorkflow** — Full dependency resolution workflow
39+
- **TestE2E_DependencyChain** — Deep dependency chain resolution
40+
- **TestE2E_AtomMatching** — Atom constraints (>=, <, =)
41+
- **TestE2E_CachedRepository** — Cache consistency verification
42+
43+
#### CI Integration
44+
- **E2E tests added to integration.yml** — Runs in Gentoo container
45+
- New step "Run E2E Tests" before Autotools/CMake/Meson tests
46+
- Uses real `/var/db/repos/gentoo` repository
47+
- 10-minute timeout (E2E tests are fast)
48+
- **Manual trigger support** — Filter with `E2E` in workflow dispatch
49+
50+
### Test Results (Gentoo WSL2)
51+
```
52+
TestE2E_VersionSelection_RealRepository: PASS (0.18s)
53+
- app-misc/hello: 2.12.2 (correct!)
54+
- dev-libs/openssl: 3.6.9999 (from 14 versions)
55+
- app-shells/bash: 9999 (from 20 versions)
56+
TestE2E_VersionSelection_EdgeCases: PASS (0.01s)
57+
TestE2E_ResolveWorkflow: PASS (0.02s)
58+
TestE2E_AtomMatching: PASS (0.00s)
59+
TestE2E_CachedRepository: PASS (0.16s)
60+
```
61+
62+
### Changed
63+
- `.github/workflows/integration.yml` — Added E2E test step with Gentoo environment
64+
65+
---
66+
1767
## [0.7.6] - 2026-01-13
1868

1969
### Critical Bug Fix: Version Selection

ROADMAP.md

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
# GRPM Roadmap
22

3-
> **Version Selection Fix (v0.7.6)**
3+
> **E2E Integration Tests (v0.7.7)**
44
>
55
> Rapid development complete (v0.1.0 → v0.5.0).
66
> Infrastructure release complete (v0.6.0).
77
> Portage-style logging (v0.7.0) + compatibility fixes (v0.7.2 → v0.7.4).
88
> Build reliability and output quality improvements (v0.7.5).
99
> Critical version selection bug fix + emerge flags (v0.7.6).
10+
> Professional E2E test suite with CI integration (v0.7.7).
1011
> **98.2% tree coverage verified on real Gentoo!**
1112
1213
---
@@ -67,14 +68,18 @@ Key insight: **Eclasses don't need Go implementations.** They are loaded dynamic
6768

6869
## Release History
6970

70-
### v0.7.5Build Quality Release (Current)
71+
### v0.7.7E2E Integration Tests (Current)
7172

72-
**Professional output and reliable builds:**
73+
**Professional E2E test suite with CI integration:**
7374

74-
- **Unified logging infrastructure** — All output uses `internal/logging/` package
75-
- **Debug output suppressed** — Clean output by default, verbose with `-v`
76-
- **Source build fixes** — S variable parsing, timestamp preservation, replace mode
77-
- **CLI improvements** — --help exit code fix, mirror:// expansion in emerge
75+
- **6 E2E tests** — Version selection, resolve workflow, dependency chains, atom matching
76+
- **CI integration** — Tests run in Gentoo container on every release
77+
- **Regression prevention** — Would have caught v0.7.6 version selection bug automatically
78+
79+
### v0.7.5/v0.7.6 — Build Quality & Bug Fixes
80+
81+
- **v0.7.6** — Critical version selection bug fix, --replace/--force flags
82+
- **v0.7.5** — Unified logging, debug output suppressed, source build fixes
7883

7984
### v0.7.4 — Critical Hotfix
8085

@@ -155,11 +160,13 @@ Key insight: **Eclasses don't need Go implementations.** They are loaded dynamic
155160
## Roadmap to v1.0.0
156161

157162
```
158-
v0.7.5 ← CURRENT (Build Quality Release)
163+
v0.7.7 ← CURRENT (E2E Integration Tests)
159164
│ ✅ v0.6.0: Distfile fetching, debug helpers, coverage analyzer
160165
│ ✅ v0.7.0: Portage-style logging
161166
│ ✅ v0.7.2-v0.7.4: Portage compatibility fixes
162167
│ ✅ v0.7.5: Unified logging, source build reliability
168+
│ ✅ v0.7.6: Version selection fix, emerge flags
169+
│ ✅ v0.7.7: E2E tests + CI integration
163170
│ ✅ 98.2% tree coverage on real Gentoo!
164171
165172
v0.8.0 — Production Hardening (2 tasks)
@@ -290,4 +297,4 @@ Key deliverables:
290297
---
291298

292299
*This roadmap evolves based on community feedback and project needs.*
293-
*Last updated: 2026-01-13 (v0.7.5 release)*
300+
*Last updated: 2026-01-13 (v0.7.7 release)*

0 commit comments

Comments
 (0)