Skip to content

add unit tests for build scripts#1642

Open
tejas0077 wants to merge 2 commits intomicrosoft:mainfrom
tejas0077:maint/build-script-tests-clean
Open

add unit tests for build scripts#1642
tejas0077 wants to merge 2 commits intomicrosoft:mainfrom
tejas0077:maint/build-script-tests-clean

Conversation

@tejas0077
Copy link
Copy Markdown
Contributor

Closes #1570

Adds unit tests for 4 build scripts as requested by @romanlutz in #1569.

  • test_prepare_package.py — 9 tests covering npm lookup, install/build failures, and frontend copy logic
  • test_validate_docs.py — 14 tests covering TOC parsing, missing file detection, and orphaned file checks
  • test_generate_rss.py — 10 tests covering date extraction and blog markdown parsing
  • test_check_links.py — 13 tests covering URL extraction, fragment stripping, and relative URL resolution

Added 46 unit tests across 4 new test files.
All 65 tests in tests/unit/build_scripts/ pass locally:

python -m pytest tests/unit/build_scripts/ -v

65 passed

No documentation changes required.
No JupyText changes required.

Copy link
Copy Markdown
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 unit tests under tests/unit/build_scripts/ to cover several Python build/validation scripts, improving reliability across platforms and catching regressions in packaging/docs/link-check tooling.

Changes:

  • Added unit tests for validate_docs TOC parsing / missing-file validation / orphan detection.
  • Added unit tests for prepare_package frontend build and packaging copy behavior.
  • Added unit tests for generate_rss date extraction and blog markdown parsing, plus check_links URL extraction and resolution helpers.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 8 comments.

File Description
tests/unit/build_scripts/test_prepare_package.py Tests frontend build failure/success paths and frontend dist copy behavior.
tests/unit/build_scripts/test_validate_docs.py Tests TOC parsing, referenced-file validation, and orphaned doc detection.
tests/unit/build_scripts/test_generate_rss.py Tests filename date parsing and blog markdown parsing helpers.
tests/unit/build_scripts/test_check_links.py Tests URL extraction, fragment stripping, and relative URL resolution.

Comment thread tests/unit/build_scripts/test_prepare_package.py
Comment thread tests/unit/build_scripts/test_prepare_package.py Outdated
Comment thread tests/unit/build_scripts/test_prepare_package.py Outdated
Comment thread tests/unit/build_scripts/test_validate_docs.py
Comment thread tests/unit/build_scripts/test_check_links.py
Comment thread tests/unit/build_scripts/test_generate_rss.py Outdated
Comment thread tests/unit/build_scripts/test_generate_rss.py Outdated
Comment thread tests/unit/build_scripts/test_prepare_package.py Outdated
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.

MAINT add tests for build scripts

3 participants