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

Running butane tests fail unless async feature is enabled #292

Open
jayvdb opened this issue Jan 7, 2025 · 0 comments · May be fixed by #293
Open

Running butane tests fail unless async feature is enabled #292

jayvdb opened this issue Jan 7, 2025 · 0 comments · May be fixed by #293

Comments

@jayvdb
Copy link
Collaborator

jayvdb commented Jan 7, 2025

Most of the butane/ tests fail if async feature isnt enabled with

$ cd butane
$ cargo test
...
error[E0046]: not all trait items implemented, missing: `save_many_to_many_async`
   --> butane/tests/basic.rs:104:1
    |
104 | #[model]
    | ^^^^^^^^ missing `save_many_to_many_async` in implementation
    |
    = note: this error originates in the attribute macro `model` (in Nightly builds, run with -Z macro-backtrace for more info)
    = help: implement the missing item: `async fn save_many_to_many_async<impl ConnectionMethodsAsync>(&mut self, _: &impl ConnectionMethodsAsync) -> Result<(), butane::Error> where impl ConnectionMethodsAsync: ConnectionMethodsAsync { todo!() }`

error[E0599]: no method named `save` found for struct `Post` in the current scope
   --> butane/tests/common/blog.rs:190:10
    |
30  | #[model]
    | -------- method `save` not found for this struct
...
190 |     post.save(conn).await.unwrap();
    |          ^^^^ method not found in `Post`
    |
    = help: items from traits can only be used if the trait is in scope
help: the following traits which provide `save` are implemented but not in scope; perhaps you want to import one of them
    |
3   + use butane::DataObjectOpsSync;
    |
3   + use butane::ManyOpsSync;
    |
3   + use butane_core::DataObjectOpsAsync;
    |
3   + use butane_core::many::ManyOpsAsync;
    |

The three doctest fails with

error[E0046]: not all trait items implemented, missing: `save_many_to_many_async`
  --> butane/src/lib.rs:144:1
   |
12 | #[model]
   | ^^^^^^^^ missing `save_many_to_many_async` in implementation
   |
   = note: this error originates in the attribute macro `model` (in Nightly builds, run with -Z macro-backtrace for more info)
   = help: implement the missing item: `async fn save_many_to_many_async<impl ConnectionMethodsAsync>(&mut self, _: &impl ConnectionMethodsAsync) -> Result<(), butane::Error> where impl ConnectionMethodsAsync: ConnectionMethodsAsync { todo!() }`

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0046`.
Couldn't compile the test.

failures:
    butane/src/lib.rs - find (line 135)
@jayvdb jayvdb linked a pull request Jan 7, 2025 that will close this issue
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 a pull request may close this issue.

1 participant