Skip to content

[None][test] Add doc test#13152

Merged
StanleySun639 merged 6 commits intoNVIDIA:mainfrom
StanleySun639:add-doc-test
Apr 20, 2026
Merged

[None][test] Add doc test#13152
StanleySun639 merged 6 commits intoNVIDIA:mainfrom
StanleySun639:add-doc-test

Conversation

@StanleySun639
Copy link
Copy Markdown
Collaborator

@StanleySun639 StanleySun639 commented Apr 17, 2026

Summary by CodeRabbit

  • Tests
    • Added integration test that validates all external URLs in Markdown documentation files using concurrent HTTP verification with retry logic and intelligent error categorization for detecting broken links.

Description

Test Coverage

PR Checklist

Please review the following before submitting your PR:

  • PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.

  • PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.

  • Test cases are provided for new code paths (see test instructions)

  • Any new dependencies have been scanned for license and vulnerabilities

  • CODEOWNERS updated if ownership changes

  • Documentation updated as needed

  • Update tava architecture diagram if there is a significant design change in PR.

  • The reviewers assigned automatically/manually are appropriate for the PR.

  • Please check this after reviewing the above items as appropriate for this PR.

GitHub Bot Help

To see a list of available CI bot commands, please comment /bot help.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 17, 2026

📝 Walkthrough

Walkthrough

Added a new integration test module that discovers Markdown files and validates all URLs within them, performing HTTP HEAD/GET checks with retry logic and concurrent execution. Updated test configuration to exclude this new test from a specific test list.

Changes

Cohort / File(s) Summary
Documentation URL validation test
tests/integration/defs/test_doc.py
New integration test module with Markdown file discovery, URL extraction from Markdown links and HTML <a> tags, URL normalization, and concurrent HTTP validation with retry logic. Handles edge cases like localhost, Google Drive, and GitHub internal refs, with categorized error reporting.
Test list configuration
tests/integration/test_lists/test-db/l0_h100.yml
Removed test_doc.py::test_url_validity entry from test list for the l0_h100 stage configuration.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ❌ 3

❌ Failed checks (2 warnings, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 57.14% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The PR description is entirely the unedited template with no actual content provided for required sections (Description, Test Coverage). Please fill in the Description and Test Coverage sections with specific details about the changes, why they were made, and which tests validate them.
Title check ❓ Inconclusive The title '[None][test] Add doc test' is vague and generic, using non-descriptive terms that don't clearly convey the specific change being made. Revise the title to be more specific about what the doc test does, e.g., '[None][test] Add documentation URL validation test' to better describe the actual implementation.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (1)
tests/integration/test_lists/test-db/l0_h100.yml (1)

365-366: Consider moving this CPU-only doc test to a non-GPU lane.

At Line 365-Line 366, the comment says no GPU is needed, but this is in an H100 post-merge suite. Moving it to a CPU-capable stage would reduce GPU queue pressure without changing coverage.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/integration/test_lists/test-db/l0_h100.yml` around lines 365 - 366, The
GPU post-merge test list includes a CPU-only test identifier
test_doc.py::test_url_validity; remove that line from the H100 GPU lane list and
add the same test identifier to the CPU-capable test list (or a non-GPU lane) so
the doc URL validation runs on CPU workers instead of occupying GPU queue;
locate the string "- test_doc.py::test_url_validity" in the H100 test list and
move it to the CPU lane list or equivalent.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@tests/integration/defs/test_doc.py`:
- Around line 16-241: Run the ruff formatter locally and commit the resulting
changes so the file is pre-commit clean; specifically reformat
tests/integration/defs/test_doc.py (where functions like test_url_validity,
_extract_urls, and _check_url are defined) using your project's ruff/pre-commit
configuration (e.g., ruff format or pre-commit run --all-files) and then stage
and push the updated file.
- Around line 191-192: The current broad catch "except Exception as e" around
the URL check hides non-network bugs; replace it with catching only expected
network-related exceptions (for example requests.exceptions.RequestException,
urllib.error.URLError, socket.timeout, and possibly ssl.SSLError) where the code
constructs the return tuple (False, url, line_num, f"Error: {e}"), and remove or
re-raise any other unexpected exceptions so they fail the test (i.e., change the
except block to specific except clauses or a single except
RequestException/URLError that returns the error tuple and let other exceptions
propagate).
- Around line 145-149: The test currently lets non-HTTP(S) schemes like "ftp://"
fall through to HTTP validation; update the URL filtering around the `url`
variable so only "http://" or "https://" URLs are processed — for any URL that
does not start with "http" (and is not normalized from a leading "www."),
skip/continue, i.e., treat "ftp://" and other schemes as non-HTTP and continue;
adjust the existing startswith checks to normalize "www." to "https://" but
otherwise continue for any non-http scheme before running HTTP validation.

---

Nitpick comments:
In `@tests/integration/test_lists/test-db/l0_h100.yml`:
- Around line 365-366: The GPU post-merge test list includes a CPU-only test
identifier test_doc.py::test_url_validity; remove that line from the H100 GPU
lane list and add the same test identifier to the CPU-capable test list (or a
non-GPU lane) so the doc URL validation runs on CPU workers instead of occupying
GPU queue; locate the string "- test_doc.py::test_url_validity" in the H100 test
list and move it to the CPU lane list or equivalent.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 1489ccde-96a2-4dfc-b7f5-3bc61db9a818

📥 Commits

Reviewing files that changed from the base of the PR and between 2a0bcb1 and 6c0704f.

📒 Files selected for processing (2)
  • tests/integration/defs/test_doc.py
  • tests/integration/test_lists/test-db/l0_h100.yml

Comment thread tests/integration/defs/test_doc.py
Comment thread tests/integration/defs/test_doc.py Outdated
Comment thread tests/integration/defs/test_doc.py
@StanleySun639 StanleySun639 requested review from a team and ZhanruiSunCh April 17, 2026 09:58
@StanleySun639 StanleySun639 enabled auto-merge (squash) April 17, 2026 10:10
@StanleySun639
Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator

PR_Github #44023 [ run ] triggered by Bot. Commit: 78c40f7 Link to invocation

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator

PR_Github #44023 [ run ] completed with state SUCCESS. Commit: 78c40f7
/LLM/main/L0_MergeRequest_PR pipeline #34462 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

Link to invocation

@StanleySun639
Copy link
Copy Markdown
Collaborator Author

/bot run --skip-test

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator

PR_Github #44248 [ run ] triggered by Bot. Commit: 785e043 Link to invocation

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator

PR_Github #44248 [ run ] completed with state FAILURE. Commit: 785e043
/LLM/main/L0_MergeRequest_PR pipeline #34669 (Partly Tested) completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

Link to invocation

@StanleySun639
Copy link
Copy Markdown
Collaborator Author

/bot run --skip-test

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator

PR_Github #44296 [ run ] triggered by Bot. Commit: 9470395 Link to invocation

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator

PR_Github #44296 [ run ] completed with state FAILURE. Commit: 9470395
/LLM/main/L0_MergeRequest_PR pipeline #34717 (Partly Tested) completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

Link to invocation

@StanleySun639
Copy link
Copy Markdown
Collaborator Author

@StanleySun639
Copy link
Copy Markdown
Collaborator Author

doc fix in main: #13038

Signed-off-by: Stanley Sun <stsun@nvidia.com>
Signed-off-by: Stanley Sun <stsun@nvidia.com>
Signed-off-by: Stanley Sun <stsun@nvidia.com>
Signed-off-by: Stanley Sun <stsun@nvidia.com>
Signed-off-by: Stanley Sun <stsun@nvidia.com>
Signed-off-by: Stanley Sun <stsun@nvidia.com>
@StanleySun639
Copy link
Copy Markdown
Collaborator Author

/bot run --stage-list ""

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator

PR_Github #44356 [ run ] triggered by Bot. Commit: 6cb4d95 Link to invocation

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator

PR_Github #44356 [ run ] completed with state FAILURE. Commit: 6cb4d95
/LLM/main/L0_MergeRequest_PR pipeline #34772 (Partly Tested) completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

Link to invocation

@StanleySun639
Copy link
Copy Markdown
Collaborator Author

/bot run --stage-list ""

1 similar comment
@StanleySun639
Copy link
Copy Markdown
Collaborator Author

/bot run --stage-list ""

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator

PR_Github #44411 [ run ] triggered by Bot. Commit: 6cb4d95 Link to invocation

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator

PR_Github #44412 [ run ] triggered by Bot. Commit: 6cb4d95 Link to invocation

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator

PR_Github #44411 [ run ] completed with state ABORTED. Commit: 6cb4d95

Link to invocation

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator

PR_Github #44412 [ run ] completed with state SUCCESS. Commit: 6cb4d95
/LLM/main/L0_MergeRequest_PR pipeline #34825 (Partly Tested) completed with status: 'SUCCESS'

CI Report

Link to invocation

@StanleySun639
Copy link
Copy Markdown
Collaborator Author

/bot reuse-pipeline

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator

PR_Github #44432 [ reuse-pipeline ] triggered by Bot. Commit: 6cb4d95 Link to invocation

@tensorrt-cicd
Copy link
Copy Markdown
Collaborator

PR_Github #44432 [ reuse-pipeline ] completed with state SUCCESS. Commit: 6cb4d95
Reusing PR_Github #44412 (Partly Tested) for commit 6cb4d95

Link to invocation

@StanleySun639 StanleySun639 merged commit bae6e6d into NVIDIA:main Apr 20, 2026
5 checks passed
@StanleySun639 StanleySun639 deleted the add-doc-test branch April 20, 2026 09:59
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