Skip to content

Commit

Permalink
Attempt at having differential paths in C# code for local and git
Browse files Browse the repository at this point in the history
  • Loading branch information
HamishBrownPFR committed Mar 26, 2024
1 parent ca678ea commit 8175d87
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions TestComponents/Test.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,29 @@ public class Test
{
public static void RunAllTests()
{
string fullroot = AppDomain.CurrentDomain.BaseDirectory;
List<string> rootFrags = fullroot.Split('\\').ToList();
string path = "";
string root = "";
foreach (string d in rootFrags)
if (Environment.GetEnvironmentVariable("GITHUB_WORKSPACE") == null)
{
if (d == "FieldNBalance")
break;
else
root += d + "\\";
string fullroot = AppDomain.CurrentDomain.BaseDirectory;
List<string> rootFrags = fullroot.Split('\\').ToList();

foreach (string d in rootFrags)
{
if (d == "FieldNBalance")
break;
else
root += d + "\\";
}
path = Path.Join(root, "FieldNBalance", "TestComponents", "TestSets");
}
string path = Path.Join(root, "FieldNBalance", "TestComponents", "TestSets");
else
{
root = Environment.GetEnvironmentVariable("GITHUB_WORKSPACE");

Check warning on line 38 in TestComponents/Test.cs

View workflow job for this annotation

GitHub Actions / build

Converting null literal or possible null value to non-nullable type.

Check warning on line 38 in TestComponents/Test.cs

View workflow job for this annotation

GitHub Actions / build

Converting null literal or possible null value to non-nullable type.
path = Path.Join(root, "TestComponents", "TestSets");
}


List<string> sets = new List<string> { "WS2", "Residues", "Location", "Moisture" };

//Delete graphs from previous test run
Expand Down

0 comments on commit 8175d87

Please sign in to comment.