Skip to content

feat(tools): add tests for check version url script#2526

Merged
Automaat merged 2 commits intomasterfrom
feat/tests-tools-check
Nov 26, 2025
Merged

feat(tools): add tests for check version url script#2526
Automaat merged 2 commits intomasterfrom
feat/tests-tools-check

Conversation

@Automaat
Copy link
Contributor

Motivation

Add test coverage for check-version-urls.sh to prevent regressions

Implementation information

Bash test script following existing pattern from test-validate-frontmatter.sh. Creates temp git repos per test to simulate real git diff scenarios. Tests cover:

  • No markdown files changed
  • Clean markdown with {{ page.release }}
  • Hardcoded X.Y.x/X.Y.Z URLs (fail cases)
  • no-version-lint comment suppression
  • /assets/images/ path exclusion
  • /generated/ and /raw/ directory exclusions
  • .markdown extension support

Supporting documentation

N/A

@Automaat Automaat requested a review from a team as a code owner November 26, 2025 06:17
@Automaat Automaat requested review from Copilot, lukidzi and slonka and removed request for a team and Copilot November 26, 2025 06:17
@netlify
Copy link

netlify bot commented Nov 26, 2025

Deploy Preview for kuma ready!

Name Link
🔨 Latest commit 90aff1f
🔍 Latest deploy log https://app.netlify.com/projects/kuma/deploys/6926b31c248b400008cf25fc
😎 Deploy Preview https://deploy-preview-2526--kuma.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 92 (🟢 up 6 from production)
Accessibility: 90 (no change from production)
Best Practices: 100 (no change from production)
SEO: 92 (no change from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds comprehensive test coverage for the check-version-urls.sh script to prevent regressions in version URL detection. The test suite creates temporary git repositories to simulate real diff scenarios and validates all the script's core functionality including pattern matching, comment suppression, and path exclusions.

Key Changes

  • New bash test script following the established testing pattern from test-validate-frontmatter.sh
  • 13 test cases covering success and failure scenarios for hardcoded version URL detection
  • Temporary git repository setup per test for proper isolation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@bartsmykla bartsmykla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest to use shellspec as writing own "small" testing framework might seem to be not an issue now, but might result in harder maintainability when the amount of tests will grow in the future

Signed-off-by: Marcin Skalski <skalskimarcin33@gmail.com>
- add shellspec to mise.toml
- rewrite tests using shellspec BDD framework
- delete custom test framework

Signed-off-by: Marcin Skalski <skalskimarcin33@gmail.com>
@Automaat Automaat force-pushed the feat/tests-tools-check branch from 24faf0b to 90aff1f Compare November 26, 2025 07:58
@Automaat Automaat merged commit 13c543d into master Nov 26, 2025
20 checks passed
@Automaat Automaat deleted the feat/tests-tools-check branch November 26, 2025 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants