Skip to content

Install missing CI test dependencies#5587

Closed
minyanyi wants to merge 1 commit into
Scottcjn:mainfrom
minyanyi:codex/python-ci-test-deps
Closed

Install missing CI test dependencies#5587
minyanyi wants to merge 1 commit into
Scottcjn:mainfrom
minyanyi:codex/python-ci-test-deps

Conversation

@minyanyi
Copy link
Copy Markdown
Contributor

Summary

  • add test-only dependencies needed by modules imported during the blocking pytest tests/ collection phase
  • cover agent_economy_sdk, faucet service CORS/YAML imports, and hardware/PSE visualization tests

Why

The blocking CI test job installs tests/requirements.txt, but several collected test modules import packages that were missing from that file. That causes unrelated PRs to fail during collection with ModuleNotFoundError for aiohttp, flask_cors, and matplotlib before their focused tests can run.

Validation

  • python -m pip install -r tests\requirements.txt
  • python -m pytest tests\test_agent_economy_sdk.py tests\test_faucet_service_wallet_validation.py tests\test_hardware_visualizer.py tests\test_pse_analyze_results.py -q -> 14 passed
  • python -m py_compile agent_economy_sdk.py faucet_service\faucet_service.py src\visualizations\visualizer.py benchmarks\pse\analyze_results.py
  • git diff --check

@github-actions github-actions Bot added the tests Test suite changes label 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

@iamdinhthuan iamdinhthuan left a comment

Choose a reason for hiding this comment

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

Reviewed PR #5587 at head 68707e5aba98c9291803412816077768b8865fba.

The patch adds the test-only dependencies that were missing from the blocking pytest tests/ collection environment. That closes the earlier collection barrier: in the current CI log, tests/test_agent_economy_sdk.py, tests/test_faucet_service_wallet_validation.py, tests/test_hardware_visualizer.py, and tests/test_pse_analyze_results.py are collected and their affected tests pass instead of failing with ModuleNotFoundError for aiohttp, flask_cors, or matplotlib.

Local validation in a PR worktree:

python3 -m pip install -r tests/requirements.txt
python3 -B -m pytest -q tests/test_agent_economy_sdk.py tests/test_faucet_service_wallet_validation.py tests/test_hardware_visualizer.py tests/test_pse_analyze_results.py --tb=short
# 14 passed
python3 -B -m py_compile agent_economy_sdk.py faucet_service/faucet_service.py src/visualizations/visualizer.py benchmarks/pse/analyze_results.py
python3 tools/bcos_spdx_check.py --base-ref origin/main
# BCOS SPDX check: OK
git diff --check origin/main...HEAD -- tests/requirements.txt

I also checked the live test job after this PR: it now runs past the prior optional-dependency collection failures. The remaining broad-suite failures are the existing downstream failures in areas such as issue-2310 path portability, Beacon imports, CPU architecture detection, setup miner hashes, and wallet review holds, not the dependency imports this PR changes.

No blocker from me on this focused CI dependency fix.

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 PR #5587 at head 68707e5.

This is a focused CI dependency fix for the pytest tests/ collection environment. The added entries in tests/requirements.txt match the modules imported by the affected test files: aiohttp for agent_economy_sdk, flask-cors and PyYAML for faucet service imports, and matplotlib/seaborn/numpy for hardware and PSE visualization coverage.

Validation run:

  • python3 -m pip install -r tests/requirements.txt -> requirements already satisfied in this environment
  • python3 -B -m pytest -q tests/test_agent_economy_sdk.py tests/test_faucet_service_wallet_validation.py tests/test_hardware_visualizer.py tests/test_pse_analyze_results.py --tb=short -> 14 passed
  • python3 -B -m py_compile agent_economy_sdk.py faucet_service/faucet_service.py src/visualizations/visualizer.py benchmarks/pse/analyze_results.py -> passed
  • git diff --check origin/main...HEAD -- tests/requirements.txt -> passed
  • python3 tools/bcos_spdx_check.py --base-ref origin/main -> BCOS SPDX check: OK

I found no blocker in this scoped test-dependency fix.

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!

@minyanyi
Copy link
Copy Markdown
Contributor Author

CI triage follow-up: this PR does resolve the original collection blocker.

In the current test job, CI installs tests/requirements.txt successfully, including aiohttp, flask-cors, matplotlib, seaborn, and numpy. The previous import errors for tests/test_agent_economy_sdk.py, tests/test_faucet_service_wallet_validation.py, tests/test_hardware_visualizer.py, and tests/test_pse_analyze_results.py no longer occur on this branch.

The remaining red status is from later repo-wide failures that look unrelated to this dependency PR, including:

  • tests/test_cpu_architecture_detection.py expectations for several Intel/AMD architecture mappings
  • tests/test_issue2310_package_validation.py path/import assertions
  • tests/test_setup_miner_downloads.py miner artifact checksum assertion

So #5587 appears to unblock the missing dependency layer, but the broad suite still has separate base-line failures.

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.

Verified the CI dependency addition.

What I checked at head 68707e5aba98c9291803412816077768b8865fba:

  • The diff is scoped to tests/requirements.txt and adds the missing test dependencies, including aiohttp>=3.9.0, flask-cors>=6.0.2, PyYAML>=6.0.3, matplotlib>=3.7, seaborn>=0.12, and numpy>=1.24.
  • git diff --check origin/main...HEAD -- tests/requirements.txt passed.
  • In a fresh Python 3.11.14 venv with the CI-style root requirements plus tests/requirements.txt installed, python -B -m py_compile agent_economy_sdk.py faucet_service/faucet_service.py src/visualizations/visualizer.py benchmarks/pse/analyze_results.py passed.
  • The dependency-sensitive focused tests passed: python -B -m pytest -q -o addopts='' --noconftest tests/test_agent_economy_sdk.py tests/test_faucet_service_wallet_validation.py tests/test_hardware_visualizer.py tests/test_pse_analyze_results.py --tb=short returned 14 passed in 17.44s.
  • python tools/bcos_spdx_check.py --base-ref origin/main returned BCOS SPDX check: OK.

This closes the missing-import/collection gap for those CI test surfaces without changing runtime code. Looks good to merge.

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 dependency-only change. The added test requirements match modules imported by the affected tests (aiohttp, flask-cors, PyYAML, and the plotting stack) and are constrained to tests/requirements.txt, so this should unblock CI without changing runtime application dependencies.

I do not see a blocker in this patch.

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!

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!

@guangningsun
Copy link
Copy Markdown
Contributor

PR Review — PR #5587

Title: Install missing CI test dependencies

Author: minyanyi

What I reviewed

  • tests/requirements.txt

Observations

  1. Adds 9 lines of dependency specifications to tests/requirements.txt that were missing for CI test execution.
  2. The comment indicates these are needed for test_agent_economy_sdk.py which imports from agent_economy modules.
  3. This is a straightforward dependency fix that enables CI to run tests that were previously failing due to missing imports.
  4. No code changes — only dependency additions.

LGTM. Simple, necessary dependency fix. No concerns.

Bounty: #2782
Disclosure: I received RTC compensation for this review.

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
Copy link
Copy Markdown
Owner

Closing as stale branch — would cause destructive deletions if merged.

Your branch was filed roughly 155 commits behind current main. Since then, many overlapping fixes from other contributors have landed via parallel PRs. GitHub's mergeable=clean indicator only catches text-level conflicts — it doesn't detect "this branch is so old that merging would silently delete code that landed after it was filed."

Bounty credit acknowledged

If your fix addressed a real bug, the canonical version has very likely already shipped via a parallel contributor's PR over the past two weeks. Specific cases covered by today's audit:

If you want fresh review

Rebase against current main and verify your diff shows roughly the size of the changes you originally made:

git fetch upstream main
git rebase upstream/main
git diff main..HEAD --shortstat

If the deletion count is significantly higher than what you added, the branch is still picking up stale assumptions — recreate from a fresh main.

Thanks for the contribution work this week.

@Scottcjn Scottcjn closed this May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XS PR: 1-10 lines tests Test suite changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants