Skip to content

test: Add comprehensive Elyan Bus integration test suite#53

Open
Kacent123 wants to merge 1 commit intoScottcjn:mainfrom
Kacent123:issue-3-dpo-contrastive-pair-generator
Open

test: Add comprehensive Elyan Bus integration test suite#53
Kacent123 wants to merge 1 commit intoScottcjn:mainfrom
Kacent123:issue-3-dpo-contrastive-pair-generator

Conversation

@Kacent123
Copy link

Implements #5 - Integration tests for Elyan Bus

Features:

  • Mock mode: All tests pass without network access using responses library
  • Live mode: Triggered via 'pytest -m integration' marker
  • 46 mock tests covering all major functionality
  • 6 live integration tests for real network testing

Test Coverage:

  • Wallet creation and balance queries (RustChain)
  • Beacon registration with capabilities
  • Gas deposit flow and balance checks
  • Job posting and claiming (RIP-302 economy)
  • Agent-to-agent messaging via Beacon relay
  • Heartbeat and deregistration
  • Full agent lifecycle (onboard/retire)
  • Error handling (timeout, 500, invalid auth)
  • Sanctuary fees payment
  • Admin key authentication

CI-compatible: Mock tests run in GitHub Actions without network access

Implements Scottcjn#5 - Integration tests for Elyan Bus

Features:
- Mock mode: All tests pass without network access using responses library
- Live mode: Triggered via 'pytest -m integration' marker
- 46 mock tests covering all major functionality
- 6 live integration tests for real network testing

Test Coverage:
- Wallet creation and balance queries (RustChain)
- Beacon registration with capabilities
- Gas deposit flow and balance checks
- Job posting and claiming (RIP-302 economy)
- Agent-to-agent messaging via Beacon relay
- Heartbeat and deregistration
- Full agent lifecycle (onboard/retire)
- Error handling (timeout, 500, invalid auth)
- Sanctuary fees payment
- Admin key authentication

CI-compatible: Mock tests run in GitHub Actions without network access

Co-authored-by: Kacent <kacent@example.com>
@Scottcjn
Copy link
Owner

Good integration tests! This PR has merge conflicts after recent merges. Please rebase on main and resolve conflicts, then we can merge and pay out 25 RTC for bounty #5.

Also please provide your RTC wallet address for payment.

@Scottcjn
Copy link
Owner

Thanks for the comprehensive test suite! We are merging #110 (ApextheBoss) which covers similar ground for the ElyanBus tests bounty. Your conftest.py pattern is cleaner though.

Would you be interested in rebasing after #110 merges and contributing any tests that #110 does not cover? Your MockResponses helper class and some of the error handling tests could complement #110 nicely.

@Scottcjn
Copy link
Owner

Hey @Kacent123 — this has merge conflicts after #110 was merged. Could you rebase against main? Your conftest.py pattern and error handling tests are valuable and could complement the existing test suite.

Please rebase within a few days or we will close this PR.

@Scottcjn
Copy link
Owner

Friendly reminder: we have a Star Bounty program! Star 10+ Scottcjn repos and earn 1 RTC per star. Follow @Scottcjn for 1 RTC too. It helps with visibility and takes 30 seconds. Comment when done!

@Scottcjn
Copy link
Owner

New Star & Follow Bounty is live: Scottcjn/rustchain-bounties#2103 — earn 1 RTC per star, includes curl commands for AI agents!

@Scottcjn
Copy link
Owner

This has merge conflicts — could you rebase on main? The work looks solid and we want to merge it. Thanks!

@Scottcjn
Copy link
Owner

Great test suite @Kacent123 -- 1086 lines of ElyanBus integration tests with proper mock/live dual-mode, comprehensive coverage of wallet, beacon, gas, jobs, messaging, and lifecycle flows. The conftest.py fixtures are well-structured.

However, this PR has merge conflicts (mergeable_state: dirty) and cannot be merged as-is. Could you please rebase against main and resolve the conflicts? Once clean, this is ready to merge.

Bounty will be confirmed on merge.

Copy link
Owner

@Scottcjn Scottcjn left a comment

Choose a reason for hiding this comment

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

Solid test suite. 69 test methods across 15 test classes covering the full Elyan Bus API surface:

  • Wallet creation, balance queries, idempotency
  • Beacon registration, heartbeat, deregistration
  • Gas deposits and balance tracking
  • Job posting and claiming (RIP-302)
  • Relay messaging, grazer binding, content discovery
  • Sanctuary and graduation fees
  • Agent lifecycle (full flow test)
  • Edge cases: network errors, unknown agents, cached balances

Clean mock/live separation with responses library. Live tests properly gated behind -m integration marker. pytest config additions to pyproject.toml are correct.

Good work @Kacent123.

@Scottcjn
Copy link
Owner

Approved — great test suite. 69 test methods, clean mock/live separation, proper pytest config.

One thing needed before merge: rebase required against main. There are merge conflicts (likely in pyproject.toml).

git fetch upstream main
git rebase upstream/main
# resolve any conflicts in pyproject.toml
git push --force-with-lease

Once rebased we'll merge immediately. What wallet should we send payment to?

Copy link

@arifinizra93-bit arifinizra93-bit left a comment

Choose a reason for hiding this comment

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

Great test coverage! The Elyan Bus integration looks well tested. Consider adding edge case tests.

@Scottcjn
Copy link
Owner

Excellent work @Kacent123 — this is one of the best test PRs we've received. 🔥

Review summary:

  • 46 mock tests with proper responses library mocking — CI-safe, no network needed
  • 6 live integration tests gated behind @pytest.mark.integration marker
  • ✅ Proper fixtures (conftest.py with mock/live separation)
  • ✅ Tests cover the full surface: wallets, beacon, gas, jobs, messaging, heartbeat, lifecycle
  • ✅ Error handling tests (500s, 401s, connection errors) — these are the tests most people skip
  • ✅ Admin key header verification with callback capture
  • ✅ Clean pyproject.toml additions (responses dep, pytest config, markers)

One issue: Merge conflicts — please rebase onto main. Once rebased, this is a straight merge.

This is worth a bounty — will confirm RTC on merge. Great contribution.

@Scottcjn
Copy link
Owner

Solid Elyan Bus integration test suite with dual-mode fixtures. This has merge conflicts — could you rebase onto main? Will merge once clean.

@Scottcjn
Copy link
Owner

Hey @Kacent123 — the test suite looks excellent (conftest with proper fixtures, responses lib for HTTP mocking, mock vs live mode separation). But there are merge conflicts preventing merge. Could you rebase against main and push? Will merge right after.

The architecture is exactly right — mocked HTTP by default, real network tests gated behind @pytest.mark.integration.

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.

3 participants