-
Notifications
You must be signed in to change notification settings - Fork 11
Testing strategy #176
Comments
I'm new and only starting to dig into this project so take me with a grain of salt, but would it make sense to also revisit the whole thing with having to set up test fixtures (git refs) by external script before running It doesn't feel right that I can't clone this project, run |
Thanks for taking the time to look around @uint 😊
I'm definitely for discussing this! The fixtures testing has always left something to be desired. I tried to make it as seamless as possible by using a What kind of approach were you thinking of? Just keep in mind that it needs to work on the unit tests as well as the doc tests, and I'd hope to not have any noise in the doc tests, if possible. |
@FintanH I'm guessing since you're using submodules to keep that git repo around, it's not really possible/straightforward to keep other refs in it, right? Git probably just checks out one tree and that's it, and that's why you add other refs dynamically. Have you considered ditching submodules and packaging up the whole git repo in a tarball, along with all the refs needed for tests? Then the only thing tests need to do for prep is untar the thing to some tempdir. I'm not sure about doctests, but if we have a function |
Ya, so I've tried pushing a
Initially, I believe I'd be fine with moving back to having a dedicated repository in Is there any advantage to tarballing the project? I'm curious because it seems like a bit of overhead to update it (if needs be) and to untar it for each test. |
Fair warning - I'm probably a bit biased against git submodules, just because I feel like they tend to complicate things. I'm just playing devil's advocate here. I'm not alone, though!
I think that kind of parity could still be achieved with a simple script that updates If some refs are missing after a plain checkout, I think there are arguments to play around with that might help. Maybe.
So in the past I worked on something similar (a project that contained some kind of inner git repo as a test asset) and I vaaaguely remember git not liking such nested git repos very much. I could be misremembering. If it works as is, that's great! |
They're a PITA, I know :) So this all sounds good to me! Are you interested in taking this task on? Happy to help you out if you need it 😊 |
I can give it a go! Sounds like there'll be experimentation involved, but that's just dandy for me ;) |
You love to see it ;) Ping me if you need any guidance, but it sounds like you got this |
After reading this article https://matklad.github.io/2021/02/27/delete-cargo-integration-tests.html, I'm thinking that some of the testing organisation could be changed.
For example, the current layout is generally a
mod test { /* test cases */ }
. In the article, it's recommended to usemod test
with atest.rs
file so that the compiler doesn't think the original module itself has changed.There are a lot of doc tests, which the article says are slow, but I think since it provides a good view of the API and what the functions do they should stay.
A set of integration tests might be a nice addition, but no particular plan in what flows could be tested.
The text was updated successfully, but these errors were encountered: