Fixes issue where string params for testfixtures causes logfilenames to fail

This commit is contained in:
Ben 2025-08-13 10:49:43 +02:00
parent c8494f3fed
commit 07c25142c1
No known key found for this signature in database
GPG Key ID: 0F16E812E736C24B
2 changed files with 10 additions and 3 deletions

View File

@ -22,9 +22,13 @@ namespace CodexReleaseTests.DataTests
[Test] [Test]
[Combinatorial] [Combinatorial]
public void Theseus( public void Theseus(
[Values(1, 2, 5)] int remainingNodes,
[Values(10)] int steps) [Values(10)] int steps)
{ {
nodes.AddRange(StartCodex(3)); Assert.That(remainingNodes, Is.GreaterThan(0));
Assert.That(steps, Is.GreaterThan(remainingNodes + 1));
nodes.AddRange(StartCodex(remainingNodes + 1));
cid = nodes.First().UploadFile(file); cid = nodes.First().UploadFile(file);
AllNodesHaveFile(); AllNodesHaveFile();

View File

@ -32,7 +32,7 @@ namespace DistTestCore
if (fullName.Contains("AdhocContext")) return "none"; if (fullName.Contains("AdhocContext")) return "none";
var name = fullName.Substring(0, fullName.LastIndexOf('.')); var name = fullName.Substring(0, fullName.LastIndexOf('.'));
name += FormatArguments(test); name += FormatArguments(test);
return name.Replace('.', '-').Replace(',', '-'); return ReplaceInvalidCharacters(name);
} }
public static string GetCategoryName() public static string GetCategoryName()
@ -80,7 +80,10 @@ namespace DistTestCore
.Replace("-dist-tests", "") .Replace("-dist-tests", "")
.Replace(":", "_") .Replace(":", "_")
.Replace("/", "_") .Replace("/", "_")
.Replace("\\", "_"); .Replace("\\", "_")
.Replace("\"", "")
.Replace('.', '-')
.Replace(',', '-');
} }
private static string DetermineFolder(LogConfig config, DateTime start) private static string DetermineFolder(LogConfig config, DateTime start)