mirror of
https://github.com/numtide/treefmt.git
synced 2024-09-11 17:07:44 +03:00
Fix flaky tests that use `std::env::set_var`. `std::env::set_var` is not safe to be used in parallel. Reproducer: ``` bash for _ in {0..100}; do cargo t current_dir || exit 1 done ``` Will fail very fast. Doesn't fail: ```bash for _ in {0..100}; do cargo t current_dir_prefers_pwd_env_var || exit 1 cargo t current_dir_uses_dereferenced_path_when_pwd_env_var_not_set || exit 1 done ``` Reference: https://github.com/rust-lang/rust/issues/27970
14 lines
347 B
Bash
Executable File
14 lines
347 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# nix-shell loads the devshell making rust and all the formatters available.
|
|
set -exuo pipefail
|
|
|
|
# Quick sanity check
|
|
cargo test
|
|
cargo test -- --ignored --test-threads=1
|
|
|
|
# Check that no code needs reformatting. Acts as a minimal integration test.
|
|
cargo run -- --fail-on-change
|
|
|
|
# Build the nix package
|
|
nix-build --no-out-link
|