@@ -67,21 +67,40 @@ mod find_youngest_matching_commit {
67
67
fn contained_string_matches() {
68
68
let repo = repo("complex_graph").unwrap();
69
69
70
-
assert_eq!(
71
-
parse_spec(":/message", &repo).unwrap(),
72
-
Spec::from_id(hex_to_id("ef80b4b77b167f326351c93284dc0eb00dd54ff4").attach(&repo))
73
-
);
70
+
// See the comment on `skip_some_baselines` in the `regex_matches` test function below.
71
+
let skip_some_baselines = !is_ci::cached()
72
+
&& std::env::var_os("GIX_TEST_IGNORE_ARCHIVES").is_some()
73
+
&& ((2, 47, 0)..(2, 48, 0)).contains(&gix_testtools::GIT_VERSION);
74
+
75
+
if skip_some_baselines {
76
+
assert_eq!(
77
+
parse_spec_no_baseline(":/message", &repo).unwrap(),
78
+
Spec::from_id(hex_to_id("ef80b4b77b167f326351c93284dc0eb00dd54ff4").attach(&repo))
79
+
);
80
+
} else {
81
+
assert_eq!(
82
+
parse_spec(":/message", &repo).unwrap(),
83
+
Spec::from_id(hex_to_id("ef80b4b77b167f326351c93284dc0eb00dd54ff4").attach(&repo))
84
+
);
85
+
}
74
86
75
87
assert_eq!(
76
88
parse_spec("@^{/!-B}", &repo).unwrap(),
77
89
Spec::from_id(hex_to_id("55e825ebe8fd2ff78cad3826afb696b96b576a7e").attach(&repo)),
78
90
"negations work as well"
79
91
);
80
92
81
-
assert_eq!(
82
-
parse_spec(":/!-message", &repo).unwrap(),
83
-
Spec::from_id(hex_to_id("55e825ebe8fd2ff78cad3826afb696b96b576a7e").attach(&repo))
84
-
);
93
+
if skip_some_baselines {
94
+
assert_eq!(
95
+
parse_spec_no_baseline(":/!-message", &repo).unwrap(),
96
+
Spec::from_id(hex_to_id("55e825ebe8fd2ff78cad3826afb696b96b576a7e").attach(&repo))
97
+
);
98
+
} else {
99
+
assert_eq!(
100
+
parse_spec(":/!-message", &repo).unwrap(),
101
+
Spec::from_id(hex_to_id("55e825ebe8fd2ff78cad3826afb696b96b576a7e").attach(&repo))
102
+
);
103
+
}
85
104
86
105
assert_eq!(
87
106
parse_spec_no_baseline(":/messa.e", &repo).unwrap_err().to_string(),
@@ -95,16 +114,21 @@ mod find_youngest_matching_commit {
95
114
fn regex_matches() {
96
115
let repo = repo("complex_graph").unwrap();
97
116
98
-
// The full Linux CI `test` job regenerates baselines instead of taking them from archives.
99
-
// Traversal order with `:/` is broken in Git 2.47.*, so some `parse_spec` assertions fail.
100
-
// The fix is in Git 2.48.* but is not backported. For now, we use `parse_spec_no_baseline`
101
-
// in affected test cases when they are run on CI with Git 2.47.*. For details, see:
117
+
// Traversal order with `:/` was broken in Git 2.47.*, so some `parse_spec` assertions
118
+
// fail. The fix is in Git 2.48.* but is not backported. This causes incorrect baselines to
119
+
// be computed when `GIX_TEST_IGNORE_ARCHIVES` is set. If that is not set, then archived
120
+
// baselines are used and there is no problem. On CI, we assume a sufficiently new version
121
+
// of Git. Otherwise, if `GIX_TEST_IGNORE_ARCHIVES` is set and Git 2.47.* is used, we skip
122
+
// the baseline check, to allow the rest of the test to proceed. This accommodates local
123
+
// development environments with a system-provided Git 2.47.*, though archives generated on
124
+
// such a system should not be committed, as they would still contain incorrect baselines.
125
+
// Please note that this workaround may be removed in the future. For more details, see:
102
126
//
103
127
// - https://lore.kernel.org/git/Z1LJSADiStlFicTL@pks.im/T/
104
128
// - https://lore.kernel.org/git/Z1LtS-8f8WZyobz3@pks.im/T/
105
129
// - https://github.com/git/git/blob/v2.48.0/Documentation/RelNotes/2.48.0.txt#L294-L296
106
130
// - https://github.com/GitoxideLabs/gitoxide/issues/1622
107
-
let skip_some_baselines = is_ci::cached()
131
+
let skip_some_baselines = !is_ci::cached()
108
132
&& std::env::var_os("GIX_TEST_IGNORE_ARCHIVES").is_some()
109
133
&& ((2, 47, 0)..(2, 48, 0)).contains(&gix_testtools::GIT_VERSION);
110
134
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4