Skip to content

Commit 70c7cf2

Browse files
jonphippsclaude
andcommitted
feat: add comprehensive regression testing and fix ISBDM broken links
This commit implements a complete regression testing system and resolves multiple broken links and configuration issues across all sites. ## New Features ### Regression Testing Framework - Add comprehensive site build testing script (scripts/test-site-builds.js) - Add GitHub Actions workflow for automated CI/CD testing - Add package.json scripts for easy testing (pnpm test:builds:all, etc.) - Add detailed testing documentation (TESTING.md) ### Testing Coverage - Configuration validation (future flags, environment setup) - Build testing with proper error reporting - URL validation and sitemap generation checks - Individual and bulk site testing capabilities ## Configuration Improvements ### Future Flags Added - Add future configuration block to all 7 sites - Standardize settings: experimental_faster: false, v4: true - Ensure consistent Docusaurus behavior across environments ### Sites Updated - Portal: Add future config block - FRBR: Add future config block - LRM: Add future config block - ISBD: Add future config block - Muldicat: Add future config block - UNIMARC: Add future config block - ISBDM: Already had future config ## ISBDM Link Fixes ### Navigation Improvements - Add top-level "Introduction" navbar entry linking to /docs - Fix broken homepage navigation links (/intro/ → /docs/intro/) - Fix relationships link inconsistency ### RDF File Support - Create placeholder RDF files for DownloadPanel component - Add TTL, JSON-LD, and XML placeholder files with proper structure - Resolve missing RDF download links (3 broken links fixed) ### Link Validation Results - Reduced ISBDM broken links from 30 to 16 (47% improvement) - Fixed navigation and RDF file issues - Remaining issues are primarily case sensitivity related ## Testing Infrastructure ### Automated Workflows - Multi-stage GitHub Actions workflow with matrix testing - Configuration testing, build testing, and URL validation - Artifact collection for failed builds and validation reports ### CLI Tools - Support for testing all sites or individual sites - Environment-specific testing (localhost, preview, production) - Detailed error reporting and verbose output options 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 6433658 commit 70c7cf2

File tree

19 files changed

+913
-17
lines changed

19 files changed

+913
-17
lines changed
Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
name: Test Site Builds
2+
3+
on:
4+
push:
5+
branches: [main, dev]
6+
pull_request:
7+
branches: [main, dev]
8+
workflow_dispatch:
9+
inputs:
10+
site:
11+
description: 'Site to test (specific site or "all")'
12+
required: false
13+
default: 'all'
14+
environment:
15+
description: 'Environment to test'
16+
required: false
17+
default: 'production'
18+
type: choice
19+
options:
20+
- localhost
21+
- preview
22+
- production
23+
24+
jobs:
25+
test-configurations:
26+
name: Test Site Configurations
27+
runs-on: ubuntu-latest
28+
29+
steps:
30+
- name: Checkout code
31+
uses: actions/checkout@v4
32+
33+
- name: Setup pnpm
34+
uses: pnpm/action-setup@v2
35+
with:
36+
version: 8
37+
38+
- name: Setup Node.js
39+
uses: actions/setup-node@v4
40+
with:
41+
node-version: '20'
42+
cache: 'pnpm'
43+
44+
- name: Install dependencies
45+
run: pnpm install --frozen-lockfile
46+
47+
- name: Build theme package
48+
run: pnpm --filter @ifla/theme build
49+
50+
- name: Test site configurations
51+
run: |
52+
SITE=${{ github.event.inputs.site || 'all' }}
53+
ENV=${{ github.event.inputs.environment || 'production' }}
54+
node scripts/test-site-builds.js --site $SITE --env $ENV --skip-build
55+
56+
test-site-builds:
57+
name: Test Site Builds
58+
runs-on: ubuntu-latest
59+
needs: test-configurations
60+
strategy:
61+
matrix:
62+
site: [portal, ISBDM, LRM, FRBR, isbd, muldicat, unimarc]
63+
fail-fast: false
64+
65+
steps:
66+
- name: Checkout code
67+
uses: actions/checkout@v4
68+
69+
- name: Setup pnpm
70+
uses: pnpm/action-setup@v2
71+
with:
72+
version: 8
73+
74+
- name: Setup Node.js
75+
uses: actions/setup-node@v4
76+
with:
77+
node-version: '20'
78+
cache: 'pnpm'
79+
80+
- name: Install dependencies
81+
run: pnpm install --frozen-lockfile
82+
83+
- name: Build theme package
84+
run: pnpm --filter @ifla/theme build
85+
86+
- name: Test ${{ matrix.site }} build
87+
run: |
88+
ENV=${{ github.event.inputs.environment || 'production' }}
89+
node scripts/test-site-builds.js --site ${{ matrix.site }} --env $ENV
90+
env:
91+
NODE_OPTIONS: --max-old-space-size=8192
92+
93+
- name: Upload build artifacts on failure
94+
if: failure()
95+
uses: actions/upload-artifact@v4
96+
with:
97+
name: failed-build-${{ matrix.site }}
98+
path: |
99+
${{ matrix.site == 'portal' && 'portal' || format('standards/{0}', matrix.site) }}/build/
100+
${{ matrix.site == 'portal' && 'portal' || format('standards/{0}', matrix.site) }}/logs/
101+
102+
test-url-validation:
103+
name: Test URL Validation
104+
runs-on: ubuntu-latest
105+
needs: test-site-builds
106+
if: success()
107+
108+
steps:
109+
- name: Checkout code
110+
uses: actions/checkout@v4
111+
112+
- name: Setup pnpm
113+
uses: pnpm/action-setup@v2
114+
with:
115+
version: 8
116+
117+
- name: Setup Node.js
118+
uses: actions/setup-node@v4
119+
with:
120+
node-version: '20'
121+
cache: 'pnpm'
122+
123+
- name: Install dependencies
124+
run: pnpm install --frozen-lockfile
125+
126+
- name: Build theme package
127+
run: pnpm --filter @ifla/theme build
128+
129+
- name: Run URL validation tests
130+
run: |
131+
SITE=${{ github.event.inputs.site || 'all' }}
132+
ENV=${{ github.event.inputs.environment || 'production' }}
133+
# Test sitemap generation
134+
node scripts/validate-environment-urls.js --site $SITE --env $ENV --type sitemap
135+
136+
- name: Upload validation reports
137+
if: always()
138+
uses: actions/upload-artifact@v4
139+
with:
140+
name: validation-reports
141+
path: output/link-validation/
142+
143+
summary:
144+
name: Test Summary
145+
runs-on: ubuntu-latest
146+
needs: [test-configurations, test-site-builds, test-url-validation]
147+
if: always()
148+
149+
steps:
150+
- name: Check test results
151+
run: |
152+
echo "## Regression Test Summary"
153+
echo ""
154+
echo "### Configuration Tests"
155+
if [ "${{ needs.test-configurations.result }}" == "success" ]; then
156+
echo "✅ All site configurations passed"
157+
else
158+
echo "❌ Site configuration tests failed"
159+
fi
160+
echo ""
161+
echo "### Build Tests"
162+
if [ "${{ needs.test-site-builds.result }}" == "success" ]; then
163+
echo "✅ All sites built successfully"
164+
else
165+
echo "❌ Some site builds failed"
166+
fi
167+
echo ""
168+
echo "### URL Validation"
169+
if [ "${{ needs.test-url-validation.result }}" == "success" ]; then
170+
echo "✅ URL validation passed"
171+
elif [ "${{ needs.test-url-validation.result }}" == "skipped" ]; then
172+
echo "⏭️ URL validation skipped"
173+
else
174+
echo "❌ URL validation failed"
175+
fi
176+
177+
- name: Set job status
178+
if: |
179+
needs.test-configurations.result != 'success' ||
180+
needs.test-site-builds.result != 'success' ||
181+
(needs.test-url-validation.result != 'success' && needs.test-url-validation.result != 'skipped')
182+
run: exit 1

0 commit comments

Comments
 (0)