-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Crate not found in integration tests if crate-type = ["cdylib"]
#6659
Comments
This repository contains all information needed to duplicate the bug report for cargo (issue at rust-lang/cargo#6659).
You can add BTW, there's a typo in your example, |
Ah, sorry, since there is a chicken & egg problem between creating a repo that has the same name as the issue it's for, I sometimes forget to change the names. Now fixed. As for setting to an |
Yea, the documentation for crate-types could definitely be improved in general. Feel free to leave more comments here if you run into any other issues. Otherwise I'll just leave this open as a documentation issue. |
Most of the tests for example Oak Applications just use the external gRPC service definition for testing, and so can be external integration tests rather than unit tests. This does require an "rlib" target for the modules though, because of rust-lang/cargo#6659 The trusted_information_retrieval example's tests included both unit tests and integration tests, so is split. Along the way, make the floating comparisons in the unit tests a bit more robust. Fixes #1054.
There are some potential issues with just adding `lib' to get it to work. See: #4881. |
This is related to an issue described here: rust-lang/cargo#6659 Without this change the `tests` directory can't access the scheduler crate.
I'd like to add that this doesn't work with |
@ehuss, is adding a second |
I don't think there is any other way to do it right now. |
- Move some of the existing tests to tests/db.rs - Split out an internal "kirunadb_test_helpers" crate for code shared between unit and integration tests. - Make transaction_manager module public, for integration tests, fix the new Clippy warnings. - Add "rlib" crate type for kirunadb so that the integration tests could actually import it. This is rust-lang/cargo#6659 and it can be removed once that issue is fixed.
As mentioned upstream[^1] the integration tests aren't able to use cdylib crate types so "lib" was added to the list of crate types. To not having to repeat the plugin interface types for Rust in the integration test they were made public in the library. The integration test needs a running MQTT server to which it will connect. That way the full functionality (except for mstarConfigure with its UI) can be tested. [^1]: rust-lang/cargo#6659 (comment)
Adds an entry point on the rust side. Had to change cdylib to rdlib (rust-lang/cargo#6659)
Adds an entry point on the rust side. Had to change cdylib to rdlib (see rust-lang/cargo#6659)
Problem
I am developing code that needs to work with python, which requires me to have a crate type of
cdylib
. It turns out that when you follow the recommendation to use atests
directory, the code within the directory cannot find the crate, failing with an error like the following:Steps
README.md
Possible Solution(s)
None known.
Notes
The text was updated successfully, but these errors were encountered: