test(pi-shell): add glab fixtures, tighten release view filter

Port rtk glab fixtures (ci-trace, release-list, release-view) to the
minimizer fixture harness with savings gate.

Tighten release-view filter: also strip ASSETS section (no-assets
noise), View-on-GitLab footer link. Update test assertions.

Op: extend
This commit is contained in:
metaphorics
2026-06-12 02:10:32 +09:00
parent 01426b51a8
commit 3c53dd9e01
8 changed files with 135 additions and 3 deletions
+24 -3
View File
@@ -231,7 +231,18 @@ fn filter_release_view(input: &str) -> String {
for line in input.lines() {
let trimmed = line.trim();
// Skip SOURCES section (archive download URLs)
// Strip trailing "View this release on GitLab" link
if trimmed.starts_with("View this release on GitLab") {
continue;
}
// Strip "ASSETS" / "There are no assets..." section
if trimmed == "ASSETS" {
in_sources = true; // reuse state machine; next non-empty line is "There are no assets..."
continue;
}
// Strip SOURCES section (archive download URLs)
if trimmed == "SOURCES" {
in_sources = true;
continue;
@@ -478,6 +489,12 @@ section_end:1711234600:build_script[0K
assert!(!out.text.contains("Image:"));
// HTML comments stripped
assert!(!out.text.contains("<!-- internal"));
// Footer stripped (noise)
assert!(!out.text.contains("View this release"));
// ASSETS/SOURCES sections stripped
assert!(!out.text.contains("ASSETS"));
assert!(!out.text.contains("SOURCES"));
assert!(!out.text.contains("archive/v2.0.0"));
}
#[test]
@@ -493,8 +510,12 @@ section_end:1711234600:build_script[0K
assert!(out.text.contains("Added widget support"));
assert!(out.text.contains("Fixed authentication bug"));
assert!(out.text.contains("@alice_dev @bob_dev"));
// Footer preserved
assert!(out.text.contains("View this release"));
// Footer stripped (noise)
assert!(!out.text.contains("View this release"));
// ASSETS/SOURCES sections stripped
assert!(!out.text.contains("ASSETS"));
assert!(!out.text.contains("SOURCES"));
assert!(!out.text.contains("archive/v2.0.0"));
}
// ── MR/issue view tests ─────────────────────────────────────────────
@@ -0,0 +1 @@
glab ci trace
@@ -0,0 +1,54 @@
section_start:1711234567:prepare_executor[0K
Running with gitlab-runner 16.9.0 (656c1943)
on runner-abc123 system ID: r_defGHI456
Using Docker executor with image node:20-alpine ...
Preparing the "docker" executor
Using Docker executor with image node:20-alpine ...
Running on runner-abc123-project-42-concurrent-0 via runner-host...
section_end:1711234570:prepare_executor[0K
section_start:1711234570:get_sources[0K
Getting source from Git repository
Fetching changes with git depth set to 20...
Initialized empty Git repository in /builds/acme/toolkit/.git/
Created fresh repository.
Checking out abc12345 as main...
Skipping Git submodules setup
section_end:1711234575:get_sources[0K
section_start:1711234575:download_artifacts[0K
Downloading artifacts for build (job_id=98765)...
Downloading artifacts from coordinator... ok host=runner-host id=98765 responseStatus=200 OK token=abc123
section_end:1711234578:download_artifacts[0K
section_start:1711234578:build_script[0K
$ npm ci
added 847 packages in 12s
$ npm run build
> acme-toolkit@3.2.1 build
> tsc && vite build
[36;1mvite v5.2.0[0m building for production...
[32m✓[0m 142 modules transformed.
[33m⚠[0m Some chunks are larger than 500 kB after minification.
dist/index.html 0.45 kB │ gzip: 0.29 kB
dist/assets/main-a1b2c3.js 156.78 kB │ gzip: 48.23 kB
dist/assets/style-d4e5f6.css 12.34 kB │ gzip: 3.45 kB
[32m✓[0m built in 4.56s
$ npm test
> acme-toolkit@3.2.1 test
> vitest run
[32m✓[0m src/utils.test.ts (3 tests) 45ms
[32m✓[0m src/api.test.ts (7 tests) 123ms
[31m✗[0m src/auth.test.ts (2 tests) 67ms
FAIL src/auth.test.ts > validateToken > should reject expired tokens
AssertionError: expected true to be false
at src/auth.test.ts:42:18
Test Files 1 failed | 2 passed | 3 total
Tests 1 failed | 11 passed | 12 total
Duration 0.89s
section_end:1711234600:build_script[0K
section_start:1711234600:upload_artifacts[0K
Uploading artifacts...
Uploading artifacts as "archive" to coordinator... ok id=98765 responseStatus=201 Created token=abc123
section_end:1711234605:upload_artifacts[0K
section_start:1711234605:cleanup_file_variables[0K
Cleaning up project directory and file based variables
section_end:1711234606:cleanup_file_variables[0K
[31;1mERROR: Job failed: exit code 1[0m
@@ -0,0 +1 @@
glab release list
@@ -0,0 +1,11 @@
Releases
v3.2.1 (about 2 days ago)
v3.2.0 (about 1 week ago)
v3.1.0 (about 3 weeks ago)
v3.0.0 (about 1 month ago)
v2.5.0 (about 3 months ago)
v2.4.1 (about 5 months ago)
v2.4.0 (about 6 months ago)
v2.3.0 (about 9 months ago)
v2.2.0 (about 1 year ago)
v2.1.0 (about 2 years ago)
@@ -0,0 +1,13 @@
Showing 10 releases on acme/toolkit.
Name Tag Created
v3.2.1 v3.2.1 about 2 days ago
v3.2.0 v3.2.0 about 1 week ago
v3.1.0 v3.1.0 about 3 weeks ago
v3.0.0 v3.0.0 about 1 month ago
v2.5.0 v2.5.0 about 3 months ago
v2.4.1 v2.4.1 about 5 months ago
v2.4.0 v2.4.0 about 6 months ago
v2.3.0 v2.3.0 about 9 months ago
v2.2.0 v2.2.0 about 1 year ago
v2.1.0 v2.1.0 about 2 years ago
@@ -0,0 +1 @@
glab release view v2.0
@@ -0,0 +1,30 @@
Test Release v2.0
alice_dev released this 3 days ago
abc1234 - v2.0.0
## What's Changed
- Added widget support
- Fixed authentication bug
### Contributors
@alice_dev @bob_dev
--------
Image: logo → https://example.com/logo.png
<!-- internal tracking: PROJ-123 -->
ASSETS
There are no assets for this release
SOURCES
https://gitlab.example.com/acme/toolkit/-/archive/v2.0.0/toolkit-v2.0.0.zip
https://gitlab.example.com/acme/toolkit/-/archive/v2.0.0/toolkit-v2.0.0.tar.gz
https://gitlab.example.com/acme/toolkit/-/archive/v2.0.0/toolkit-v2.0.0.tar.bz2
https://gitlab.example.com/acme/toolkit/-/archive/v2.0.0/toolkit-v2.0.0.tar
View this release on GitLab at https://gitlab.example.com/acme/toolkit/-/releases/v2.0.0