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

testing processor #776

Draft
wants to merge 1 commit into
base: 01-17-generating_test_transactions_with_move_script
Choose a base branch
from

Conversation

yuunlimm
Copy link
Contributor

Description

Checklist

  • If any existing pages were renamed or removed:
    • Were redirects added to next.config.mjs?
    • Did you update any relative links that pointed to the renamed / removed pages?
  • Do all Lints pass?
    • Have you ran pnpm fmt?
    • Have you ran pnpm lint?

Copy link

vercel bot commented Jan 17, 2025

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

Name Status Preview Comments Updated (UTC)
developer-docs-nextra ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 24, 2025 7:41pm

@yuunlimm yuunlimm mentioned this pull request Jan 17, 2025
2 tasks
Copy link
Contributor Author

yuunlimm commented Jan 17, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@yuunlimm yuunlimm mentioned this pull request Jan 17, 2025
4 tasks
@yuunlimm yuunlimm force-pushed the 01-17-generating_test_transactions_with_move_script branch from 337099f to 41c221f Compare January 23, 2025 18:16
@yuunlimm yuunlimm force-pushed the 01-17-testing_processor branch from 3272d23 to 3661226 Compare January 23, 2025 18:16
@yuunlimm yuunlimm force-pushed the 01-17-generating_test_transactions_with_move_script branch from 41c221f to f4a5496 Compare January 23, 2025 18:22
@yuunlimm yuunlimm force-pushed the 01-17-testing_processor branch from 3661226 to 3614d53 Compare January 23, 2025 18:22
@yuunlimm yuunlimm force-pushed the 01-17-generating_test_transactions_with_move_script branch from f4a5496 to 7c9ef01 Compare January 23, 2025 18:26
@yuunlimm yuunlimm force-pushed the 01-17-testing_processor branch from 3614d53 to a7aca8f Compare January 23, 2025 18:26
@yuunlimm yuunlimm force-pushed the 01-17-generating_test_transactions_with_move_script branch from 7c9ef01 to 443f3c1 Compare January 23, 2025 18:27
@yuunlimm yuunlimm force-pushed the 01-17-testing_processor branch from a7aca8f to b77f255 Compare January 23, 2025 18:28
@yuunlimm yuunlimm force-pushed the 01-17-generating_test_transactions_with_move_script branch from 443f3c1 to 719d843 Compare January 23, 2025 18:30
@yuunlimm yuunlimm force-pushed the 01-17-testing_processor branch from b77f255 to e27f3c8 Compare January 23, 2025 18:30
@yuunlimm yuunlimm force-pushed the 01-17-generating_test_transactions_with_move_script branch from 719d843 to fc57bc1 Compare January 23, 2025 18:34
@yuunlimm yuunlimm force-pushed the 01-17-testing_processor branch from e27f3c8 to f9f765c Compare January 23, 2025 18:34
@yuunlimm yuunlimm force-pushed the 01-17-generating_test_transactions_with_move_script branch from fc57bc1 to ee03a7e Compare January 23, 2025 19:47
@yuunlimm yuunlimm force-pushed the 01-17-testing_processor branch from f9f765c to a287733 Compare January 23, 2025 19:47
@yuunlimm yuunlimm force-pushed the 01-17-generating_test_transactions_with_move_script branch from ee03a7e to 8736bb3 Compare January 23, 2025 21:17
@yuunlimm yuunlimm force-pushed the 01-17-testing_processor branch from a287733 to 9992188 Compare January 23, 2025 21:17
@yuunlimm yuunlimm force-pushed the 01-17-generating_test_transactions_with_move_script branch from 8736bb3 to 260f684 Compare January 23, 2025 21:38
@yuunlimm yuunlimm force-pushed the 01-17-testing_processor branch from 9992188 to 00949b3 Compare January 23, 2025 21:39
@yuunlimm yuunlimm force-pushed the 01-17-testing_processor branch from 00949b3 to dfafeec Compare January 24, 2025 01:04

### General Flow of how Processor Testing Works

1. Prepare testing transactions (refer to prior documentations).
Copy link
Contributor

Choose a reason for hiding this comment

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

let's add links to the previous documentations

3. Import new transactions.
4. Write test cases.
5. Generate expected database output and validate.
6. Merge.
Copy link
Contributor

Choose a reason for hiding this comment

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

Merge... what? be specific

## Prerequisites
<Callout>
Key Considerations:
- Each test runs in an isolated environment using a PostgreSQL container to prevent interference.
Copy link
Contributor

Choose a reason for hiding this comment

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

Might also want to callout in the beginning that this tutorial assumes you're using Postgres



1. Ensure Docker is running for PostgreSQL container support.
- Set up docker engine/daemon on your machine
Copy link
Contributor

Choose a reason for hiding this comment

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

add link on where to download / install

- Set up docker engine/daemon on your machine
- Start Docker if it's not running
2. Identify the transactions to test.
- Use imported transactions or write your own custom Move scripts to generate test transactions. Refer to Importing Transaction Guide and Generating Transaction using Move Script Guide for detailed instructions.
Copy link
Contributor

Choose a reason for hiding this comment

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

link out to those pages

```

Arguments:
generate-output: A custom flag to indicate that expected outputs should be generated.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
generate-output: A custom flag to indicate that expected outputs should be generated.
generate-output: Set this true if you want to generate or overwrite saved database output, or false if you want to compare database outputs in diff mode.


Arguments:
generate-output: A custom flag to indicate that expected outputs should be generated.
output-path: it's an optional argument to specify the output path for the db output.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
output-path: it's an optional argument to specify the output path for the db output.
output-path: An optional argument to specify a custom output path for the db output.


### What Types of Tests Does It Support?

- Database schema output diff.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- Database schema output diff.
- The testing framework allows you to write tests that compare the database outputs of processors. It helps you catch changes in database output when you're updating or developing your processor.

- **Adapting to Other Databases**:
- Replace PostgreSQL-specific code with relevant database code you intend to use (e.g., MySQL).
- Update schema initialization and query methods.
- **Docker Installation**: Follow the [Docker setup guide](https://docs.docker.com/get-docker/).
Copy link
Contributor

Choose a reason for hiding this comment

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

we should move this higher in a pre-reqs section so it's more visible

- Replace PostgreSQL-specific code with relevant database code you intend to use (e.g., MySQL).
- Update schema initialization and query methods.
- **Docker Installation**: Follow the [Docker setup guide](https://docs.docker.com/get-docker/).
- **Referencing Existing Tests**:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- **Referencing Existing Tests**:
- **References to Processor Tests**:

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.

2 participants