Skip to content

Commit

Permalink
changed test again for github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
natekford committed Jan 25, 2024
1 parent 13f86c4 commit e98c602
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/NarrativeCharts.Tests/Scripting/Scripting_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ public async Task DrawScripts_NoRedrawing()
var scripts = Enumerable.Repeat(0, 5)
.Select(_ => new FakeScriptConverter())
.ToList();
// because github actions runs very fast
await Task.Delay(5).ConfigureAwait(true);
CreateFakeFiles(defs, scripts[..2]);
await CreateFakeFilesAsync(defs, scripts[..2]).ConfigureAwait(true);

var info = await DrawAsync(defs, scripts).ConfigureAwait(true);

Expand All @@ -65,7 +63,7 @@ public async Task DrawScripts_NoRedrawing_HighComparison()
var scripts = Enumerable.Repeat(0, 5)
.Select(_ => new FakeScriptConverter())
.ToList();
CreateFakeFiles(defs, scripts[..2]);
await CreateFakeFilesAsync(defs, scripts[..2]).ConfigureAwait(true);

var info = await DrawAsync(defs, scripts).ConfigureAwait(true);

Expand All @@ -83,7 +81,7 @@ public async Task DrawScripts_NoRedrawing_LowComparison()
var scripts = Enumerable.Repeat(0, 5)
.Select(_ => new FakeScriptConverter())
.ToList();
CreateFakeFiles(defs, scripts[..2]);
await CreateFakeFilesAsync(defs, scripts[..2]).ConfigureAwait(true);

var info = await DrawAsync(defs, scripts).ConfigureAwait(true);

Expand All @@ -100,7 +98,7 @@ public async Task DrawScripts_RedrawIfFirstEdited()
.Select(_ => new FakeScriptConverter())
.Prepend(new FakeScriptConverter(DateTime.UtcNow + TimeSpan.FromHours(1)))
.ToList();
CreateFakeFiles(defs, scripts);
await CreateFakeFilesAsync(defs, scripts).ConfigureAwait(true);

var info = await DrawAsync(defs, scripts).ConfigureAwait(true);

Expand Down Expand Up @@ -183,10 +181,12 @@ public async Task ScriptDefinitionsSaveAndLoad_Valid()
[GeneratedRegex(@"P(\d+)V(\d+)")]
private static partial Regex BookNumberRegex();

private void CreateFakeFiles(
private async Task CreateFakeFilesAsync(
ScriptDefinitions defs,
IEnumerable<FakeScriptConverter> scripts)
{
// because github actions runs very fast
await Task.Delay(5).ConfigureAwait(true);
foreach (var script in scripts)
{
var path = Path.Combine(defs.ScriptDirectory, CHARTS_DIR, $"{script.Name}.png");
Expand Down

0 comments on commit e98c602

Please sign in to comment.