github-runner: fix test execution on build (#358445)

This commit is contained in:
Weijia Wang 2024-11-24 13:22:25 +01:00 committed by GitHub
commit b4088ccab5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,11 +1,14 @@
--- a/src/Test/L0/TestUtil.cs --- a/src/Test/L0/TestUtil.cs
+++ b/src/Test/L0/TestUtil.cs +++ b/src/Test/L0/TestUtil.cs
@@ -29,7 +29,7 @@ @@ -27,11 +27,8 @@
public static string GetSrcPath()
{ {
string L0dir = Path.GetDirectoryName(GetTestFilePath()); - string L0dir = Path.GetDirectoryName(GetTestFilePath());
string testDir = Path.GetDirectoryName(L0dir); - string testDir = Path.GetDirectoryName(L0dir);
- string srcDir = Path.GetDirectoryName(testDir); - string srcDir = Path.GetDirectoryName(testDir);
+ string srcDir = "/build/src" + Path.GetDirectoryName(testDir).Substring(2); + string srcDir = "../../../../..";
ArgUtil.Directory(srcDir, nameof(srcDir)); ArgUtil.Directory(srcDir, nameof(srcDir));
Assert.Equal(Src, Path.GetFileName(srcDir)); - Assert.Equal(Src, Path.GetFileName(srcDir));
return srcDir; return srcDir;
}