-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #7774 - giraffate:update_credentials, r=ehuss
Load credentials only when needed Credentials are always loaded, even if these are not used. If access to confidential files such as credentials is not given, `cargo build` fails despite not using credentials. Fixes #7624.
- Loading branch information
Showing
10 changed files
with
174 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
//! Tests for the `cargo owner` command. | ||
|
||
use std::fs; | ||
|
||
use cargo_test_support::paths::CargoPathExt; | ||
use cargo_test_support::project; | ||
use cargo_test_support::registry::{self, api_path, registry_url}; | ||
|
||
fn setup(name: &str) { | ||
let dir = api_path().join(format!("api/v1/crates/{}", name)); | ||
dir.mkdir_p(); | ||
fs::write( | ||
dir.join("owners"), | ||
r#"{ | ||
"users": [ | ||
{ | ||
"id": 70, | ||
"login": "github:rust-lang:core", | ||
"name": "Core" | ||
} | ||
] | ||
}"#, | ||
) | ||
.unwrap(); | ||
} | ||
|
||
#[cargo_test] | ||
fn simple_list() { | ||
registry::init(); | ||
setup("foo"); | ||
|
||
let p = project() | ||
.file( | ||
"Cargo.toml", | ||
r#" | ||
[project] | ||
name = "foo" | ||
version = "0.0.1" | ||
authors = [] | ||
license = "MIT" | ||
description = "foo" | ||
"#, | ||
) | ||
.file("src/main.rs", "fn main() {}") | ||
.build(); | ||
|
||
p.cargo("owner -l --index") | ||
.arg(registry_url().to_string()) | ||
.run(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
//! Tests for the `cargo yank` command. | ||
|
||
use std::fs; | ||
|
||
use cargo_test_support::paths::CargoPathExt; | ||
use cargo_test_support::project; | ||
use cargo_test_support::registry::{self, api_path, registry_url}; | ||
|
||
fn setup(name: &str, version: &str) { | ||
let dir = api_path().join(format!("api/v1/crates/{}/{}", name, version)); | ||
dir.mkdir_p(); | ||
fs::write(dir.join("yank"), r#"{"ok": true}"#).unwrap(); | ||
} | ||
|
||
#[cargo_test] | ||
fn simple() { | ||
registry::init(); | ||
setup("foo", "0.0.1"); | ||
|
||
let p = project() | ||
.file( | ||
"Cargo.toml", | ||
r#" | ||
[project] | ||
name = "foo" | ||
version = "0.0.1" | ||
authors = [] | ||
license = "MIT" | ||
description = "foo" | ||
"#, | ||
) | ||
.file("src/main.rs", "fn main() {}") | ||
.build(); | ||
|
||
p.cargo("yank --vers 0.0.1 --index") | ||
.arg(registry_url().to_string()) | ||
.run(); | ||
} |