Skip to content

Commit 49c48b8

Browse files
committed
re-enable previously disabled tests (#11821)
On Windows, `gix` will call the `git-credential-manager, but with `stderr` set to `inherit` it makes any errors visible to the user, just like `git` does. ``` 1 1 Updating git repository `https://foo.bar/foo/bar` 2 +warning: auto-detection of host provider took too long (>2000ms) 3 +warning: see https://aka.ms/gcm/autodetect for more information. 4 +fatal: A task was canceled. 5 +warning: auto-detection of host provider took too long (>2000ms) 6 +warning: see https://aka.ms/gcm/autodetect for more information.` ```` This, however, isn't what's desirable in tests sometimes, nor may it be desirable in Cargo. In the latest version of `gix`, it's possible to control `stderr` which is now set on a per-test basis. Also note that for `cargo` as a whole the default didn't change, and stderr of spawned helper programs will remain visible in the enclosing terminal.
1 parent 50c0005 commit 49c48b8

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

tests/testsuite/git_auth.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,6 @@ fn setup_failed_auth_test() -> (SocketAddr, JoinHandle<()>, Arc<AtomicUsize>) {
105105
// Tests that HTTP auth is offered from `credential.helper`.
106106
#[cargo_test]
107107
fn http_auth_offered() {
108-
// TODO(Seb): remove this once possible.
109-
if cargo_uses_gitoxide() {
110-
// Without the fixes in https://github.com/Byron/gitoxide/releases/tag/gix-v0.41.0 this test is flaky.
111-
return;
112-
}
113108
let (addr, t, connections) = setup_failed_auth_test();
114109
let p = project()
115110
.file(
@@ -139,6 +134,7 @@ fn http_auth_offered() {
139134
// This is a "contains" check because the last error differs by platform,
140135
// may span multiple lines, and isn't relevant to this test.
141136
p.cargo("check")
137+
.env("GIX_CREDENTIALS_HELPER_STDERR", "0")
142138
.with_status(101)
143139
.with_stderr_contains(&format!(
144140
"\
@@ -372,11 +368,6 @@ Caused by:
372368

373369
#[cargo_test]
374370
fn instead_of_url_printed() {
375-
// TODO(Seb): remove this once possible.
376-
if cargo_uses_gitoxide() {
377-
// Without the fixes in https://github.com/Byron/gitoxide/releases/tag/gix-v0.41.0 this test is flaky.
378-
return;
379-
}
380371
let (addr, t, _connections) = setup_failed_auth_test();
381372
let config = paths::home().join(".gitconfig");
382373
let mut config = git2::Config::open(&config).unwrap();
@@ -403,6 +394,7 @@ fn instead_of_url_printed() {
403394
.build();
404395

405396
p.cargo("check")
397+
.env("GIX_CREDENTIALS_HELPER_STDERR", "0")
406398
.with_status(101)
407399
.with_stderr(&format!(
408400
"\

0 commit comments

Comments
 (0)