Comments (4)
Hi @Skallwar, that's indeed possible 😄. You can include the tests by running cargo msrv
with the following arguments: cargo msrv -- cargo check --tests --all
, or if you also want to execute the test cases cargo msrv -- cargo test --all
. Since the test cases are generally not consumed by library consumers, these are not included by default.
In fact, any program runnable through rustup run
can be used, and specified as the last argument, after the two dashes.
from cargo-msrv.
I won't claim to know whether there is a consensus on a best practice 🙂. In the projects of others I usually see tests being evaluated on both stable and the MSRV. I think that this configuration is used for at least two reasons:
- executing tests on MSRV as well (as stable) may have a small extra chance to catch out bugs caused by a toolchain (such as inadvertently introduced incompatibilities; such bugs are difficult to spot)
- it's easy to configure testing for both since usually you can simply add another toolchain version by including it in your build matrix
- if you have the build capacity, the stable and MSRV instances can run in parallel, not costing extra build time
There are also disadvantages to testing on additional platforms (e.g. MSRV) such as:
- if you have limited resources (e.g. for non public projects), CI minutes can become quite expensive
- if you have a smaller amount of parallel builds, or simply have a large test suite, the run time of the test suite may take a significant amount of time (which may also block other people from running their PR's on the CI workers)
For my own projects, I usually:
- run the tests on at least the latest backwards compatible stable
- run an MSRV instance with cargo check --all (i.e. building without linking) which has the aim of verifying consumers of a library can safely compile it as part of their project, within their own MSRV.
The test instances help me find defects within my code and configuration; the MSRV check tries to ensure a crate is able to run on a specific language feature set.
For me, this is usually the right balance between practicality and stability on this matter.
I'm however always interested in learning new developments in this area :).
from cargo-msrv.
I'm wondering if my CI should only run the test with a stable version and try to build with both stable and MSRV. I don't what is the best practice for this
from cargo-msrv.
Thanks a lot for taking the time to explain everything
from cargo-msrv.
Related Issues (20)
- bors is deprecated: setup GitHub merge queue HOT 2
- Add support for .cargo/config.toml HOT 3
- Unable to install toolchain with `rustup install 1.63.0-thumbv7em-none-eabihf` HOT 1
- Sparse registry causes incorrect msrv detection [consider after release of Rust 1.70] HOT 2
- indicatif 0.17.4 breaks rendering HOT 1
- feature: cargo-msrv rules (msrv by offset)
- feature: cargo-msrv suggest
- Cargo resolves different versions of dependencies (with different MSRV) from Cargo 1.60 and up HOT 14
- failure in GitLab runner: error: unexpected argument 'sh' found HOT 4
- verification does not respect workspace members with a virtual workspace HOT 4
- The code is hard to read/follow HOT 1
- Split expected and unexpected errors
- Failure on Github Actions HOT 2
- Custom check? HOT 4
- Docker image fails with GLIBC not found error HOT 2
- Use compilation target instead of build machine target for MSRV checks
- v0.16.0-beta.16 release builds failed: third party license files failed to generate HOT 1
- Add `--features` parameter
- Posible to install clippy for using it as a check? HOT 4
- Add `--workspace` flag to subcommand `find`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cargo-msrv.