Skip to content

Commit

Permalink
XXX Windows test hack
Browse files Browse the repository at this point in the history
  • Loading branch information
yuja committed Nov 7, 2024
1 parent fdfe808 commit 8fad65a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 31 deletions.
33 changes: 2 additions & 31 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,8 @@ jobs:
fail-fast: false
matrix:
# macos-13 is x86; macos-14 is ARM
os: [ubuntu-latest, macos-13, macos-14, windows-latest]
os: [windows-latest]
cargo_flags: [""]
include:
- os: ubuntu-latest
cargo_flags: "--all-features"
runs-on: ${{ matrix.os }}

# TODO FIXME (aseipp): keep the timeout limit to ~15 minutes. this is long
Expand All @@ -38,40 +35,14 @@ jobs:
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683

# The default version of gpg installed on the runners is a version baked in with git
# which only contains the components needed by git and doesn't work for our test cases.
#
# This installs the latest gpg4win version, which is a variation of GnuPG built for
# Windows.
#
# There is some issue with windows PATH max length which is what all the PATH wrangling
# below is for. Please see the below link for where this fix was derived from:
# https://github.com/orgs/community/discussions/24933
- name: Setup GnuPG [windows]
if: ${{ matrix.os == 'windows-latest' }}
run: |
$env:PATH = "C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\ProgramData\chocolatey\bin"
[Environment]::SetEnvironmentVariable("Path", $env:PATH, "Machine")
choco install --yes gpg4win
echo "C:\Program Files (x86)\Gpg4win\..\GnuPG\bin" >> $env:GITHUB_PATH
# The default version of openssh on windows server is quite old (8.1) and doesn't have
# all the necessary signing/verification commands available (such as -Y find-principals)
- name: Setup ssh-agent [windows]
if: ${{ matrix.os == 'windows-latest' }}
run: |
Remove-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
Remove-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0
choco install openssh --pre
- name: Install Rust
uses: dtolnay/rust-toolchain@1482605bfc5719782e1267fd0c0cc350fe7646b8
with:
toolchain: 1.76
- name: Build
run: cargo build --workspace --all-targets --verbose ${{ matrix.cargo_flags }}
- name: Test
run: cargo test --workspace --all-targets --verbose ${{ matrix.cargo_flags }}
run: cargo test working --workspace --all-targets --verbose ${{ matrix.cargo_flags }} --no-fail-fast -- --show-output
env:
RUST_BACKTRACE: 1

Expand Down
12 changes: 12 additions & 0 deletions lib/tests/test_local_working_copy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1632,7 +1632,19 @@ fn test_check_out_reserved_file_path_vfat(file_path_str: &str) {
let repo = &test_workspace.repo;
let workspace_root = test_workspace.workspace.workspace_root().to_owned();
std::fs::create_dir(workspace_root.join(".git")).unwrap();
assert!(workspace_root.join(".jj").exists());
let is_vfat = check_vfat(&workspace_root);
for i in 0..=9 {
for name in ["GIT", "JJ"] {
let path = workspace_root.join(format!("{name}~{i}"));
eprintln!("XXX {} {}", path.display(), path.exists());
}
}
std::process::Command::new("cmd")
.args(["/c", "dir /x"])
.current_dir(&workspace_root)
.status()
.unwrap();

let file_path = RepoPath::from_internal_string(file_path_str);
let disk_path = file_path.to_fs_path_unchecked(&workspace_root);
Expand Down

0 comments on commit 8fad65a

Please sign in to comment.