-
Notifications
You must be signed in to change notification settings - Fork 2
Add Speedshop-style tests and built-site link integrity checks #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
1c879a5
Add Speedshop-style test suite and parallel link integrity checks
nateberkopec 370e8a4
Fix remaining external links flagged in CI
nateberkopec 1e070e6
Make reddit profile link CI-stable for link integrity test
nateberkopec 6056bd3
Document test setup and link checker behavior in AGENTS
nateberkopec 0e343ba
Use ephemeral test server port assignment via port 0
nateberkopec b30a2ca
Refine link checks and restore user-facing links
nateberkopec be9efa0
Test newsletter form actions separately from link crawl
nateberkopec b472123
Treat Reddit 403 as reachable in link integrity checks
nateberkopec File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| name: Test | ||
|
|
||
| on: | ||
| pull_request: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
| cache: npm | ||
| - name: Install node dependencies | ||
| run: npm ci | ||
| - uses: ruby/setup-ruby@v1 | ||
| with: | ||
| bundler-cache: true | ||
| - name: Run test suite | ||
| run: bundle exec rake test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| # dotcom | ||
|
|
||
| Personal Jekyll site (`www.nateberkopec.com`). | ||
|
|
||
| ## Test Setup | ||
|
|
||
| The test suite mirrors the Speedshop structure: | ||
|
|
||
| - `test/ruby/` — Minitest unit tests for Jekyll plugins | ||
| - `test/integration/site_test.rb` — HTTP smoke tests against the built site | ||
| - `test/integration/link_integrity_test.rb` — full built-site link/resource/anchor validation | ||
|
|
||
| ### Commands | ||
|
|
||
| ```bash | ||
| bundle exec rake test:ruby | ||
| bundle exec rake test:integration | ||
| bundle exec rake test | ||
| ``` | ||
|
|
||
| Or with mise: | ||
|
|
||
| ```bash | ||
| mise run test:ruby | ||
| mise run test:integration | ||
| mise run test | ||
| ``` | ||
|
|
||
| ### Link Integrity Rules | ||
|
|
||
| `test/integration/link_integrity_test.rb` checks the built `_site` output and verifies: | ||
|
|
||
| - all internal and external links/resources (anchors, images, scripts, stylesheets, forms, media) | ||
| - fragment anchors (`#id`) resolve to existing elements | ||
| - redirects are allowed | ||
| - `mailto:` and `tel:` are syntax-validated only | ||
| - external checks retry 3 times, then hard-fail | ||
| - requests are parallelized with `Concurrent::ThreadPoolExecutor` (pool size: 25) | ||
|
|
||
| ### Local Test Server | ||
|
|
||
| Integration tests build `_site` and start a local static server automatically on `127.0.0.1` using port `0` (ephemeral). | ||
| The assigned port is discovered at runtime and used by the test helpers. | ||
| Set `BASE_URL` to run against a specific target instead. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| require "rake/testtask" | ||
|
|
||
| Rake::TestTask.new("test:ruby") do |t| | ||
| t.libs << "test/ruby" | ||
| t.test_files = FileList["test/ruby/**/*_test.rb"] | ||
| end | ||
|
|
||
| Rake::TestTask.new("test:integration") do |t| | ||
| t.libs << "test/integration" | ||
| t.test_files = FileList["test/integration/**/*_test.rb"] | ||
| end | ||
|
|
||
| desc "Run all tests" | ||
| task test: ["test:ruby", "test:integration"] | ||
|
|
||
| task default: :test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.