Discussion
Loading...

Post

Log in
  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
Jack of all trades
Jack of all trades
@jackofalltrades@mas.to  ·  activity timestamp 3 days ago

@mmstick Nope. I'll check it out tomorrow and report back. Thank you!

  • Copy link
  • Flag this post
  • Block
Jack of all trades
Jack of all trades
@jackofalltrades@mas.to  ·  activity timestamp 3 days ago

@mmstick Unfortunately that didn't help much. :(

I change a few lines of code in a test, run `cargo test my_module` and have to wait 4 minutes for it to build. Output shows that it still builds everything, including tests that I didn't change nor wanted to run.

It is what it is. cargo check runs fast enough, so I'll just adapt my dev process. No TDD for me.

#rust #rustlang #tdd

  • Copy link
  • Flag this comment
  • Block
Jack of all trades
Jack of all trades
@jackofalltrades@mas.to  ·  activity timestamp 3 days ago

@mmstick @diondokter @rkaj @tjunge @michalfita

Thank you for all your input!

The problem was that I was following the suggestion from the Rust book about writing unit tests and placed my tests in the same file as the code module. So even though I was only changing a single line in the test to the compiler it looked like I changed code under test, causing the whole crate to recompile. I moved tests to a separate file and now it takes just 2 secs. :-)

  • Copy link
  • Flag this comment
  • Block
Ed Page
Ed Page
@epage@hachyderm.io  ·  activity timestamp 2 days ago

@jackofalltrades @mmstick @diondokter @rkaj @tjunge @michalfita The tip for unit tests is to put them in their own mod, see https://github.com/rust-lang/rust-clippy/issues/13589

  • Copy link
  • Flag this comment
  • Block

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.2-alpha.34 no JS en
Automatic federation enabled
Log in
Instance logo
  • Explore
  • About
  • Members
  • Code of Conduct