Skip to content

test: make issue 2310 validation paths portable#5585

Merged
Scottcjn merged 1 commit into
Scottcjn:mainfrom
iamdinhthuan:fix-issue2310-test-portability
May 18, 2026
Merged

test: make issue 2310 validation paths portable#5585
Scottcjn merged 1 commit into
Scottcjn:mainfrom
iamdinhthuan:fix-issue2310-test-portability

Conversation

@iamdinhthuan
Copy link
Copy Markdown

Summary

  • build issue-2310 validation subprocess paths with pathlib instead of hard-coded Windows separators
  • keep the same CRTPatternGenerator import and validator coverage while making the test pass on Linux CI

Reproduction before fix

python3 -B -m pytest -q tests/test_issue2310_package_validation.py --tb=short
# 2 failed: imported the wrong top-level src package and could not open bounties\issue-2310\validate_bounty_2310.py

Validation

python3 -B -m pytest -q tests/test_issue2310_package_validation.py --tb=short
# 2 passed
python3 -B -m py_compile tests/test_issue2310_package_validation.py
python3 tools/bcos_spdx_check.py --base-ref origin/main
git diff --check origin/main...HEAD -- tests/test_issue2310_package_validation.py

No private tokens, wallet secrets, production services, or payout actions were used.

@github-actions github-actions Bot added BCOS-L1 Beacon Certified Open Source tier BCOS-L1 (required for non-doc PRs) tests Test suite changes labels May 17, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Welcome to RustChain! Thanks for your first pull request.

Before we review, please make sure:

  • Non-doc PRs have a BCOS-L1 or BCOS-L2 label
  • Doc-only PRs are exempt from BCOS tier labels when they only touch docs/**, *.md, or common image/PDF files
  • New code files include an SPDX license header
  • You've tested your changes against the live node

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!

Copy link
Copy Markdown

@ZacharyZhang-NY ZacharyZhang-NY left a comment

Choose a reason for hiding this comment

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

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 passed
  • python3 -B -m py_compile tests/test_issue2310_package_validation.py -> passed
  • git diff --check origin/main...HEAD -- tests/test_issue2310_package_validation.py -> passed
  • python3 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.

Copy link
Copy Markdown
Contributor

@HCIE2054 HCIE2054 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown

@TJCurnutte TJCurnutte left a comment

Choose a reason for hiding this comment

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

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.py

Results:

  • git diff --check passed with no whitespace errors.
  • py_compile passed 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.

Copy link
Copy Markdown
Contributor

@jaxint jaxint left a comment

Choose a reason for hiding this comment

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

LGTM! Great work on this PR. 🚀

Copy link
Copy Markdown
Contributor

@HCIE2054 HCIE2054 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown
Contributor

@HCIE2054 HCIE2054 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown
Contributor

@kekehanshujun kekehanshujun left a comment

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor

@HCIE2054 HCIE2054 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown
Contributor

@HCIE2054 HCIE2054 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown
Contributor

@HCIE2054 HCIE2054 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown
Contributor

@HCIE2054 HCIE2054 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown
Contributor

@HCIE2054 HCIE2054 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown
Contributor

@HCIE2054 HCIE2054 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown
Contributor

@HCIE2054 HCIE2054 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown
Contributor

@HCIE2054 HCIE2054 left a comment

Choose a reason for hiding this comment

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

LGTM!

@Scottcjn Scottcjn merged commit 80b4d21 into Scottcjn:main May 18, 2026
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BCOS-L1 Beacon Certified Open Source tier BCOS-L1 (required for non-doc PRs) size/XS PR: 1-10 lines tests Test suite changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants