Skip to content

test(ci): add unit tests for documentation link validation (#2186) - #2349

Open
Sneha-Anand1910 wants to merge 2 commits into
utksh1:mainfrom
Sneha-Anand1910:sneha/validate-doc-links-2186
Open

test(ci): add unit tests for documentation link validation (#2186)#2349
Sneha-Anand1910 wants to merge 2 commits into
utksh1:mainfrom
Sneha-Anand1910:sneha/validate-doc-links-2186

Conversation

@Sneha-Anand1910

Copy link
Copy Markdown

Description

This PR adds unit tests for the documentation link validator (scripts/validate_doc_links.py). The script had no tests, so this adds coverage to make sure it reliably catches broken documentation links before they reach CI.

Related Issues

Fixes #2186

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

How Has This Been Tested?

Added a new test file testing/backend/unit/test_validate_doc_links.py with 5 tests covering:

  • a valid relative link with a valid anchor (passes cleanly)
  • a link to a missing file (reports a broken link target)
  • a link with a broken #anchor (reports the anchor as not found)
  • external / in-page / mailto links (correctly skipped)
  • slugify producing GitHub-style anchors

Run locally with:
python -m pytest testing/backend/unit/test_validate_doc_links.py -v

Result: all 5 tests pass.

Checklist

  • My code follows the code style of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.

@Sneha-Anand1910

Copy link
Copy Markdown
Author

Hi @utksh1 , I've addressed the requested changes and pushed the latest updates. Please let me know if there's anything else I should modify. Thank you!

@utksh1 utksh1 added area:backend Backend API, database, or service work level:beginner 20 pts difficulty label for small beginner-friendly PRs type:testing Testing work category bonus label labels Aug 4, 2026

@utksh1 utksh1 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Reviewed the focused test change and its current checks are green. The PR still needs a current branch update before merge because it is behind main; I will not bypass the branch policy.

@Sneha-Anand1910

Copy link
Copy Markdown
Author

Hi @utksh1, thanks for the approval! Branch is updated with main. This PR only adds a Python test and touches no frontend code, so the failing frontend checks look unrelated (likely pre-existing). I can't re-run from my fork , could you re-run them when you get a chance?

@utksh1
utksh1 force-pushed the sneha/validate-doc-links-2186 branch from 39b8f78 to 3b30a95 Compare August 5, 2026 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:backend Backend API, database, or service work level:beginner 20 pts difficulty label for small beginner-friendly PRs type:testing Testing work category bonus label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(ci): cover relative and anchor failures in documentation link validation

2 participants