Skip to content

Commit d100392

Browse files
authored
Set scarb cache for non deterministic test (#1573)
<!-- Reference any GitHub issues resolved by this PR --> ## Introduced changes <!-- A brief description of the changes --> - Set scarb cache directory for failing test ## Checklist <!-- Make sure all of these are complete --> - [X] Linked relevant issue - [X] Updated relevant documentation - [X] Added relevant tests - [X] Performed self-review of the code - [X] Added changes to `CHANGELOG.md`
1 parent 1485e11 commit d100392

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

crates/forge/tests/e2e/running.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use crate::e2e::common::runner::{
1010
};
1111
use std::fs;
1212
use std::{path::Path, str::FromStr};
13+
use tempfile::TempDir;
1314

1415
#[test]
1516
fn simple_package() {
@@ -937,6 +938,7 @@ fn printing_in_contracts() {
937938
fn incompatible_snforge_std_version_warning() {
938939
let temp = setup_package("simple_package");
939940
let manifest_path = temp.child("Scarb.toml");
941+
let tempdir = TempDir::new().expect("Failed to create a temporary directory");
940942

941943
let mut scarb_toml = fs::read_to_string(&manifest_path)
942944
.unwrap()
@@ -950,7 +952,11 @@ fn incompatible_snforge_std_version_warning() {
950952

951953
let snapbox = test_runner();
952954

953-
let output = snapbox.current_dir(&temp).assert().failure();
955+
let output = snapbox
956+
.current_dir(&temp)
957+
.env("SCARB_CACHE", tempdir.path())
958+
.assert()
959+
.failure();
954960
assert_stdout_contains!(
955961
output,
956962
indoc! {r"

0 commit comments

Comments
 (0)