test: make issue 2310 validation paths portable#5585
Conversation
|
Welcome to RustChain! Thanks for your first pull request. Before we review, please make sure:
Bounty tiers: Micro (1-10 RTC) | Standard (20-50) | Major (75-100) | Critical (100-150) A maintainer will review your PR soon. Thanks for contributing! |
ZacharyZhang-NY
left a comment
There was a problem hiding this comment.
Approved review for PR #5585 at head f01e561.
The change keeps the issue-2310 validation coverage intact while replacing Windows-only path strings with Path-built absolute paths. That makes both the package import probe and validator subprocess portable across Windows and Linux runners.
Validation run:
python3 -B -m pytest -q tests/test_issue2310_package_validation.py --tb=short-> 2 passedpython3 -B -m py_compile tests/test_issue2310_package_validation.py-> passedgit diff --check origin/main...HEAD -- tests/test_issue2310_package_validation.py-> passedpython3 tools/bcos_spdx_check.py --base-ref origin/main-> BCOS SPDX check: OK
I did not find a blocking issue in this focused test portability fix.
TJCurnutte
left a comment
There was a problem hiding this comment.
Reviewed the portability change and the focused validation passes for me.
What I checked:
git diff --check origin/main...HEAD -- tests/test_issue2310_package_validation.py
PYTHONPATH=. python3 -B -m py_compile tests/test_issue2310_package_validation.py bounties/issue-2310/validate_bounty_2310.py bounties/issue-2310/src/__init__.py
PYTHONPATH=. python3 -B -m pytest -q -o addopts='' tests/test_issue2310_package_validation.pyResults:
git diff --checkpassed with no whitespace errors.py_compilepassed for the changed test, the validator entrypoint, and the package init.- The focused pytest file passed:
2 passed, 1 warning in 0.23s.
The patch removes the Windows-only bounties\\issue-2310 subprocess path assumptions and derives the issue package root from Path(__file__).resolve().parents[1]. That keeps both the parent-path import test and the cp1252 validator subprocess pointed at the same checked-out package on this runner instead of relying on backslash literals.
Approved.
jaxint
left a comment
There was a problem hiding this comment.
LGTM! Great work on this PR. 🚀
kekehanshujun
left a comment
There was a problem hiding this comment.
I reviewed the path-handling change. Replacing the hard-coded Windows-style relative path with a Path derived from the test file location makes the package import and validation subprocess portable across POSIX and Windows runners while preserving the intended repository-root working directory.
This is narrowly scoped to the issue-2310 validation test and I do not see a blocker.
Summary
Reproduction before fix
Validation
No private tokens, wallet secrets, production services, or payout actions were used.