From b20f81e84a6cc9c1c8ca01dd2cbba275c544fc93 Mon Sep 17 00:00:00 2001 From: Igor Aleksanov Date: Wed, 17 Jul 2024 14:31:06 +0400 Subject: [PATCH] Create CONTRIBUTING.md --- CONTRIBUTING.md | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 45 ++------------------------------------------- 2 files changed, 51 insertions(+), 43 deletions(-) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..9bbcbb2 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,49 @@ +# Contributing to `cargo-workspaces` + +If you want to contribute to the project, take a look at [open issues](https://github.com/pksunkara/cargo-workspaces/issues) +or create a PR. + +Please make sure that new functionality has tests. + +## Running tests + +The recommended way to run tests for the crate is as follows: + +```sh +cargo test --manifest-path cargo-workspaces/Cargo.toml -j1 +``` + +The integration tests manipulate the file system, so running them from multiple threads +may cause race conditions and unexpected failures. + +### Adding tests and updating snapshots + +`cargo-workspaces` uses [`insta`](https://docs.rs/insta/) for snapshot testing. + +When updating tests, you may run tests via: + +``` +INSTA_UPDATE=always cargo test +``` + +If you don't want to override any existing snapshots, use: + +``` +INSTA_UPDATE=unseen cargo test +``` + +Always make sure that generated snapshots match what you expect the test to produce. +Do not blindly commit changes in snapshots that you do not anticipate. + +For more details, check the `insta` documentation. + +### Troubleshooting + +If you observe unexpected differences in snapshots, you may want to override your compiler to +the same version as used in [CI](.github/workflows/ci.yml), e.g.: + +``` +cargo override set 1.70 +``` + +The newer versions of `cargo` may produce different output, which would break snapshot tests. diff --git a/README.md b/README.md index 9ca1928..639a99e 100644 --- a/README.md +++ b/README.md @@ -314,51 +314,10 @@ overrides the value specified in **Workspace**. | `independent` | `bool` | No | Yes | `version`, `publish` | | `no_individual_tags` | `bool` | Yes | No | `version`, `publish` | -## Running tests - -The recommended way to run tests for the crate is as follows: - -```sh -cargo test --manifest-path cargo-workspaces/Cargo.toml -j1 -``` - -The integration tests manipulate the file system, so running them from multiple threads -may cause race conditions and unexpected failures. - -### Adding tests and updating snapshots - -`cargo-workspaces` uses [`insta`](https://docs.rs/insta/) for snapshot testing. - -When updating tests, you may run tests via: - -``` -INSTA_UPDATE=always cargo test -``` - -If you don't want to override any existing snapshots, use: - -``` -INSTA_UPDATE=unseen cargo test -``` - -Always make sure that generated snapshots match what you expect the test to produce. -Do not blindly commit changes in snapshots that you do not anticipate. - -For more details, check the `insta` documentation. - -### Troubleshooting - -If you observe unexpected differences in snapshots, you may want to override your compiler to -the same version as used in [CI](.github/workflows/ci.yml), e.g.: - -``` -cargo override set 1.70 -``` - -The newer versions of `cargo` may produce different output, which would break snapshot tests. - ## Contributors +See the [Contributor guide](CONTRIBUTING.md). + Here is a list of [Contributors](http://github.com/pksunkara/cargo-workspaces/contributors)