Skip to content

Commit

Permalink
Fix windows test
Browse files Browse the repository at this point in the history
  • Loading branch information
delsner committed Jan 12, 2025
1 parent 5600720 commit d17bc89
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/rust-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,16 @@ jobs:
# on windows, the minio server doesn't get shutdown properly so there is still a lock on this file
post-cleanup: false

- name: Start minio for integration tests
- name: Install minio for integration tests
if: ${{ !matrix.skip-tests }}
run: |
pixi global install minio-client
pixi global install minio-server
pixi run minio server --address 0.0.0.0:9000 ${{ runner.temp }}/minio-data &
- name: Start minio server
if: ${{ !matrix.skip-tests }}
run: |
minio${{ startsWith(matrix.os, 'windows') && '.bat' || '' }} server --address 0.0.0.0:9000 ${{ runner.temp }}/minio-data &
- name: Run tests
if: ${{ !matrix.skip-tests }}
Expand Down
13 changes: 9 additions & 4 deletions crates/rattler_networking/tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,18 @@ fn init_channel() {
option_env!("MINIO_PORT").unwrap_or("9000")
);
let env = &HashMap::from([("MC_HOST_local", host.as_str())]);
let mc_executable = if cfg!(target_os = "windows") {
"mc.bat"
} else {
"mc"
};
for bucket in &[
"local/rattler-s3-testing",
"local/rattler-s3-testing-public",
] {
run_subprocess("mc", &["mb", "--ignore-existing", bucket], env);
run_subprocess(mc_executable, &["mb", "--ignore-existing", bucket], env);
run_subprocess(
"mc",
mc_executable,
&[
"cp",
PathBuf::from("../../test-data/test-server/repo/noarch/repodata.json")
Expand All @@ -58,7 +63,7 @@ fn init_channel() {
env,
);
run_subprocess(
"mc",
mc_executable,
&[
"cp",
PathBuf::from("../../test-data/test-server/repo/noarch/test-package-0.1-0.tar.bz2")
Expand All @@ -71,7 +76,7 @@ fn init_channel() {
}
// Make bucket public
run_subprocess(
"mc",
mc_executable,
&[
"anonymous",
"set",
Expand Down

0 comments on commit d17bc89

Please sign in to comment.