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

Remove test-clarity-vN features #551

Open
ureeves opened this issue Nov 11, 2024 · 0 comments
Open

Remove test-clarity-vN features #551

ureeves opened this issue Nov 11, 2024 · 0 comments
Labels
code quality Improving the quality of the code, and dev experience testing

Comments

@ureeves
Copy link
Collaborator

ureeves commented Nov 11, 2024

Since the clarity version and epoch can be selected at runtime in using the TestEnvironment struct, the test-clarity-vN features requiring us to build the tests three different times (once for each clarity version) are unnecessary and should be replaced by better infrastructure.

One alternative is to introduce a procedural macro that takes in a test function and a version selection. The macro would generate code instantiating a TestEnvironment using the selected version and injecting it into the function provided:

#[test_with_env(v1, v2)]
fn the_test(env: TestEnvironment) {
    // test code
}

// expands into...

#[test]
fn the_test_v1() {
    let env = TestEnvironment::new(/*version 1 and epoch*/)
    // test code
}

#[test]
fn the_test_v2() {
    let env = TestEnvironment::new(/*version 2 and epoch*/)
    // test code
}
@github-project-automation github-project-automation bot moved this to Status: 🆕 New in Stacks Core Eng Nov 11, 2024
@ureeves ureeves added the code quality Improving the quality of the code, and dev experience label Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code quality Improving the quality of the code, and dev experience testing
Projects
Status: Status: 🆕 New
Development

No branches or pull requests

1 participant