summaryrefslogtreecommitdiffstats
path: root/CONTRIBUTING.md
diff options
context:
space:
mode:
authorDavid Knaack <davidkna@users.noreply.github.com>2020-03-15 18:12:25 +0100
committerGitHub <noreply@github.com>2020-03-15 12:12:25 -0500
commit56d475578ea508631275772127f49a6949fea6b0 (patch)
tree980e2bc8d4057a5ab32aad3bfe739e54135eff67 /CONTRIBUTING.md
parentfef8cc8bbdbaaae4dd0f80d4c2643c33e2309c54 (diff)
fix: possible fix for Intermittent Test Failures in GH Actions (#987)
* fix: possible fix for Intermittent Test Failures in GH Actions * undo some of the chnages to directory.rs * typo * add docs
Diffstat (limited to 'CONTRIBUTING.md')
-rw-r--r--CONTRIBUTING.md8
1 files changed, 8 insertions, 0 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 4fa8af11d..69b74320e 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -80,6 +80,14 @@ Integration tests should test full modules or the entire prompt. All integration
For tests that depend on having preexisting state, whatever needed state will have to be added to the project's GitHub Actions workflow file([`.github/workflows/workflow.yml`](.github/workflows/workflow.yml)).
+### Test Programming Guidelines
+
+Any tests that depend on File I/O should use [`sync_all()`](https://doc.rust-lang.org/std/fs/struct.File.html#method.sync_all) when creating files or after writing to files.
+
+Any tests that use `tempfile::tempdir` should take care to call `dir.close()` after usage to ensure the lifecycle of the directory can be reasoned about.
+
+Any tests that use `create_fixture_repo()` should remove the returned directory after usage with `remove_dir_all::remove_dir_all()`.
+
## Running the Documentation Website Locally
If you are contributing to the design of Starship's website, the following section will help you get started.