Skip to content

Commit 471f884

Browse files
committed
Fail localization test with inconclusive.
To avoid breaking the build, which happens for almost all pull requests of new units that do not have the Russian translations. Using inconclusive flags the test so it is easy to spot, but does not prevent the test from succeeding overall. Consider moving back to failing when a better solution for translations and/or pull request reviews is found.
1 parent 01212e5 commit 471f884

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

Tests/UnitSystemTests.cs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,18 @@ public void AllUnitAbbreviationsImplemented([Values("", "en-US", "nb-NO", "ru-RU
4949
unitsMissingAbbreviations.Add(unit);
5050
}
5151
}
52-
53-
Assert.IsEmpty(unitsMissingAbbreviations,
54-
"Units missing abbreviations: " + string.Join(", ", unitsMissingAbbreviations.Select(u => u.ToString()).ToArray()));
52+
53+
// We want to flag if any localizations are missing, but not break the build
54+
// or flag an error for pull requests. For now they are not considered
55+
// critical and it is cumbersome to have a third person review the pull request
56+
// and add in any translations before merging it in.
57+
if (unitsMissingAbbreviations.Any())
58+
{
59+
string message = "Units missing abbreviations: " +
60+
string.Join(", ", unitsMissingAbbreviations.Select(u => u.ToString()).ToArray());
61+
Assert.Inconclusive("Failed, but skipping error for localization: " + message);
62+
}
63+
//Assert.IsEmpty(unitsMissingAbbreviations, message);
5564
}
5665

5766
[Test]

0 commit comments

Comments
 (0)