Skip to content

Commit

Permalink
Add temp_dir correctly to test_builder
Browse files Browse the repository at this point in the history
  • Loading branch information
prsabahrami committed Sep 29, 2024
1 parent c19fc12 commit 8ffad01
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/rust-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ jobs:
toolchain: stable
profile: minimal
override: true

- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
with:
limit-access-to-actor: false

- uses: Swatinem/rust-cache@v2

Expand Down
2 changes: 1 addition & 1 deletion crates/deno_task_shell/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pest = { git = "https://github.com/pest-parser/pest.git", branch = "master", fea
pest_derive = "2.7.12"
dirs = "5.0.1"
pest_ascii_tree = { git = "https://github.com/prsabahrami/pest_ascii_tree.git", branch = "master" }
miette = "7.2.0"
miette = { version = "7.2.0", features = ["fancy"] }
lazy_static = "1.4.0"

[dev-dependencies]
Expand Down
7 changes: 3 additions & 4 deletions crates/tests/src/test_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,6 @@ impl TestBuilder {
fn get_temp_dir(&mut self) -> &mut TempDir {
if self.temp_dir.is_none() {
self.temp_dir = Some(TempDir::new());
let temp_dir_string = self.temp_dir_path().display().to_string();
self.env_vars
.insert("TEMP_DIR".to_string(), temp_dir_string);
}
self.temp_dir.as_mut().unwrap()
}
Expand Down Expand Up @@ -238,6 +235,7 @@ impl TestBuilder {
let (stderr, stderr_handle) = get_output_writer_and_handle();

let local_set = tokio::task::LocalSet::new();
self.env_var("TEMP_DIR", &cwd.display().to_string());
let state = ShellState::new(
self.env_vars.clone(),
&cwd,
Expand Down Expand Up @@ -266,8 +264,9 @@ impl TestBuilder {
.expected_stderr_contains
.replace("$TEMP_DIR", &temp_dir)
),
"\n\nFailed for: {}\nExpected stderr to contain: {}",
"\n\nFailed for: {}\nExpected stderr to contain: {}, {}",
self.command,
stderr_output,
self.expected_stderr_contains
);
}
Expand Down

0 comments on commit 8ffad01

Please sign in to comment.