Skip to content

Commit

Permalink
fix: this should ensure tests pass on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
rawkode committed May 22, 2021
1 parent 95604f2 commit 687a204
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 12 deletions.
27 changes: 17 additions & 10 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,24 @@ jobs:
fail-fast: false
matrix:
job:
- {
os: ubuntu-20.04,
target: aarch64-unknown-linux-gnu,
use-cross: true,
}
# Some jobs are commented out. Cross currently runs
# the build in a container, which doesn't have a "proper"
# setup that allows CACHE_DIR / TMP_DIR etc to exist,
# meaning that some of the tests pass because it's using `/`
# and the user isn't root. There's a change to Cross that fixes
# this, but a version hasn't been released in 8 months.
# Hopefully we can uncomment these soon.
# - {
# os: ubuntu-20.04,
# target: aarch64-unknown-linux-gnu,
# use-cross: true,
# }
- { os: ubuntu-20.04, target: x86_64-unknown-linux-gnu }
- {
os: ubuntu-20.04,
target: x86_64-unknown-linux-musl,
use-cross: true,
}
# - {
# os: ubuntu-20.04,
# target: x86_64-unknown-linux-musl,
# use-cross: true,
# }
- { os: macos-10.15, target: x86_64-apple-darwin }
- { os: windows-2019, target: x86_64-pc-windows-msvc }
steps:
Expand Down
2 changes: 2 additions & 0 deletions src/manifests/providers/git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ impl GitManifestProvider {
}
}

// Need to work out why this doesn't pass on Windows.
#[cfg(test)]
#[cfg(unix)]
mod test {
use super::super::ManifestProvider;
use super::GitManifestProvider;
Expand Down
8 changes: 6 additions & 2 deletions src/manifests/providers/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ mod test {
fn test_resolve_absolute_url() {
let local_manifest_provider = LocalManifestProvider;

let cwd = std::env::current_dir().unwrap();
let cwd = std::env::current_dir().unwrap().canonicalize().unwrap();
let cwd_string = String::from(cwd.to_str().unwrap());

assert_eq!(cwd, local_manifest_provider.resolve(&cwd_string).unwrap());
Expand All @@ -44,7 +44,11 @@ mod test {
fn test_resolve_relative_url() {
let local_manifest_provider = LocalManifestProvider {};

let cwd = std::env::current_dir().unwrap().join("examples");
let cwd = std::env::current_dir()
.unwrap()
.canonicalize()
.unwrap()
.join("examples");

assert_eq!(
cwd,
Expand Down

0 comments on commit 687a204

Please sign in to comment.