Skip to content
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

Add Sdk tests #554

Merged
merged 1 commit into from
Oct 18, 2024
Merged

Add Sdk tests #554

merged 1 commit into from
Oct 18, 2024

Conversation

yuunlimm
Copy link
Contributor

@yuunlimm yuunlimm commented Oct 16, 2024

Copy link
Contributor Author

yuunlimm commented Oct 16, 2024

rust/integration-tests/src/sdk_tests/temp.rs Outdated Show resolved Hide resolved
.unwrap_or_else(|| DEFAULT_OUTPUT_FOLDER.to_string() + "imported_testnet_txns");

// Step 1: set up an input transaction that will be used
let transaction_batches = ALL_IMPORTED_TESTNET_TXNS
Copy link
Collaborator

Choose a reason for hiding this comment

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

Instead of running the events processor test on every imported transaction, would it be better to let the user decide?

I liked the devex we had before where for each cargo test, you defined which transactions you want to use. Running each processor test on all imported transactions would create a bunch of empty files / no-ops and aren't super useful.

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 what's the reason to run ALL_IMPORTED_TESTNET_TXNS? Can this just be EVENTS_PROCESSOR_IMPORTED_TESTNET_TXNS?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

they are the next milestones, that test case is there to make sure that we can process them without any issues.
more test cases with purpose and context could be added as a part of the next milestone: 90% coverage

Copy link
Collaborator

Choose a reason for hiding this comment

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

Testing each processor with ALL_IMPORTED_TESTNET_TXNS can get us to a high % test coverage goal for sure, but you lose the context associated with the transaction and the test, and I'm not sure how debuggable these are.

I think we should be importing transactions and testing intentionally as part of first milestone. The bulk of the work is just identifying which transactions to use, right? Since we have this framework now it should be really easy to add tests.

Copy link
Contributor

@dermanyang dermanyang Oct 17, 2024

Choose a reason for hiding this comment

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

that test case is there to make sure that we can process them without any issues.

Can we instead then do [EVENTS_PROCESSOR_IMPORTED_TESTNET_TXNS + IRRELEVANT_TXN] with a comment so that this intent is clear?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you are absolutely right, most of the effort now lies in identifying which transactions to use for testing specific scenarios. and using ALL_IMPORTED_TESTNET_TXNS can certainly help us reach the initial test coverage milestone faster. It’s a valuable proof of concept that shows our system is correctly indexing large sets of real-world data, even if it lacks the intentionality and debuggability of more focused tests.

here’s how I think we can position this:

  1. ALL_IMPORTED_TESTNET_TXNS as a Milestone:
  • It serves as a strong baseline, proving that we can handle and index transactions correctly. Even though it doesn't focus on specific scenarios, it's a great starting point when we didn’t have any coverage.
  • By running all imported transactions, we can show that our system processes real-world data as expected. This is useful as an overall system health check.
  1. Next Milestones with More Intentional Tests:
  • Once we have the initial proof of correct indexing, the next milestone can focus on intentional testing, which will bring in more context and debugability.
  • We can target specific edge cases, error conditions, and SEVs that have been critical in the past, aligning this with the goal of reaching 90% coverage.

This gives us a strong base with test coverage and indexing proof, while also allowing room to refine and add higher-quality tests in the next phases. Would this align with your thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

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

@yuunlimm I hear ya here . Let's leave a TODO for the next milestone so we don't forget to update this later?

@yuunlimm yuunlimm force-pushed the 10-16-update_existing_processor_tests_with_the_latest_dependency_change branch from 62c78b1 to b95f3da Compare October 17, 2024 21:13
@yuunlimm yuunlimm force-pushed the 10-16-add_sdk_tests branch 2 times, most recently from 006e9aa to 7fa5c46 Compare October 17, 2024 21:17
Copy link
Collaborator

@rtso rtso left a comment

Choose a reason for hiding this comment

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

Stamping to unblock, let's add the todo that @dermanyang suggested!

rust/integration-tests/src/sdk_tests/test_cli_flag_util.rs Outdated Show resolved Hide resolved
Base automatically changed from 10-16-update_existing_processor_tests_with_the_latest_dependency_change to main October 18, 2024 04:56
@yuunlimm yuunlimm force-pushed the 10-16-add_sdk_tests branch from 7fa5c46 to 7648c32 Compare October 18, 2024 05:16
@yuunlimm yuunlimm merged commit b4e8468 into main Oct 18, 2024
6 of 7 checks passed
@yuunlimm yuunlimm deleted the 10-16-add_sdk_tests branch October 18, 2024 05:42
yuunlimm added a commit that referenced this pull request Oct 18, 2024
yuunlimm added a commit that referenced this pull request Oct 19, 2024
* Add Sdk tests (#554)

* support multi txns testing

* rebase and update dependency
yuunlimm added a commit that referenced this pull request Oct 21, 2024
yuunlimm added a commit that referenced this pull request Oct 23, 2024
* Add Sdk tests (#554)

* update manipulated version

* split tests

* update tests
@yuunlimm yuunlimm mentioned this pull request Oct 24, 2024
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