Skip to content

Commit

Permalink
Merge pull request #7 from flub/flub/nexttest
Browse files Browse the repository at this point in the history
Detect cargo-nextest as top-level cargo test runner
  • Loading branch information
flub authored Nov 27, 2023
2 parents 77c73b1 + 0aea1c0 commit e85f794
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## v0.8.1

- When cleaning up old numbered directories if the entry is not found
this error is ignored. This is possible if multiple cleanups are
racing each other.

## v0.8.0

- NumberedDir::create_subdir will no longer ensure to always create a
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "testdir"
version = "0.8.0"
version = "0.8.1"
authors = ["Floris Bruynooghe <[email protected]>"]
edition = "2021"
description = "Semi-persistent, scoped test directories"
Expand Down
4 changes: 1 addition & 3 deletions src/private.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use std::ffi::OsStr;
use std::fs;
use std::path::Path;

// use heim::process::Pid;
use once_cell::sync::Lazy;
use sysinfo::{Pid, ProcessExt, SystemExt};

Expand All @@ -19,7 +18,6 @@ pub use cargo_metadata;
const CARGO_PID_FILE_NAME: &str = "cargo-pid";

/// Whether we are a cargo sub-process.
// static CARGO_PID: Lazy<Option<Pid>> = Lazy::new(|| smol::block_on(async { cargo_pid().await }));
static CARGO_PID: Lazy<Option<Pid>> = Lazy::new(cargo_pid);

/// Returns the process ID of our parent Cargo process.
Expand All @@ -45,7 +43,7 @@ fn cargo_pid() -> Option<Pid> {
let parent = sys.process(ppid)?;
let parent_exe = parent.exe();
let parent_file_name = parent_exe.file_name()?;
if parent_file_name == OsStr::new("cargo") {
if parent_file_name == OsStr::new("cargo") || parent_file_name == OsStr::new("cargo-nextest") {
Some(parent.pid())
} else if parent_file_name == OsStr::new("rustdoc") {
let ppid = parent.parent()?;
Expand Down

0 comments on commit e85f794

Please sign in to comment.