Skip to content

Commit

Permalink
Tests no longer require internet (#300)
Browse files Browse the repository at this point in the history
* Fixed cases where tests would fail when using `cargo_metadata::MetadataCommand` when the host had no network connectivity

* Added some comments

* Fixed typo
  • Loading branch information
UebelAndre committed Dec 3, 2020
1 parent 3359c69 commit f209e9f
Show file tree
Hide file tree
Showing 11 changed files with 56,927 additions and 153 deletions.
10 changes: 5 additions & 5 deletions impl/src/bin/cargo-raze.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use anyhow::Result;
use docopt::Docopt;

use cargo_raze::{
metadata::{CargoMetadataFetcher, CargoWorkspaceFiles, MetadataFetcher},
metadata::{CargoWorkspaceFiles, RazeMetadataFetcher},
planning::{BuildPlanner, BuildPlannerImpl},
rendering::{bazel::BazelRenderer, BuildRenderer, RenderDetails},
settings::RazeSettings,
Expand Down Expand Up @@ -87,13 +87,13 @@ fn main() -> Result<()> {
}

// Fetch metadata
let metadata_fetcher: Box<dyn MetadataFetcher> = match options.flag_cargo_bin_path {
Some(ref cargo_bin_path) => Box::new(CargoMetadataFetcher::new(
let metadata_fetcher: RazeMetadataFetcher = match options.flag_cargo_bin_path {
Some(ref cargo_bin_path) => RazeMetadataFetcher::new(
cargo_bin_path,
Url::parse(&settings.registry)?,
Url::parse(&settings.index_url)?,
)),
None => Box::new(CargoMetadataFetcher::default()),
),
None => RazeMetadataFetcher::default(),
};
let toml_path = PathBuf::from("./Cargo.toml");
let lock_path_opt = fs::metadata("./Cargo.lock")
Expand Down
Loading

0 comments on commit f209e9f

Please sign in to comment.