Skip to content

Commit

Permalink
Fix integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
myieye committed Apr 26, 2024
1 parent ec3b763 commit 375907c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions backend/Testing/Fixtures/IntegrationFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ private static void DeletePreviousTestFiles()

private void InitTemplateRepo()
{
if (TemplateRepo.Exists) return;
using var stream = TemplateRepoZip.OpenRead();
ZipFile.ExtractToDirectory(stream, TemplateRepo.FullName);
}
Expand Down
5 changes: 3 additions & 2 deletions backend/Testing/Services/Utils.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Runtime.CompilerServices;
using System.Text.RegularExpressions;
using Quartz.Util;
using Shouldly;
using Testing.ApiTests;
using static Testing.Services.Constants;
Expand All @@ -26,7 +27,7 @@ public static ProjectConfig GetNewProjectConfig(HgProtocol? protocol = null, [Ca
var id = Guid.NewGuid();
var shortId = id.ToString().Split("-")[0];
var projectCode = $"{ToProjectCodeFriendlyString(projectName)}-{shortId}-dev-flex";
var dir = GetNewProjectDir(projectCode, projectName);
var dir = GetNewProjectDir(projectCode, "");
return new ProjectConfig(id, projectName, projectCode, dir);
}

Expand Down Expand Up @@ -90,7 +91,7 @@ public static async Task WaitForLexboxMetadataUpdateAsync()
private static string GetNewProjectDir(string projectCode,
[CallerMemberName] string projectName = "")
{
var projectDir = Path.Join(BasePath, projectName);
var projectDir = projectName.IsNullOrWhiteSpace() ? BasePath : Path.Join(BasePath, projectName);
// Add a random id to the path to be certain we prevent naming clashes
var randomIndexedId = $"{_folderIndex++}-{Guid.NewGuid().ToString().Split("-")[0]}";
//fwdata file containing folder name will be the same as the file name
Expand Down

0 comments on commit 375907c

Please sign in to comment.