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

[indexer] Simplify setting up a test indexer writer or reader #19663

Merged
merged 4 commits into from
Oct 4, 2024

Conversation

wlmyng
Copy link
Contributor

@wlmyng wlmyng commented Oct 2, 2024

Description

Currently, tests that require spinning up an indexer do so through start_test_indexer_impl or start_test_indexer. This is further complicated by a single start function that accepts a ReaderWriterConfig. We can simplify this by exposing two functions with optional parameters that can be configured by the caller.

Part of a stack of PRs for watermarks

  1. simplify setting up test indexer: [indexer] Simplify setting up a test indexer writer or reader #19663
  2. update pruner config: [indexer][watermarks][1/n] Modify PruningOptions to point to a toml file of epochs_to_keep and optional per-table overrides #19637
  3. committer writes upper bounds [indexer][watermarks][2/n] committer writes upper bounds to watermarks table #19649
  4. pruner writes lower bounds: [indexer][watermarks][3/n] pruner updates watermarks lower bound #19650
  5. pruner prunes (wip)

Test plan

How did you test the new or updated feature?


Release notes

Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.

For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.

  • Protocol:
  • Nodes (Validators and Full nodes):
  • Indexer:
  • JSON-RPC:
  • GraphQL:
  • CLI:
  • Rust SDK:
  • REST API:

Copy link

vercel bot commented Oct 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sui-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 3, 2024 9:30pm
3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview Oct 3, 2024 9:30pm
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview Oct 3, 2024 9:30pm
sui-typescript-docs ⬜️ Ignored (Inspect) Visit Preview Oct 3, 2024 9:30pm

…iating an indexer writer and reader into separate functions, and use those functions in tests where we previously clobbered everything into a single function.
@wlmyng
Copy link
Contributor Author

wlmyng commented Oct 3, 2024

This PR on its own may not have a great deal of context. While working on #19637, I found it difficult to juggle where exactly I had to update the PruningOptions config, and so in this PR I sought to consolidate the ways we can create a writer and jsonrpc for testing.

Copy link
Contributor

@gegaowp gegaowp left a comment

Choose a reason for hiding this comment

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

good move, thanks!

crates/sui-indexer/src/test_utils.rs Show resolved Hide resolved
@wlmyng wlmyng merged commit be82841 into main Oct 4, 2024
49 checks passed
@wlmyng wlmyng deleted the indexer/cleanup-start-fns branch October 4, 2024 18:21
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