Skip to content

Commit

Permalink
Revert RootDirectory
Browse files Browse the repository at this point in the history
  • Loading branch information
Premek Vysoky committed Mar 16, 2020
1 parent c38b390 commit 9143073
Show file tree
Hide file tree
Showing 11 changed files with 92 additions and 100 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class BCLTestImportTargetFactory {
public BCLTestImportTargetFactory (Harness harness)
{
Harness = harness;
var outputDir = Path.GetFullPath (Path.Combine (DirectoryUtilities.RootDirectory, "bcl-test"));
var outputDir = Path.GetFullPath (Path.Combine (Harness.RootDirectory, "bcl-test"));
var projectTemplatePath = outputDir;
var registerTypesTemplatePath = Path.Combine (outputDir, "RegisterType.cs.in");
var plistTemplatePath = outputDir;
Expand Down
2 changes: 1 addition & 1 deletion tests/xharness/BCLTestImporter/BCLTestProjectGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public class BclTestProjectInfo {
new BclTestProjectInfo { Name = "mscorlib Part 3", assemblies = new [] { "monotouch_corlib_xunit-test.part3.dll" }, Group = "mscorlib Part 3" },
new BclTestProjectInfo { Name = "SystemCoreXunit Part 1", assemblies = new [] { "monotouch_System.Core_xunit-test.part1.dll" }, Group = "SystemCoreXunit Part 1" },
new BclTestProjectInfo { Name = "SystemCoreXunit Part 2", assemblies = new [] { "monotouch_System.Core_xunit-test.part2.dll" }, Group = "SystemCoreXunit Part 2" },
new BclTestProjectInfo { Name = "SystemXunit", assemblies = new [] { "monotouch_System_xunit-test.dll" }, ExtraArgs = $"--xml={Path.Combine (DirectoryUtilities.RootDirectory, "bcl-test", "SystemXunitLinker.xml")} --optimize=-custom-attributes-removal", Group = "SystemXunit" }, // special case due to the need of the extra args
new BclTestProjectInfo { Name = "SystemXunit", assemblies = new [] { "monotouch_System_xunit-test.dll" }, ExtraArgs = $"--xml={Path.Combine (Harness.RootDirectory, "bcl-test", "SystemXunitLinker.xml")} --optimize=-custom-attributes-removal", Group = "SystemXunit" }, // special case due to the need of the extra args
};

static readonly List <string> CommonIgnoredAssemblies = new List <string> {
Expand Down
70 changes: 49 additions & 21 deletions tests/xharness/Harness.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public class Harness : IHarness
public IProcessManager ProcessManager { get; }

public string XIBuildPath {
get { return Path.GetFullPath (Path.Combine (DirectoryUtilities.RootDirectory, "..", "tools", "xibuild", "xibuild")); }
get { return Path.GetFullPath (Path.Combine (Harness.RootDirectory, "..", "tools", "xibuild", "xibuild")); }
}

public static string Timestamp {
Expand All @@ -73,6 +73,34 @@ public static string Timestamp {
}
}

// This is the maccore/tests directory.
static string root_directory;
public static string RootDirectory {
get {
if (root_directory == null) {
var testAssemblyDirectory = Path.GetDirectoryName (System.Reflection.Assembly.GetExecutingAssembly ().Location);
var dir = testAssemblyDirectory;
var path = Path.Combine (testAssemblyDirectory, ".git");
while (!Directory.Exists (path) && path.Length > 3) {
dir = Path.GetDirectoryName (dir);
path = Path.Combine (dir, ".git");
}
if (!Directory.Exists (path))
throw new Exception ("Could not find the xamarin-macios repo.");
path = Path.Combine (Path.GetDirectoryName (path), "tests");
if (!Directory.Exists (path))
throw new Exception ("Could not find the tests directory.");
root_directory = path;
}
return root_directory;
}
set {
root_directory = value;
if (root_directory != null)
root_directory = Path.GetFullPath (root_directory).TrimEnd ('/');
}
}

public List<iOSTestProject> IOSTestProjects { get; }
public List<MacTestProject> MacTestProjects { get; } = new List<MacTestProject> ();

Expand Down Expand Up @@ -223,7 +251,7 @@ public string MlaunchPath {
void LoadConfig ()
{
ParseConfigFiles ();
var src_root = Path.GetDirectoryName (Path.GetFullPath (DirectoryUtilities.RootDirectory));
var src_root = Path.GetDirectoryName (Path.GetFullPath (Harness.RootDirectory));
MONO_PATH = Path.GetFullPath (Path.Combine (src_root, "external", "mono"));
TVOS_MONO_PATH = MONO_PATH;
INCLUDE_IOS = make_config.ContainsKey ("INCLUDE_IOS") && !string.IsNullOrEmpty (make_config ["INCLUDE_IOS"]);
Expand All @@ -250,13 +278,13 @@ int AutoConfigureMac (bool generate_projects)
new { Directory = "linker/mac/dont link", ProjectFile = "dont link-mac", Name = "dont link", Flavors = MacFlavors.Modern | MacFlavors.Full | MacFlavors.System },
};
foreach (var p in test_suites) {
MacTestProjects.Add (new MacTestProject (Path.GetFullPath (Path.Combine (DirectoryUtilities.RootDirectory, p.Directory, p.ProjectFile + ".csproj"))) {
MacTestProjects.Add (new MacTestProject (Path.GetFullPath (Path.Combine (Harness.RootDirectory, p.Directory, p.ProjectFile + ".csproj"))) {
Name = p.Name,
TargetFrameworkFlavors = p.Flavors,
});
}

MacTestProjects.Add (new MacTestProject (Path.GetFullPath (Path.Combine (DirectoryUtilities.RootDirectory, "introspection", "Mac", "introspection-mac.csproj")), targetFrameworkFlavor: MacFlavors.Modern) { Name = "introspection" });
MacTestProjects.Add (new MacTestProject (Path.GetFullPath (Path.Combine (Harness.RootDirectory, "introspection", "Mac", "introspection-mac.csproj")), targetFrameworkFlavor: MacFlavors.Modern) { Name = "introspection" });

var hard_coded_test_suites = new [] {
new { Directory = "mmptest", ProjectFile = "mmptest", Name = "mmptest", IsNUnit = true, Configurations = (string[]) null, Platform = "x86", Flavors = MacFlavors.Console, },
Expand All @@ -266,10 +294,10 @@ int AutoConfigureMac (bool generate_projects)
new { Directory = "linker/mac/link sdk", ProjectFile = "link sdk-mac", Name = "link sdk", IsNUnit = false, Configurations = new string [] { "Debug", "Release" }, Platform = "x86", Flavors = MacFlavors.Modern, },
};
foreach (var p in hard_coded_test_suites) {
MacTestProjects.Add (new MacTestProject (Path.GetFullPath (Path.Combine (DirectoryUtilities.RootDirectory, p.Directory, p.ProjectFile + ".csproj")), targetFrameworkFlavor: p.Flavors) {
MacTestProjects.Add (new MacTestProject (Path.GetFullPath (Path.Combine (Harness.RootDirectory, p.Directory, p.ProjectFile + ".csproj")), targetFrameworkFlavor: p.Flavors) {
Name = p.Name,
IsNUnitProject = p.IsNUnit,
SolutionPath = Path.GetFullPath (Path.Combine (DirectoryUtilities.RootDirectory, "tests-mac.sln")),
SolutionPath = Path.GetFullPath (Path.Combine (Harness.RootDirectory, "tests-mac.sln")),
Configurations = p.Configurations,
Platform = p.Platform,
});
Expand Down Expand Up @@ -368,18 +396,18 @@ void AutoConfigureIOS ()
var fsharp_library_projects = new string [] { "fsharplibrary" };

foreach (var p in test_suites)
IOSTestProjects.Add (new iOSTestProject (Path.GetFullPath (Path.Combine (DirectoryUtilities.RootDirectory, p + "/" + p + ".csproj"))) { Name = p });
IOSTestProjects.Add (new iOSTestProject (Path.GetFullPath (Path.Combine (Harness.RootDirectory, p + "/" + p + ".csproj"))) { Name = p });
foreach (var p in fsharp_test_suites)
IOSTestProjects.Add (new iOSTestProject (Path.GetFullPath (Path.Combine (DirectoryUtilities.RootDirectory, p + "/" + p + ".fsproj"))) { Name = p });
IOSTestProjects.Add (new iOSTestProject (Path.GetFullPath (Path.Combine (Harness.RootDirectory, p + "/" + p + ".fsproj"))) { Name = p });
foreach (var p in library_projects)
IOSTestProjects.Add (new iOSTestProject (Path.GetFullPath (Path.Combine (DirectoryUtilities.RootDirectory, p + "/" + p + ".csproj")), false) { Name = p });
IOSTestProjects.Add (new iOSTestProject (Path.GetFullPath (Path.Combine (Harness.RootDirectory, p + "/" + p + ".csproj")), false) { Name = p });
foreach (var p in fsharp_library_projects)
IOSTestProjects.Add (new iOSTestProject (Path.GetFullPath (Path.Combine (DirectoryUtilities.RootDirectory, p + "/" + p + ".fsproj")), false) { Name = p });
IOSTestProjects.Add (new iOSTestProject (Path.GetFullPath (Path.Combine (Harness.RootDirectory, p + "/" + p + ".fsproj")), false) { Name = p });

IOSTestProjects.Add (new iOSTestProject (Path.GetFullPath (Path.Combine (DirectoryUtilities.RootDirectory, "introspection", "iOS", "introspection-ios.csproj"))) { Name = "introspection" });
IOSTestProjects.Add (new iOSTestProject (Path.GetFullPath (Path.Combine (DirectoryUtilities.RootDirectory, "linker", "ios", "dont link", "dont link.csproj"))) { Configurations = new string [] { "Debug", "Release" } });
IOSTestProjects.Add (new iOSTestProject (Path.GetFullPath (Path.Combine (DirectoryUtilities.RootDirectory, "linker", "ios", "link all", "link all.csproj"))) { Configurations = new string [] { "Debug", "Release" } });
IOSTestProjects.Add (new iOSTestProject (Path.GetFullPath (Path.Combine (DirectoryUtilities.RootDirectory, "linker", "ios", "link sdk", "link sdk.csproj"))) { Configurations = new string [] { "Debug", "Release" } });
IOSTestProjects.Add (new iOSTestProject (Path.GetFullPath (Path.Combine (Harness.RootDirectory, "introspection", "iOS", "introspection-ios.csproj"))) { Name = "introspection" });
IOSTestProjects.Add (new iOSTestProject (Path.GetFullPath (Path.Combine (Harness.RootDirectory, "linker", "ios", "dont link", "dont link.csproj"))) { Configurations = new string [] { "Debug", "Release" } });
IOSTestProjects.Add (new iOSTestProject (Path.GetFullPath (Path.Combine (Harness.RootDirectory, "linker", "ios", "link all", "link all.csproj"))) { Configurations = new string [] { "Debug", "Release" } });
IOSTestProjects.Add (new iOSTestProject (Path.GetFullPath (Path.Combine (Harness.RootDirectory, "linker", "ios", "link sdk", "link sdk.csproj"))) { Configurations = new string [] { "Debug", "Release" } });

foreach (var flavor in new MonoNativeFlavor[] { MonoNativeFlavor.Compat, MonoNativeFlavor.Unified }) {
var monoNativeInfo = new MonoNativeInfo (this, flavor);
Expand All @@ -396,19 +424,19 @@ void AutoConfigureIOS ()
var monoImportTestFactory = new BCLTestImportTargetFactory (this);
IOSTestProjects.AddRange (monoImportTestFactory.GetiOSBclTargets ());

WatchOSContainerTemplate = Path.GetFullPath (Path.Combine (DirectoryUtilities.RootDirectory, "templates/WatchContainer"));
WatchOSAppTemplate = Path.GetFullPath (Path.Combine (DirectoryUtilities.RootDirectory, "templates/WatchApp"));
WatchOSExtensionTemplate = Path.GetFullPath (Path.Combine (DirectoryUtilities.RootDirectory, "templates/WatchExtension"));
WatchOSContainerTemplate = Path.GetFullPath (Path.Combine (Harness.RootDirectory, "templates/WatchContainer"));
WatchOSAppTemplate = Path.GetFullPath (Path.Combine (Harness.RootDirectory, "templates/WatchApp"));
WatchOSExtensionTemplate = Path.GetFullPath (Path.Combine (Harness.RootDirectory, "templates/WatchExtension"));

TodayContainerTemplate = Path.GetFullPath (Path.Combine (DirectoryUtilities.RootDirectory, "templates", "TodayContainer"));
TodayExtensionTemplate = Path.GetFullPath (Path.Combine (DirectoryUtilities.RootDirectory, "templates", "TodayExtension"));
BCLTodayExtensionTemplate = Path.GetFullPath (Path.Combine (DirectoryUtilities.RootDirectory, "bcl-test", "templates", "today"));
TodayContainerTemplate = Path.GetFullPath (Path.Combine (Harness.RootDirectory, "templates", "TodayContainer"));
TodayExtensionTemplate = Path.GetFullPath (Path.Combine (Harness.RootDirectory, "templates", "TodayExtension"));
BCLTodayExtensionTemplate = Path.GetFullPath (Path.Combine (Harness.RootDirectory, "bcl-test", "templates", "today"));
}

Dictionary<string, string> make_config = new Dictionary<string, string> ();
IEnumerable<string> FindConfigFiles (string name)
{
var dir = Path.GetFullPath (DirectoryUtilities.RootDirectory);
var dir = Path.GetFullPath (Harness.RootDirectory);
while (dir != "/") {
var file = Path.Combine (dir, name);
if (File.Exists (file))
Expand Down
Loading

5 comments on commit 9143073

@xamarin-release-manager
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 Device tests completed (Failed) on iOS on Azure DevOps(iOS): Html Report 🔥

Test results

161 tests' device not found, 150 tests passed.

@xamarin-release-manager
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build was (probably) aborted

🔥 Jenkins job (on internal Jenkins) failed in stage(s) 'Running XM tests on '10.10', Running XM tests on '10.10'' 🔥

Build succeeded
✅ Packages:

API Diff (from stable)
API Diff (from PR only) (no change)
ℹ️ Generator Diff (please review changes)
🔥 Xamarin.Mac tests on 10.10 failed: Xamarin.Mac tests on macOS 10.10 failed (xammac_tests) 🔥
🔥 Test run failed 🔥

Test results

3 tests failed, 182 tests passed.

Failed tests

  • monotouch-test/iOS Unified 64-bits - simulator/Debug (static registrar): Failed
  • monotouch-test/iOS Unified 64-bits - simulator/Release (all optimizations): Failed
  • introspection/tvOS - simulator/Debug (tvOS 10.2): TimedOut

@xamarin-release-manager
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚧 Experimental DDFun pipeline

🔥 Device tests completed (Failed) on iOS-DDFun on Azure DevOps(iOS-DDFun) 🔥

Test results

1 tests failed, 149 tests passed.

Failed tests

  • monotouch-test/iOS Unified 64-bits - device/Release (all optimizations): Failed

@xamarin-release-manager
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 Device tests completed (Failed) on iOS32b on Azure DevOps(iOS32b): Html Report 🔥

Test results

21 tests failed, 140 tests passed.

Failed tests

  • [xUnit] Mono BCL tests group 4/iOS Unified 32-bits - device/Debug: Failed
  • mscorlib Part 1/iOS Unified 32-bits - device/Debug: TimedOut
  • mscorlib Part 2/iOS Unified 32-bits - device/Debug: Failed
  • dont link/iOS Unified 32-bits - device/AssemblyBuildTarget: SDK framework (release): Crashed
  • [NUnit] Mono BCL tests group 2/iOS Unified 32-bits - device/Release: UseThumb: TimedOut
  • [xUnit] Mono BCL tests group 4/iOS Unified 32-bits - device/AssemblyBuildTarget: dylib (debug): Failed
  • [xUnit] Mono BCL tests group 4/iOS Unified 32-bits - device/AssemblyBuildTarget: SDK framework (debug): Failed
  • [xUnit] Mono BCL tests group 4/iOS Unified 32-bits - device/AssemblyBuildTarget: dylib (debug, profiling): Failed
  • [xUnit] Mono BCL tests group 4/iOS Unified 32-bits - device/AssemblyBuildTarget: SDK framework (debug, profiling): Failed
  • mscorlib Part 1/iOS Unified 32-bits - device/AssemblyBuildTarget: dylib (debug, profiling): TimedOut
  • mscorlib Part 1/iOS Unified 32-bits - device/Release: BuildFailure
  • mscorlib Part 1/iOS Unified 32-bits - device/Release: UseThumb: BuildFailure
  • mscorlib Part 1/iOS Unified 32-bits - device/AssemblyBuildTarget: SDK framework (release): BuildFailure
  • mscorlib Part 2/iOS Unified 32-bits - device/AssemblyBuildTarget: dylib (debug): Failed
  • mscorlib Part 2/iOS Unified 32-bits - device/AssemblyBuildTarget: SDK framework (debug): Failed
  • mscorlib Part 2/iOS Unified 32-bits - device/AssemblyBuildTarget: dylib (debug, profiling): Failed
  • mscorlib Part 2/iOS Unified 32-bits - device/AssemblyBuildTarget: SDK framework (debug, profiling): Failed
  • mscorlib Part 2/iOS Unified 32-bits - device/Release: Failed
  • mscorlib Part 2/iOS Unified 32-bits - device/Release: UseThumb: Failed
  • mscorlib Part 2/iOS Unified 32-bits - device/AssemblyBuildTarget: SDK framework (release): Failed
  • mscorlib Part 2/iOS Unified 32-bits - device/Debug: SGenConc: Failed

@xamarin-release-manager
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 Device tests completed (Failed) on TvOS on Azure DevOps(TvOS): Html Report 🔥

Test results

3 tests failed, 147 tests passed.

Failed tests

  • monotouch-test/tvOS - device/AssemblyBuildTarget: SDK framework (release): Failed
  • monotouch-test/tvOS - device/Debug (dynamic registrar): Failed
  • monotouch-test/tvOS - device/Debug (all optimizations): Failed

Please sign in to comment.