Skip to content

Commit ede459e

Browse files
committed
Auto merge of #6799 - ehuss:fix-member_manifest_version_error-network, r=alexcrichton
Fix member_manifest_version_error accessing the network. This test was updating the registry via github. Add a `.cargo/config` file so that it doesn't.
2 parents 2fc2db1 + f01428b commit ede459e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/testsuite/member_errors.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
use cargo::core::resolver::ResolveError;
2-
use cargo::core::{compiler::CompileMode, Workspace};
2+
use cargo::core::{compiler::CompileMode, Shell, Workspace};
33
use cargo::ops::{self, CompileOptions};
44
use cargo::util::{config::Config, errors::ManifestError};
55

6+
use crate::support::install::cargo_home;
67
use crate::support::project;
8+
use crate::support::registry;
79

810
/// Tests inclusion of a `ManifestError` pointing to a member manifest
911
/// when that manifest fails to deserialize.
@@ -139,7 +141,9 @@ fn member_manifest_version_error() {
139141
.file("bar/src/main.rs", "fn main() {}")
140142
.build();
141143

142-
let config = Config::default().unwrap();
144+
// Prevent this test from accessing the network by setting up .cargo/config.
145+
registry::init();
146+
let config = Config::new(Shell::new(), cargo_home(), cargo_home());
143147
let ws = Workspace::new(&p.root().join("Cargo.toml"), &config).unwrap();
144148
let compile_options = CompileOptions::new(&config, CompileMode::Build).unwrap();
145149
let member_bar = ws.members().find(|m| &*m.name() == "bar").unwrap();

0 commit comments

Comments
 (0)