Skip to content

test: snp server integration tests #84

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jun 3, 2025

Conversation

zone117x
Copy link
Member

Implement integration test for ingesting msgs from the SNP server.

This jest startup script now orchestrates a spin up of the SNP server via the hirosystems/salt-n-pepper docker container, along with it's dependencies (redis, pg).

In ingestion.test.ts, a dump of events captured from a stacks-node is POSTed to the SNP server (simulating a real stacks-node), and then the signer-metrics-api msg ingestion is started and tested to ensure events are consumed correctly and fully.

Copy link

github-actions bot commented May 26, 2025

Vercel deployment URL: https://signer-metrics-9s833culc-hirosystems.vercel.app 🚀

@@ -21,6 +21,7 @@
"migrate": "ts-node node_modules/.bin/node-pg-migrate -j ts",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"vendor-secp256k1": "mkdir -p src/vendored/@noble/secp256k1 && cp node_modules/@noble/secp256k1/index.ts src/vendored/@noble/secp256k1/index.ts",
Copy link
Member Author

Choose a reason for hiding this comment

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

This library is esm-only, which jest is unable to handle. Luckily we can simply copy the single ts source file of this library into our repo and it is compiled to cjs. This a hacky workaround, and the approach is unlikely to work with most other other esm-only dependencies. The long term solution is to move away from jest.

Copy link

codecov bot commented Jun 2, 2025

Codecov Report

Attention: Patch coverage is 41.22966% with 325 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/vendored/@noble/secp256k1/index.ts 39.81% 319 Missing ⚠️
src/event-stream/threaded-parser.ts 53.84% 6 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Collaborator

@rafaelcr rafaelcr left a comment

Choose a reason for hiding this comment

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

LFG

@zone117x zone117x merged commit 4453e1d into main Jun 3, 2025
5 checks passed
@zone117x zone117x deleted the test/snp-server-integration-tests branch June 3, 2025 02:19
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