diff --git a/TestComponents/Test.cs b/TestComponents/Test.cs index e910a5f..e99ff1b 100644 --- a/TestComponents/Test.cs +++ b/TestComponents/Test.cs @@ -17,17 +17,29 @@ public class Test { public static void RunAllTests() { - string fullroot = AppDomain.CurrentDomain.BaseDirectory; - List 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 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"); + path = Path.Join(root, "TestComponents", "TestSets"); + } + + List sets = new List { "WS2", "Residues", "Location", "Moisture" }; //Delete graphs from previous test run