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

tests: Update processor tests to use mollusk #16

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

febo
Copy link

@febo febo commented Dec 20, 2024

Problem

PR #14 updated the tests crate to use mollusk, but there are few more tests under the processor module.

Solution

Move the processor tests to the tests crate and update them to use mollusk.

@febo febo force-pushed the febo/processor-tests branch from 3eb2121 to 93e1636 Compare December 20, 2024 23:42
@febo febo force-pushed the febo/processor-tests branch from 2388324 to 5b92af3 Compare December 29, 2024 16:16
Copy link
Contributor

@buffalojoec buffalojoec left a comment

Choose a reason for hiding this comment

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

I think this approach will definitely work for what we're after.

First of all, it's doing the same thing as the existing tests, with the exception of using real syscall stubs, which is the safest way to port everything over. Furthermore, I believe enabling fixture generation from instruction chains will be quite trivial, so this would still allow us to generate loads of fixtures for conformance testing between different versions of token programs.

The only downside here is that we'll end up generating fixtures for every single "setup instruction" as well as the real instructions we are testing. But that isn't really a problem aside from being redundant.

The obvious alternative here is to use a few helpers that can set up mints, accounts, etc. beforehand and just invoke each Mollusk instance one at a time, but that could introduce a bug along the way in the account setup.

I think this works!

program/Cargo.toml Outdated Show resolved Hide resolved
@febo febo force-pushed the febo/processor-tests branch from ad5ab8b to cfe754f Compare January 7, 2025 00:50
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