Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ on:
branches: [main]
pull_request:

# The runner images are pinned to the platforms thirdshift supports.
jobs:
test:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
Expand All @@ -17,5 +18,13 @@ jobs:
- run: cargo fmt --check
- run: cargo clippy --all-targets -- -D warnings
# The tests run the binary against real git and fake gh and claude
# (Python scripts in tests/fakes), all present on ubuntu-latest.
# (Python scripts in tests/fakes), all present on the runner image.
- run: cargo test

test-macos:
runs-on: macos-26
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo test
16 changes: 12 additions & 4 deletions tests/support/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ pub const OWNER: &str = "acme";
pub const REPO: &str = "widgets";

pub struct Scenario {
root: TempDir,
/// Deletes the temp root when the scenario is dropped.
_temp_dir: TempDir,
/// The temp root's path with symlinks resolved, as git reports it: on
/// macOS the temp directory is under `/var`, a symlink to `/private/var`.
root: PathBuf,
}

pub struct RunResult {
Expand All @@ -56,8 +60,12 @@ impl Scenario {
/// An origin with one commit on `main`, a launch clone of it with `main`
/// checked out, and an open issue #7.
pub fn new() -> Self {
let root = TempDir::new().unwrap();
let scenario = Scenario { root };
let temp_dir = TempDir::new().unwrap();
let root = temp_dir.path().canonicalize().unwrap();
let scenario = Scenario {
_temp_dir: temp_dir,
root,
};
for dir in ["home", "bin", "tmp", "work"] {
fs::create_dir_all(scenario.path(dir)).unwrap();
}
Expand Down Expand Up @@ -97,7 +105,7 @@ impl Scenario {
}

pub fn path(&self, relative: &str) -> PathBuf {
self.root.path().join(relative)
self.root.join(relative)
}

pub fn launch_dir(&self) -> PathBuf {
Expand Down