opentelemetry-rust icon indicating copy to clipboard operation
opentelemetry-rust copied to clipboard

Add script to run all cargo tasks

Open jtescher opened this issue 3 years ago • 7 comments

Currently it is tedious to manually run fmt, test, clippy, etc when developing locally. Consider adding another script to ./scripts that runs all and update contributing docs.

jtescher avatar Oct 06 '20 14:10 jtescher

Should be cargo bench included? Or only cargo fmt, cargo clippy --all and cargo test --all?

morigs avatar Nov 02 '20 07:11 morigs

probably not bench, but fmt clippy and test, could have a script that calls the other two current scripts and runs cargo fmt

jtescher avatar Nov 02 '20 16:11 jtescher

I'm looking at test.sh. There commands for testing opentelemetry, opentelemetry-contrib, opentelemetry-jaeger and opentelemetry-zipkin crates. Should other crates be added?

morigs avatar Nov 03 '20 15:11 morigs

Ideally this would run cargo test to run with the default features, and cargo test --all-features to run tests with all the features set (the full feature matrix is probably not something we want folks to run locally). It looks like those manifest tests are to work around the issue that currently cargo will not actually pick up the individual crate feature flags when --all-features is set at the workspace level.

That being said it doesn't look like the remaining crates need to be run in that way because they do not have any features so they are fully covered by the initial cargo test

jtescher avatar Nov 03 '20 20:11 jtescher

What do you think about cargo-make? Is it worth trying?

morigs avatar Nov 04 '20 06:11 morigs

I think this could likely be accomplished with something as simple as $ cargo fmt && ./scripts/lint.sh && ./scripts/test.sh

jtescher avatar Nov 04 '20 17:11 jtescher

At work, we use just with a command called pre-commit. It encompasses fmt, clippy and test.

In general, tools like just should be preferred over pure bash scripts for more cross-platform interoperability.

tomkarw avatar Aug 18 '22 22:08 tomkarw

Scripts have been added.

jtescher avatar Jul 30 '23 17:07 jtescher