Skip to content

[Doc] Align environment variable docs with runtime envs#342

Open
Lidang-Jiang wants to merge 1 commit into
baidu:mainfrom
Lidang-Jiang:fix/env-vars-doc-tests
Open

[Doc] Align environment variable docs with runtime envs#342
Lidang-Jiang wants to merge 1 commit into
baidu:mainfrom
Lidang-Jiang:fix/env-vars-doc-tests

Conversation

@Lidang-Jiang
Copy link
Copy Markdown
Contributor

Summary

  • Document every environment variable exposed by vllm_kunlun.platforms.envs
  • Remove the stale FUSED_QK_ROPE_OP entry, which is not parsed by the runtime env module
  • Add focused unit tests for env parsing and doc/runtime consistency
Before

Command run on origin/main with the new regression test copied into a temporary worktree:

PYTHONWARNINGS=ignore PYTHONPATH=$PWD pytest -q tests/ut/test_platform_envs.py
........................................................................ [ 94%]
...F                                                                     [100%]
=================================== FAILURES ===================================
_______________ test_documented_env_vars_match_runtime_env_vars ________________

    def test_documented_env_vars_match_runtime_env_vars():
        doc_path = (
            Path(__file__).resolve().parents[2]
            / "docs/source/user_guide/configuration/env_vars.md"
        )
        doc = doc_path.read_text()
    
        for name in envs.__dir__():
>           assert f"`{name}`" in doc
E           AssertionError: assert '`VLLM_MULTI_LOGPATH`' in '# Environment Variables\n\nvllm-kunlun uses the following environment variables to configure the system:\n\n| *Enviro...oPE implementation\\****. Default is `0` (use original/standard RoPE). Setting to `1` may be used to enable QWEN3. |\n'

tests/ut/test_platform_envs.py:79: AssertionError
=========================== short test summary info ============================
FAILED tests/ut/test_platform_envs.py::test_documented_env_vars_match_runtime_env_vars
1 failed, 75 passed in 1.74s
After
PYTHONWARNINGS=ignore PYTHONPATH=$PWD pytest -q tests/ut/test_platform_envs.py
........................................................................ [ 94%]
....                                                                     [100%]
76 passed in 1.73s
ruff check tests/ut/test_platform_envs.py
All checks passed!
PYTHONWARNINGS=ignore black --target-version py310 --check tests/ut/test_platform_envs.py
All done! ✨ 🍰 ✨
1 file would be left unchanged.
git diff --check
(no output; exit code 0)
PYTHONWARNINGS=ignore pre-commit run --files docs/source/user_guide/configuration/env_vars.md tests/ut/test_platform_envs.py
fix end of files.........................................................Passed
trim trailing whitespace.................................................Passed
check yaml...........................................(no files to check)Skipped
check toml...........................................(no files to check)Skipped
check for added large files..............................................Passed
ruff check...............................................................Passed
isort....................................................................Passed
black....................................................................Passed
PyMarkdown...............................................................Passed
Lint GitHub Actions workflow files...................(no files to check)Skipped
Check for spaces in all filenames........................................Passed
Suggestion...............................................................Passed
- hook id: suggestion
- duration: 0s

To bypass pre-commit hooks, add --no-verify to git commit.

Test plan

  • PYTHONWARNINGS=ignore PYTHONPATH=$PWD pytest -q tests/ut/test_platform_envs.py
  • ruff check tests/ut/test_platform_envs.py
  • PYTHONWARNINGS=ignore black --target-version py310 --check tests/ut/test_platform_envs.py
  • git diff --check
  • PYTHONWARNINGS=ignore pre-commit run --files docs/source/user_guide/configuration/env_vars.md tests/ut/test_platform_envs.py

Signed-off-by: Lidang Jiang <lidangjiang@gmail.com>
@Lidang-Jiang Lidang-Jiang force-pushed the fix/env-vars-doc-tests branch from 4e5be44 to c8bc0de Compare April 28, 2026 03:16
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.

1 participant