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

bug(tests): MadaraBackend::open_for_testing fn unavailable to tests #293

Open
1 task done
Tracked by #413 ...
notlesh opened this issue Oct 1, 2024 · 1 comment · May be fixed by #445
Open
1 task done
Tracked by #413 ...

bug(tests): MadaraBackend::open_for_testing fn unavailable to tests #293

notlesh opened this issue Oct 1, 2024 · 1 comment · May be fixed by #445
Labels
bug Something isn't working

Comments

@notlesh
Copy link
Contributor

notlesh commented Oct 1, 2024

Is there an existing issue?

  • I have searched the existing issues

Description of bug

Running certain tests results in compilation errors similar to:

   Compiling mc-block-import v0.7.0 (/home/stephen/dev/msl/starkware/madara/crates/client/block_import)
error[E0599]: no function or associated item named `open_for_testing` found for struct `mc_db::MadaraBackend` in the current scope
   --> crates/client/block_import/src/verify_apply.rs:343:24
    |
343 |         MadaraBackend::open_for_testing(chain_config.clone())
    |                        ^^^^^^^^^^^^^^^^ function or associated item not found in `MadaraBackend

This is related to the testing feature flag not being passed to the crate. One workaround is to add a testing feature to the given crate such as:

testing = ["mc-db/testing"]

And then run tests with this feature, e.g.:

cargo test -p mc-block-import --features=testing

Steps to reproduce

Run cargo test -p mc-block-import from the project root directory.

Or attempt to run any tests in verify_apply.rs in VSCode.

@notlesh
Copy link
Contributor Author

notlesh commented Oct 1, 2024

#295 seems to fix this, but I have another concern: why don't the mc-block-import tests run with cargo test --all?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

2 participants