-
Notifications
You must be signed in to change notification settings - Fork 118
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
base: 01-17-generating_test_transactions_with_move_script
Are you sure you want to change the base?
testing processor #776
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
337099f
to
41c221f
Compare
3272d23
to
3661226
Compare
41c221f
to
f4a5496
Compare
3661226
to
3614d53
Compare
f4a5496
to
7c9ef01
Compare
3614d53
to
a7aca8f
Compare
7c9ef01
to
443f3c1
Compare
a7aca8f
to
b77f255
Compare
443f3c1
to
719d843
Compare
b77f255
to
e27f3c8
Compare
719d843
to
fc57bc1
Compare
e27f3c8
to
f9f765c
Compare
fc57bc1
to
ee03a7e
Compare
f9f765c
to
a287733
Compare
ee03a7e
to
8736bb3
Compare
a287733
to
9992188
Compare
8736bb3
to
260f684
Compare
9992188
to
00949b3
Compare
00949b3
to
dfafeec
Compare
dfafeec
to
67a13f5
Compare
|
||
### General Flow of how Processor Testing Works | ||
|
||
1. Prepare testing transactions (refer to prior documentations). |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 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/). |
There was a problem hiding this comment.
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**: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- **Referencing Existing Tests**: | |
- **References to Processor Tests**: |
Description
Checklist
pnpm fmt
?pnpm lint
?