Skip to content

Commit 72eacb8

Browse files
committed
Refine complex_graph regex_matches partial suppressions
This builds on GitoxideLabs#1635 by: - Updating the comment about GitoxideLabs#1622, including by adding links to Git mailing list posts by Aarni Koskela, who discovered the bug that turns out to be the cause of this, and Patrick Steinhardt, who analyzed the bug and wrote a fix (currently in testing); and GitoxideLabs#1622 (comment), which summarizes that and reports on its connection to GitoxideLabs#1622. - Narrowing the partial suppression of the failing test code (which consists of conditionally using `parse_spec_no_baseline` instead of `parse_spec` in some assertions) so that it is only done if Git is at one of the versions that is known to be affected. If any future Git versions are affected, such as by the currently cooking patch not being merged as soon as I expect, then this could potentially fail on CI again. But that is something we would probably want to find out about.
1 parent 801f9e9 commit 72eacb8

File tree

1 file changed

+15
-6
lines changed
  • gix/tests/gix/revision/spec/from_bytes

1 file changed

+15
-6
lines changed

gix/tests/gix/revision/spec/from_bytes/regex.rs

+15-6
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ mod with_known_revision {
5858

5959
mod find_youngest_matching_commit {
6060
use gix::revision::Spec;
61+
use std::borrow::Borrow;
6162

6263
use super::*;
6364
use crate::revision::spec::from_bytes::parse_spec;
@@ -95,11 +96,19 @@ mod find_youngest_matching_commit {
9596
fn regex_matches() {
9697
let repo = repo("complex_graph").unwrap();
9798

98-
// On the full linux CI `test` workflow, archived baseline aren't used - instead fixtures will be re-evaluated.
99-
// As of Git 2.47, its behaviour changed which makes the following assertion fail.
100-
// We decided to just ignore it until it's clear that this isn't a bug - obviously the traversal order changed.
101-
let is_in_test_ci_workflow = is_ci::cached() && std::env::var_os("GIX_TEST_IGNORE_ARCHIVES").is_some();
102-
if is_in_test_ci_workflow {
99+
// The full Linux CI `test` job regenerates baselines instead of taking them from archives.
100+
// In Git 2.47.0 (and 2.47.1), the traversal order differs, so some `parse_spec` assertions
101+
// fail. This is a Git bug with a forthcoming fix. For now, we use `parse_spec_no_baseline`
102+
// for them when tests are run that way with known-affected Git versions. For details, see:
103+
//
104+
// - https://lore.kernel.org/git/[email protected]/T/
105+
// - https://lore.kernel.org/git/[email protected]/T/
106+
// - https://github.com/GitoxideLabs/gitoxide/issues/1622#issuecomment-2529580735
107+
let skip_some_baselines = is_ci::cached()
108+
&& std::env::var_os("GIX_TEST_IGNORE_ARCHIVES").is_some()
109+
&& ((2, 47, 0)..(2, 47, 2)).contains(gix_testtools::GIT_VERSION.borrow());
110+
111+
if skip_some_baselines {
103112
assert_eq!(
104113
parse_spec_no_baseline(":/mes.age", &repo).unwrap(),
105114
Spec::from_id(hex_to_id("ef80b4b77b167f326351c93284dc0eb00dd54ff4").attach(&repo))
@@ -116,7 +125,7 @@ mod find_youngest_matching_commit {
116125
"None of 10 commits reached from all references matched regex \"not there\""
117126
);
118127

119-
if is_in_test_ci_workflow {
128+
if skip_some_baselines {
120129
assert_eq!(
121130
parse_spec_no_baseline(":/!-message", &repo).unwrap(),
122131
Spec::from_id(hex_to_id("55e825ebe8fd2ff78cad3826afb696b96b576a7e").attach(&repo))

0 commit comments

Comments
 (0)