Skip to content

Commit e27fddc

Browse files
committed
[nvbugs/6784181][fix] Stop test_relative_path_validity flagging generated docs and installed envs
test_relative_path_validity resolved every relative markdown link against the worktree, which produced two classes of false positive: - Links to Sphinx pages that docs/source/helper.py generates at build time (llm_api_examples, trtllm_serve_examples, visual_gen_examples). These are gitignored, so they can never exist in a source checkout even though docs/source/index.rst references them from a real toctree. Add an explicit allowlist keyed off helper.py's write_index() outputs. - Third-party markdown vendored inside an installed Python environment under the repository root. Pruning only matched directories named .venv/venv, so an environment under any other name was walked and its READMEs validated against this repository. Detect environments by their pyvenv.cfg marker and site-packages layout, and skip .dist-info/.egg-info metadata directories. Genuinely broken relative links are still reported. Removes the waiver for this failure. Signed-off-by: trtllm-agent <296075020+trtllm-agent@users.noreply.github.com>
1 parent 82f9804 commit e27fddc

2 files changed

Lines changed: 23 additions & 1 deletion

File tree

‎tests/integration/defs/test_doc.py‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,16 @@
3838
"ATTRIBUTIONS-CPP-aarch64.md",
3939
}
4040

41+
# Sphinx pages that docs/source/helper.py generates at build time via its
42+
# write_index() calls. They are gitignored (see .gitignore "docs/source/**/*.rst"),
43+
# so a link to one is correct even though it resolves to nothing in a source
44+
# checkout. Paths are repository-relative.
45+
SPHINX_GENERATED_DOC_PAGES = {
46+
"docs/source/examples/llm_api_examples.rst",
47+
"docs/source/examples/trtllm_serve_examples.rst",
48+
"docs/source/examples/visual_gen_examples.rst",
49+
}
50+
4151
# URLs that return 404 at HTTP level but are valid in a browser
4252
# (e.g., GitHub Pages sites using JS redirects)
4353
EXCEPTION_URLS = [
@@ -149,6 +159,13 @@ def _clean_markdown_destination(destination):
149159
def _find_markdown_files(root_dir):
150160
markdown_files = []
151161
for dirpath, dirnames, filenames in os.walk(root_dir):
162+
# Installed Python environments vendor third-party markdown whose relative
163+
# links describe the upstream source tree, not this repository. Detect them
164+
# by layout rather than by name, since SKIP_DIR_PREFIXES misses an
165+
# environment created under an arbitrary name (e.g. a CI scratch dir).
166+
if "pyvenv.cfg" in filenames or "site-packages" in dirnames:
167+
dirnames[:] = []
168+
continue
152169
# Prune in-place so os.walk doesn't descend into skipped dirs.
153170
dirnames[:] = [
154171
d for d in dirnames if d not in SKIP_DIR_NAMES and not d.startswith(SKIP_DIR_PREFIXES)
@@ -223,6 +240,12 @@ def _check_relative_repository_link(url_info, source_file, root_dir):
223240
candidate_paths = [local_path]
224241
if not os.path.splitext(local_path)[1]:
225242
candidate_paths.extend((f"{local_path}.md", f"{local_path}.rst"))
243+
244+
for candidate_path in candidate_paths:
245+
relative_path = os.path.relpath(candidate_path, root_dir)
246+
if relative_path in SPHINX_GENERATED_DOC_PAGES:
247+
return True, url, line_num, f"Sphinx-generated page: {relative_path}"
248+
226249
is_valid = any(os.path.exists(candidate_path) for candidate_path in candidate_paths)
227250
reason = f"Repository path {'exists' if is_valid else 'not found'}: {local_path}"
228251
return is_valid, url, line_num, reason

‎tests/integration/test_lists/waives.txt‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,6 @@ full:RTX_PRO_6000_Blackwell_Server_Edition/accuracy/test_llm_api_pytorch.py::Tes
230230
full:RTX_PRO_6000_Blackwell_Server_Edition/accuracy/test_llm_api_pytorch.py::TestGPTOSS::test_w4_2gpus[dp2-cutlass-auto] SKIP (https://nvbugs/6844164)
231231
full:sm100/unittest/bindings SKIP (Disable for Blackwell)
232232
perf/test_visual_gen_perf_sanity.py::test_visual_gen_e2e[vg_upload-flux2_blackwell-flux2_fp8_cfg1_ulysses4_teacache_on] SKIP (https://nvbugs/6759009)
233-
test_doc.py::test_relative_path_validity SKIP (https://nvbugs/6784181)
234233
test_e2e.py::test_openai_disagg_multi_nodes_completion[ctx_tp1pp2-gen_tp1pp2] SKIP (https://nvbugs/6812588)
235234
test_e2e.py::test_ptp_quickstart_advanced[Nemotron-Nano-9B-v2-nvfp4-NVIDIA-Nemotron-Nano-9B-v2-NVFP4] SKIP (https://nvbugs/6624972)
236235
test_e2e.py::test_ptp_quickstart_bert[TRTLLM-BertForSequenceClassification-bert/bert-base-uncased-yelp-polarity] SKIP (https://nvbugs/6605819)

0 commit comments

Comments
 (0)