Skip to content

test(hip-3-pusher): add comprehensive unit tests for price state, listeners, and publisher#3422

Open
devin-ai-integration[bot] wants to merge 2 commits intomainfrom
devin/1769706489-hip3-pusher-tests
Open

test(hip-3-pusher): add comprehensive unit tests for price state, listeners, and publisher#3422
devin-ai-integration[bot] wants to merge 2 commits intomainfrom
devin/1769706489-hip3-pusher-tests

Conversation

@devin-ai-integration
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot commented Jan 29, 2026

Summary

Adds comprehensive unit test coverage for the hip-3-pusher application, expanding from 12 tests to 75 tests across three test files.

Changes:

  • Extended test_price_state.py with tests for PriceUpdate, PriceSourceState, ConstantSourceConfig, OracleMidAverageConfig, PairSourceConfig, exponent scaling, session flags, and waterfall fallback behavior
  • Added test_listeners.py with tests for HermesListener, LazerListener, and HyperliquidListener message parsing
  • Added test_publisher.py with tests for construct_mark_pxs() and _get_error_reason() utilities

Rationale

The existing test coverage was limited to basic waterfall scenarios and session EMA behavior. This PR improves coverage of edge cases including malformed messages, missing data sources, stale price handling, and error classification.

How has this been tested?

  • Current tests cover my changes
  • Added new tests
  • Manually tested the code

All 75 tests pass locally with pytest tests/ -v. CI checks pass including ruff format, ruff check, mypy, and pytest.

Updates since last revision

  • Applied ruff format to test_price_state.py to fix CI formatting check failure

Human Review Checklist

  • Verify mock config structures in test_listeners.py match actual config classes (HermesConfig, LazerConfig, HyperliquidConfig)
  • Confirm the noqa: RUF012 comments for mutable class attributes in mock configs are acceptable for test code

Link to Devin run: https://app.devin.ai/sessions/7995cdd3ff1448e3866d32aa5af2d263
Requested by: Mike Rolish (@merolish)

…teners, and publisher

- Extended test_price_state.py with 63 new tests covering:
  - PriceUpdate dataclass (time_diff, session_flag, price types)
  - PriceSourceState class (init, put/get, repr)
  - ConstantSourceConfig handling
  - OracleMidAverageConfig with various scenarios
  - PairSourceConfig edge cases (zero quote, missing sources)
  - Exponent scaling for Lazer/Hermes prices
  - UseSessionFlag behavior
  - External prices, multiple symbols, unknown sources
  - HL mark state handling

- Added test_listeners.py with 17 tests covering:
  - HermesListener message parsing
  - LazerListener message parsing and auth headers
  - HyperliquidListener parsing for asset context and mids

- Added test_publisher.py with 17 tests covering:
  - construct_mark_pxs utility method
  - _get_error_reason error classification
  - PushErrorReason enum validation

Co-Authored-By: Mike Rolish <merolish@mit.edu>
@devin-ai-integration
Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@vercel
Copy link
Copy Markdown

vercel bot commented Jan 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
api-reference Ready Ready Preview, Comment Jan 29, 2026 5:18pm
component-library Ready Ready Preview, Comment Jan 29, 2026 5:18pm
developer-hub Ready Ready Preview, Comment Jan 29, 2026 5:18pm
entropy-explorer Ready Ready Preview, Comment Jan 29, 2026 5:18pm
insights Ready Ready Preview, Comment Jan 29, 2026 5:18pm
proposals Ready Ready Preview, Comment Jan 29, 2026 5:18pm
pyth-app Ready Ready Preview, Comment Jan 29, 2026 5:18pm
staking Ready Ready Preview, Comment Jan 29, 2026 5:18pm

Request Review

Co-Authored-By: Mike Rolish <merolish@mit.edu>
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.

0 participants