Closed beoboo closed 1 year ago
@ilslv seems to be something inventory
-related.
@beoboo I've tried your setup locally on 1.66
, 1.67
and 1.68
and in every case all test functions wired up properly. There is open issue in inventory
about multi-crate behaviour, I think you are having the same problem. You can try adding extern crate cucumber_test;
in uat.rs
as suggested there, but alternatively you can restructure your project from
src/_
| lib.rs
| context.rs
| steps.rs
tests/
| uat.rs
|_features/
| | *
Cargo.toml
to
src/_
| lib.rs // Only logic to test here.
tests/
| uat.rs
| context.rs
| steps.rs
|_features/
| | *
Cargo.toml
We expect users of this crate to have all tested logic in /src/lib.rs
//src/main.rs
and all testing stuff in /tests/*
directory. The similar issue was addressed here.
I'm closing this issue, but feel free to reopen in case there are unanswered questions you have.
@tyranron as this isn't the first time this issue is brought up, maybe we should create a separate git repository with basic starter project?
Thanks @ilslv, moving code inside tests
did solve the issue indeed, and it's now working for Rust 1.68.2.
@tyranron as this isn't the first time this issue is brought up, maybe we should create a separate git repository with basic starter project?
Let's postpone this for a while, till happens more times.
When I run a very minimal example with the following setup with
Digging further, it seems like it can find the steps definitions if they are in the same file as the AnimalWorld context file or in the lib file, but not if they are put in a separate file (even if it's a
pub mod
or withpub use
).