[tests/devops] Remove logic to build samples. (#21267)
It's old, hasn't been executed in years and quite bitrotten by now (it only builds legacy Xamarin samples for instance). We could port it to .NET, but first we'd need sample apps, and there aren't many of those yet.
This commit is contained in:
Родитель
d588d3d2cd
Коммит
cabb3e5e5e
|
@ -1,3 +0,0 @@
|
|||
TestResult*.html
|
||||
TestResult*.xml
|
||||
.failed-stamp
|
|
@ -1,68 +0,0 @@
|
|||
using System.Reflection;
|
||||
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Xamarin.Tests {
|
||||
[TestFixture]
|
||||
[Parallelizable (ParallelScope.Self)]
|
||||
public abstract class BaseTester {
|
||||
string repository;
|
||||
public virtual string Repository {
|
||||
get {
|
||||
if (repository is null)
|
||||
repository = (string) GetType ().GetField ("REPO", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static).GetValue (null);
|
||||
return repository;
|
||||
}
|
||||
protected set {
|
||||
repository = value;
|
||||
}
|
||||
}
|
||||
|
||||
string hash;
|
||||
public virtual string Hash {
|
||||
get {
|
||||
if (hash is null)
|
||||
hash = (string) GetType ().GetField ("HASH", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static).GetValue (null);
|
||||
return hash;
|
||||
}
|
||||
protected set {
|
||||
hash = value;
|
||||
}
|
||||
}
|
||||
|
||||
string org;
|
||||
public virtual string Org {
|
||||
get {
|
||||
if (org is null)
|
||||
org = (string) GetType ().GetField ("ORG", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static)?.GetValue (null) ?? "xamarin";
|
||||
return org;
|
||||
}
|
||||
protected set {
|
||||
org = value;
|
||||
}
|
||||
}
|
||||
|
||||
string default_branch;
|
||||
public virtual string DefaultBranch {
|
||||
get {
|
||||
if (default_branch is null)
|
||||
default_branch = (string) GetType ().GetField ("DEFAULT_BRANCH", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static)?.GetValue (null);
|
||||
return default_branch;
|
||||
|
||||
}
|
||||
set {
|
||||
default_branch = value;
|
||||
}
|
||||
}
|
||||
|
||||
protected BaseTester ()
|
||||
{
|
||||
}
|
||||
|
||||
protected BaseTester (string repository, string hash)
|
||||
{
|
||||
this.repository = repository;
|
||||
this.hash = hash;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,27 +0,0 @@
|
|||
using Foundation;
|
||||
using UIKit;
|
||||
|
||||
namespace BaselineTest {
|
||||
[Register ("AppDelegate")]
|
||||
public class AppDelegate : UIResponder, IUIApplicationDelegate {
|
||||
UIWindow window;
|
||||
UIViewController vc;
|
||||
|
||||
[Export ("application:didFinishLaunchingWithOptions:")]
|
||||
public bool FinishedLaunching (UIApplication application, NSDictionary launchOptions)
|
||||
{
|
||||
window = new UIWindow (UIScreen.MainScreen.Bounds);
|
||||
vc = new UIViewController ();
|
||||
vc.View.BackgroundColor = UIColor.Green;
|
||||
window.RootViewController = vc;
|
||||
window.MakeKeyAndVisible ();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void Main (string [] args)
|
||||
{
|
||||
UIApplication.Main (args, null, typeof (AppDelegate));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,73 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
|
||||
<ProjectGuid>{E7E76A89-6DB7-4CF6-953C-6D9ADC656C6F}</ProjectGuid>
|
||||
<ProjectTypeGuids>{FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<TemplateGuid>{edc1b0fa-90cd-4038-8fad-98fe74adb368}</TemplateGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>BaselineTest</RootNamespace>
|
||||
<AssemblyName>BaselineTest</AssemblyName>
|
||||
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
|
||||
<MtouchEnableSGenConc>true</MtouchEnableSGenConc>
|
||||
<MtouchHttpClientHandler>NSUrlSessionHandler</MtouchHttpClientHandler>
|
||||
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
|
||||
<LangVersion>latest</LangVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\iPhoneSimulator\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<MtouchArch>x86_64</MtouchArch>
|
||||
<MtouchLink>None</MtouchLink>
|
||||
<MtouchDebug>true</MtouchDebug>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\iPhoneSimulator\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<MtouchLink>None</MtouchLink>
|
||||
<MtouchArch>x86_64</MtouchArch>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\iPhone\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<MtouchArch>ARM64</MtouchArch>
|
||||
<CodesignKey>iPhone Developer</CodesignKey>
|
||||
<MtouchDebug>true</MtouchDebug>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\iPhone\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<MtouchArch>ARM64</MtouchArch>
|
||||
<CodesignKey>iPhone Developer</CodesignKey>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Xamarin.iOS" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<InterfaceDefinition Include="LaunchScreen.storyboard" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Info.plist" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AppDelegate.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
|
||||
</Project>
|
|
@ -1,23 +0,0 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BaselineTest", "BaselineTest.csproj", "{E7E76A89-6DB7-4CF6-953C-6D9ADC656C6F}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|iPhoneSimulator = Debug|iPhoneSimulator
|
||||
Release|iPhoneSimulator = Release|iPhoneSimulator
|
||||
Debug|iPhone = Debug|iPhone
|
||||
Release|iPhone = Release|iPhone
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{E7E76A89-6DB7-4CF6-953C-6D9ADC656C6F}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
|
||||
{E7E76A89-6DB7-4CF6-953C-6D9ADC656C6F}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
|
||||
{E7E76A89-6DB7-4CF6-953C-6D9ADC656C6F}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
|
||||
{E7E76A89-6DB7-4CF6-953C-6D9ADC656C6F}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
|
||||
{E7E76A89-6DB7-4CF6-953C-6D9ADC656C6F}.Debug|iPhone.ActiveCfg = Debug|iPhone
|
||||
{E7E76A89-6DB7-4CF6-953C-6D9ADC656C6F}.Debug|iPhone.Build.0 = Debug|iPhone
|
||||
{E7E76A89-6DB7-4CF6-953C-6D9ADC656C6F}.Release|iPhone.ActiveCfg = Release|iPhone
|
||||
{E7E76A89-6DB7-4CF6-953C-6D9ADC656C6F}.Release|iPhone.Build.0 = Release|iPhone
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -1,48 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>BaselineTest</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.xamarin.BaselineTest</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>MinimumOSVersion</key>
|
||||
<string>11.0</string>
|
||||
<key>UIDeviceFamily</key>
|
||||
<array>
|
||||
<integer>1</integer>
|
||||
<integer>2</integer>
|
||||
</array>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>UIMainStoryboardFile~ipad</key>
|
||||
<string>Main</string>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
<array>
|
||||
<string>armv7</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>XSAppIconAssets</key>
|
||||
<string>Assets.xcassets/AppIcon.appiconset</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>BaselineTest</string>
|
||||
</dict>
|
||||
</plist>
|
|
@ -1,27 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9532" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS" />
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9530" />
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="EHf-IW-A2E">
|
||||
<objects>
|
||||
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
|
||||
<layoutGuides>
|
||||
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb" />
|
||||
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok" />
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="600" />
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES" />
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite" />
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder" />
|
||||
</objects>
|
||||
<point key="canvasLocation" x="53" y="375" />
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
|
@ -1,115 +0,0 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Xamarin.Tests {
|
||||
public partial class Configuration {
|
||||
static object lock_obj = new object ();
|
||||
static string sample_root_directory;
|
||||
public static string SampleRootDirectory {
|
||||
get {
|
||||
lock (lock_obj) {
|
||||
if (sample_root_directory is null) {
|
||||
sample_root_directory = Path.Combine (Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location), "repositories");
|
||||
Directory.CreateDirectory (sample_root_directory);
|
||||
CreateNugetConfig (sample_root_directory);
|
||||
CreateGlobalConfig (sample_root_directory);
|
||||
}
|
||||
}
|
||||
return sample_root_directory;
|
||||
}
|
||||
}
|
||||
|
||||
static void CreateNugetConfig (string root)
|
||||
{
|
||||
var nuget_conf = Path.Combine (root, "NuGet.config");
|
||||
// We're cloning into a subdirectory of xamarin-macios, which already has a NuGet.config
|
||||
// So create a Nuget.config that clears out any previous configuration and adds nuget.org as
|
||||
// single nuget source so that none of the sample tests pick up xamarin-macios' NuGet.config.
|
||||
File.WriteAllText (nuget_conf,
|
||||
@"<?xml version=""1.0"" encoding=""utf-8""?>
|
||||
<configuration>
|
||||
<config>
|
||||
<clear />
|
||||
</config>
|
||||
<packageSources>
|
||||
<clear />
|
||||
<add key=""nuget.org"" value=""https://api.nuget.org/v3/index.json"" />
|
||||
</packageSources>
|
||||
<disabledPackageSources>
|
||||
<clear />
|
||||
</disabledPackageSources>
|
||||
</configuration>
|
||||
");
|
||||
}
|
||||
|
||||
static void CreateGlobalConfig (string root)
|
||||
{
|
||||
var global_json = Path.Combine (root, "global.json");
|
||||
// Workaround for https://github.com/NuGet/Home/issues/7956
|
||||
// See also:
|
||||
// * https://github.com/mono/mono/issues/13537
|
||||
// * https://github.com/xamarin/maccore/issues/1811
|
||||
// The version number here must match the version in tools/devops/build-samples.csx
|
||||
File.WriteAllText (global_json,
|
||||
@"{
|
||||
""sdk"": {
|
||||
""version"": ""2.2.204""
|
||||
}
|
||||
}
|
||||
");
|
||||
}
|
||||
|
||||
static string tested_hash;
|
||||
public static string TestedHash {
|
||||
get {
|
||||
lock (lock_obj) {
|
||||
if (tested_hash is not null)
|
||||
return tested_hash;
|
||||
|
||||
tested_hash = GetCurrentHash (Environment.CurrentDirectory);
|
||||
return tested_hash;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static string GetCurrentHash (string directory)
|
||||
{
|
||||
return ProcessHelper.RunProcess ("git", "log -1 --pretty=%H", directory).Trim ();
|
||||
}
|
||||
|
||||
public static string GetCurrentRemoteUrl (string directory)
|
||||
{
|
||||
return ProcessHelper.RunProcess ("git", "remote get-url origin", directory).Trim ();
|
||||
}
|
||||
|
||||
static string mono_version;
|
||||
public static string MonoVersion {
|
||||
get {
|
||||
lock (lock_obj) {
|
||||
if (mono_version is not null)
|
||||
return mono_version;
|
||||
|
||||
// We only care about the first line
|
||||
mono_version = ProcessHelper.RunProcess ("mono", "--version").Split (new char [] { '\n' }, StringSplitOptions.RemoveEmptyEntries) [0].Trim ();
|
||||
}
|
||||
|
||||
return mono_version;
|
||||
}
|
||||
}
|
||||
|
||||
static string sw_version;
|
||||
public static string OSVersion {
|
||||
get {
|
||||
lock (lock_obj) {
|
||||
if (sw_version is not null)
|
||||
return sw_version;
|
||||
|
||||
sw_version = ProcessHelper.RunProcess ("sw_vers").Replace ('\n', ';').Replace ((char) 9, ' ');
|
||||
}
|
||||
|
||||
return sw_version;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,64 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
using NUnit.Framework;
|
||||
|
||||
using Xamarin.Tests;
|
||||
|
||||
public static class GitHub {
|
||||
public static string [] GetProjects (string user, string repo, string hash, string default_branch)
|
||||
{
|
||||
IEnumerable<string> files;
|
||||
|
||||
var dir = CloneRepository (user, repo, hash, default_branch);
|
||||
files = Directory.GetFiles (dir, "*.*", SearchOption.AllDirectories);
|
||||
files = files.Select ((v) => v.Substring (dir.Length).TrimStart ('/'));
|
||||
|
||||
return files
|
||||
.Where ((v) => {
|
||||
var ext = Path.GetExtension (v).ToLowerInvariant ();
|
||||
return ext == ".csproj" || ext == ".fsproj";
|
||||
}).ToArray ();
|
||||
}
|
||||
|
||||
public static string CloneRepository (string org, string repo, string hash, string default_branch, bool clean = true)
|
||||
{
|
||||
var repo_dir = Path.Combine (Configuration.SampleRootDirectory, repo);
|
||||
|
||||
if (!Directory.Exists (repo_dir)) {
|
||||
Console.WriteLine ($"Cloning https://github.com/{org}/{repo} (hash: {hash})");
|
||||
Directory.CreateDirectory (repo_dir);
|
||||
Assert.AreEqual (0, ExecutionHelper.Execute ("git", new string [] { "init" }, working_directory: repo_dir, timeout: TimeSpan.FromSeconds (10)), "git init");
|
||||
Assert.AreEqual (0, ExecutionHelper.Execute ("git", new string [] { "remote", "add", "origin", $"https://github.com/{org}/{repo}" }, working_directory: repo_dir, timeout: TimeSpan.FromSeconds (10)), "git remote add");
|
||||
Assert.AreEqual (0, ExecutionHelper.Execute ("git", new string [] { "fetch" }, working_directory: repo_dir, timeout: TimeSpan.FromMinutes (10)), "git fetch");
|
||||
Assert.AreEqual (0, ExecutionHelper.Execute ("git", new string [] { "checkout", "-b", "temporary-sample-testing-branch", hash }, working_directory: repo_dir, timeout: TimeSpan.FromMinutes (1)), "git checkout");
|
||||
Assert.AreEqual (0, ExecutionHelper.Execute ("git", new string [] { "submodule", "update", "--init", "--recursive" }, working_directory: repo_dir, timeout: TimeSpan.FromMinutes (10)), "git submodule update");
|
||||
|
||||
ExecutionHelper.Execute ("git", new string [] { "log", "--oneline", "--pretty=* @%h %s", "HEAD", $"^origin/{default_branch}" }, out var output1, working_directory: repo_dir, timeout: TimeSpan.FromSeconds (10));
|
||||
if (output1.Length > 0) {
|
||||
Console.WriteLine ($"Commits not in origin/{default_branch}:");
|
||||
Console.WriteLine (output1.ToString ().TrimEnd ('\n'));
|
||||
}
|
||||
ExecutionHelper.Execute ("git", new string [] { "log", "--oneline", "--pretty=* %h %s", $"origin/{default_branch}", "^HEAD" }, out var output2, working_directory: repo_dir, timeout: TimeSpan.FromSeconds (10));
|
||||
if (output2.Length > 0) {
|
||||
Console.WriteLine ($"Commits in origin/{default_branch} not being tested:");
|
||||
Console.WriteLine (output2.ToString ().TrimEnd ('\n'));
|
||||
}
|
||||
|
||||
} else if (clean) {
|
||||
Assert.AreEqual (0, ExecutionHelper.Execute ("git", new string [] { "reset", "--hard", hash }, working_directory: repo_dir, timeout: TimeSpan.FromMinutes (1)), "git checkout");
|
||||
CleanRepository (repo_dir);
|
||||
}
|
||||
|
||||
return repo_dir;
|
||||
}
|
||||
|
||||
public static void CleanRepository (string directory, bool submodules = true)
|
||||
{
|
||||
ExecutionHelper.Execute ("git", new string [] { "clean", "-xffdq" }, working_directory: directory, timeout: TimeSpan.FromSeconds (30));
|
||||
if (submodules)
|
||||
ExecutionHelper.Execute ("git", new string [] { "submodule", "foreach", "--recursive", "clean -xffdq" }, working_directory: directory, timeout: TimeSpan.FromSeconds (60));
|
||||
}
|
||||
}
|
|
@ -1,284 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
<xsl:output omit-xml-declaration="yes" indent="yes" />
|
||||
<xsl:template match="/">
|
||||
<xsl:text disable-output-escaping="yes"><!DOCTYPE html> </xsl:text>
|
||||
<html>
|
||||
<head>
|
||||
<title>Test results</title>
|
||||
<style type="text/css">
|
||||
|
||||
.strong {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.smllabel {
|
||||
width:110px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
td.left {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
td.right {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
li {
|
||||
font-family: monospace
|
||||
}
|
||||
.collapsed
|
||||
{
|
||||
border:0;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<xsl:apply-templates/>
|
||||
</body>
|
||||
</html>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="test-run">
|
||||
|
||||
<!-- Command Line -->
|
||||
<h4>Command Line</h4>
|
||||
<pre>
|
||||
<xsl:value-of select="command-line"/>
|
||||
</pre>
|
||||
|
||||
<!-- Runtime Environment -->
|
||||
<h4>Runtime Environment</h4>
|
||||
|
||||
<table id="runtime">
|
||||
<tr>
|
||||
<td class="smllabel right">OS Version:</td>
|
||||
<td class="left">
|
||||
<xsl:value-of select="test-suite/environment/@os-version[1]"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="smllabel right">CLR Version:</td>
|
||||
<td class="left">
|
||||
<xsl:value-of select="@clr-version"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<xsl:text disable-output-escaping="yes"><![CDATA[ ]]></xsl:text>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="smllabel right">NUnit Version:</td>
|
||||
<td class="left">
|
||||
<xsl:value-of select="@engine-version"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<!-- Test Files -->
|
||||
<div id="testfiles">
|
||||
<h4>Test Files</h4>
|
||||
<xsl:if test="count(test-suite[@type='Assembly']) > 0">
|
||||
<ol>
|
||||
<xsl:for-each select="test-suite[@type='Assembly']">
|
||||
<li>
|
||||
<xsl:value-of select="@fullname"/>
|
||||
</li>
|
||||
</xsl:for-each>
|
||||
</ol>
|
||||
</xsl:if>
|
||||
</div>
|
||||
|
||||
<!-- Successes -->
|
||||
<xsl:if test="//test-case[@result='Passed']">
|
||||
<details>
|
||||
<summary>Successes</summary>
|
||||
<ol>
|
||||
<xsl:apply-templates select="//test-case[@result='Passed']"/>
|
||||
</ol>
|
||||
</details>
|
||||
</xsl:if>
|
||||
|
||||
<!-- Tests Not Run -->
|
||||
<xsl:if test="//test-case[@result='Skipped']">
|
||||
<details>
|
||||
<summary>Tests Not Run</summary>
|
||||
<ol>
|
||||
<xsl:apply-templates select="//test-case[@result='Skipped']"/>
|
||||
</ol>
|
||||
</details>
|
||||
</xsl:if>
|
||||
|
||||
<!-- Errors and Failures -->
|
||||
<xsl:if test="//test-case[failure]">
|
||||
<details>
|
||||
<summary>Errors and Failures</summary>
|
||||
<ol>
|
||||
<xsl:apply-templates select="//test-case[failure]"/>
|
||||
</ol>
|
||||
</details>
|
||||
</xsl:if>
|
||||
|
||||
<!-- Run Settings (gets first one found) -->
|
||||
<xsl:variable name="settings" select ="//settings[1]" />
|
||||
|
||||
<h4>Run Settings</h4>
|
||||
<ul>
|
||||
<li>
|
||||
DefaultTimeout: <xsl:value-of select="$settings/setting[@name='DefaultTimeout']/@value"/>
|
||||
</li>
|
||||
<li>
|
||||
WorkDirectory: <xsl:value-of select="$settings/setting[@name='WorkDirectory']/@value"/>
|
||||
</li>
|
||||
<li>
|
||||
ImageRuntimeVersion: <xsl:value-of select="$settings/setting[@name='ImageRuntimeVersion']/@value"/>
|
||||
</li>
|
||||
<li>
|
||||
ImageTargetFrameworkName: <xsl:value-of select="$settings/setting[@name='ImageTargetFrameworkName']/@value"/>
|
||||
</li>
|
||||
<li>
|
||||
ImageRequiresX86: <xsl:value-of select="$settings/setting[@name='ImageRequiresX86']/@value"/>
|
||||
</li>
|
||||
<li>
|
||||
ImageRequiresDefaultAppDomainAssemblyResolver: <xsl:value-of select="$settings/setting[@name='ImageRequiresDefaultAppDomainAssemblyResolver']/@value"/>
|
||||
</li>
|
||||
<li>
|
||||
NumberOfTestWorkers: <xsl:value-of select="$settings/setting[@name='NumberOfTestWorkers']/@value"/>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h4>Test Run Summary</h4>
|
||||
<table id="summary" class="collapsed">
|
||||
<tr>
|
||||
<td class="smllabel right">Overall result:</td>
|
||||
<td class="left">
|
||||
<xsl:value-of select="@result"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="smllabel right">Test Count:</td>
|
||||
<td class="left">
|
||||
<xsl:value-of select="@total"/>, Passed: <xsl:value-of select="@passed"/>, Failed: <xsl:value-of select="@failed"/>, Inconclusive: <xsl:value-of select="@inconclusive"/>, Skipped: <xsl:value-of select="@skipped"/>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- [Optional] - Failed Test Summary -->
|
||||
<xsl:if test="@failed > 0">
|
||||
<xsl:variable name="failedTotal" select="count(//test-case[@result='Failed' and not(@label)])" />
|
||||
<xsl:variable name="errorsTotal" select="count(//test-case[@result='Failed' and @label='Error'])" />
|
||||
<xsl:variable name="invalidTotal" select="count(//test-case[@result='Failed' and @label='Invalid'])" />
|
||||
<tr>
|
||||
<td class="smllabel right">Failed Tests: </td>
|
||||
<td class="left">
|
||||
Failures: <xsl:value-of select="$failedTotal"/>, Errors: <xsl:value-of select="$errorsTotal"/>, Invalid: <xsl:value-of select="$invalidTotal"/>
|
||||
</td>
|
||||
</tr>
|
||||
</xsl:if>
|
||||
|
||||
<!-- [Optional] - Skipped Test Summary -->
|
||||
<xsl:if test="@skipped > 0">
|
||||
<xsl:variable name="ignoredTotal" select="count(//test-case[@result='Skipped' and @label='Ignored'])" />
|
||||
<xsl:variable name="explicitTotal" select="count(//test-case[@result='Skipped' and @label='Explicit'])" />
|
||||
<xsl:variable name="otherTotal" select="count(//test-case[@result='Skipped' and not(@label='Explicit' or @label='Ignored')])" />
|
||||
<tr>
|
||||
<td class="smllabel right">Skipped Tests: </td>
|
||||
<td class="left">
|
||||
Ignored: <xsl:value-of select="$ignoredTotal"/>, Explicit: <xsl:value-of select="$explicitTotal"/>, Other: <xsl:value-of select="$otherTotal"/>
|
||||
</td>
|
||||
</tr>
|
||||
</xsl:if>
|
||||
|
||||
<!-- Times -->
|
||||
<tr>
|
||||
<td class="smllabel right">Start time: </td>
|
||||
<td class="left">
|
||||
<xsl:value-of select="@start-time"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="smllabel right">End time: </td>
|
||||
<td class="left">
|
||||
<xsl:value-of select="@end-time"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="smllabel right">Duration: </td>
|
||||
<td class="left">
|
||||
<xsl:value-of select="format-number(@duration,'0.000')"/> seconds
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="test-case">
|
||||
<!-- Determine type of test-case for formatting -->
|
||||
<xsl:variable name="type">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@result='Skipped'">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@label='Ignored' or @label='Explicit'">
|
||||
<xsl:value-of select="@label"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="'Other'"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:when>
|
||||
<xsl:when test="@result='Failed'">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@label='Error' or @label='Invalid'">
|
||||
<xsl:value-of select="@label"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="'Failed'"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:when>
|
||||
<xsl:when test="@result='Passed'">
|
||||
<xsl:value-of select="'Success'"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="'Unknown'"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
|
||||
<!-- Show details of test-cases either skipped or errored -->
|
||||
<li>
|
||||
<xsl:value-of select="concat($type,' : ', @fullname)" />
|
||||
<br/>
|
||||
<pre>
|
||||
<xsl:value-of select="child::node()/message"/>
|
||||
|
||||
<xsl:choose>
|
||||
<xsl:when test="$type='Failed'">
|
||||
<br/>
|
||||
</xsl:when>
|
||||
<xsl:when test="$type='Error'">
|
||||
<br/>
|
||||
</xsl:when>
|
||||
<xsl:when test="$type='Passed'">
|
||||
<br/>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
|
||||
<!-- Stack trace for failures -->
|
||||
<xsl:if test="failure and ($type='Failed' or $type='Error')">
|
||||
<xsl:value-of select="failure/stack-trace"/>
|
||||
</xsl:if>
|
||||
</pre>
|
||||
|
||||
<xsl:if test="child::node()/attachment">
|
||||
<ul>
|
||||
<xsl:for-each select="child::node()/attachment">
|
||||
<li> <a href="file://{filePath}"><xsl:value-of select="description"/></a></li>
|
||||
</xsl:for-each>
|
||||
</ul>
|
||||
</xsl:if>
|
||||
</li>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
|
@ -1,27 +0,0 @@
|
|||
TOP=../..
|
||||
|
||||
include $(TOP)/Make.config
|
||||
|
||||
all-local:: run-tests
|
||||
|
||||
ifneq ($(TEST_CATEGORY),)
|
||||
WHERE_CONDITION=/where "cat == $(TEST_CATEGORY)"
|
||||
endif
|
||||
|
||||
TEST_RESULT:=TestResult-$(shell date "+%Y%m%d-%H%M%S")
|
||||
|
||||
build: bin/Debug/sampletester.dll
|
||||
|
||||
run-tests: bin/Debug/sampletester.dll
|
||||
$(Q) rm -f .failed-stamp
|
||||
$(Q) $(TOP)/tools/nunit3-console-3.11.1 $(WHERE_CONDITION) $(abspath $(CURDIR)/bin/Debug/sampletester.dll) "--result=$(abspath $(CURDIR)/$(TEST_RESULT).xml)" $${TEST_FIXTURE:+"$$TEST_FIXTURE"} --labels=After --inprocess || touch $(CURDIR)/.failed-stamp
|
||||
$(Q) xsltproc HtmlReport.xslt "$(TEST_RESULT).xml" > "$(TEST_RESULT).html"
|
||||
$(Q) $(CP) "$(TEST_RESULT).html" index.html
|
||||
@[[ ! -e .failed-stamp ]]
|
||||
|
||||
run-tests-system: bin/Debug/sampletester.dll
|
||||
$(MAKE) TESTS_USE_SYSTEM=1
|
||||
|
||||
bin/Debug/sampletester.dll: $(wildcard *.cs */*.cs *.csproj Makefile)
|
||||
$(Q) $(SYSTEM_MONO) /Library/Frameworks//Mono.framework/Versions/Current/lib/mono/nuget/NuGet.exe restore
|
||||
$(Q_BUILD) $(SYSTEM_MSBUILD) sampletester.csproj $(MSBUILD_VERBOSITY)
|
|
@ -1,308 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Xml;
|
||||
|
||||
using NUnit.Framework;
|
||||
|
||||
using Xamarin;
|
||||
using Xamarin.Tests;
|
||||
using Xamarin.Utils;
|
||||
|
||||
public static class ProcessHelper {
|
||||
static int counter;
|
||||
|
||||
static string log_directory;
|
||||
static string LogDirectory {
|
||||
get {
|
||||
if (log_directory is null)
|
||||
log_directory = Cache.CreateTemporaryDirectory ("execution-logs");
|
||||
return log_directory;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void AssertRunProcess (string filename, string [] arguments, TimeSpan timeout, string workingDirectory, Dictionary<string, string> environment_variables, string message)
|
||||
{
|
||||
AssertRunProcess (filename, arguments, timeout, workingDirectory, environment_variables, message, out _);
|
||||
}
|
||||
|
||||
public static void AssertRunProcess (string filename, string [] arguments, TimeSpan timeout, string workingDirectory, Dictionary<string, string> environment_variables, string message, out string logfile)
|
||||
{
|
||||
var exitCode = 0;
|
||||
var output = new List<string> ();
|
||||
|
||||
Action<string> output_callback = (v) => {
|
||||
lock (output)
|
||||
output.Add ($"{DateTime.Now.ToString ("HH:mm:ss.fffffff")}: {v}");
|
||||
};
|
||||
|
||||
if (environment_variables is null)
|
||||
environment_variables = new Dictionary<string, string> ();
|
||||
environment_variables ["XCODE_DEVELOPER_DIR_PATH"] = null;
|
||||
environment_variables ["DEVELOPER_DIR"] = Configuration.XcodeLocation;
|
||||
|
||||
var watch = Stopwatch.StartNew ();
|
||||
exitCode = ExecutionHelper.Execute (filename, arguments, out var timed_out, workingDirectory, environment_variables, output_callback, output_callback, timeout);
|
||||
watch.Stop ();
|
||||
|
||||
output_callback ($"Exit code: {exitCode} Timed out: {timed_out} Total duration: {watch.Elapsed.ToString ()}");
|
||||
|
||||
// Write execution log to disk (and print the path)
|
||||
logfile = Path.Combine (LogDirectory, $"{filename}-{Interlocked.Increment (ref counter)}.log");
|
||||
File.WriteAllLines (logfile, output);
|
||||
TestContext.AddTestAttachment (logfile, $"Execution log for {filename}");
|
||||
Console.WriteLine ("Execution log for {0}: {1}", filename, logfile);
|
||||
|
||||
var errors = new List<string> ();
|
||||
var errorMessage = "";
|
||||
if ((!timed_out || exitCode != 0) && output.Count > 0) {
|
||||
var regex = new Regex (@"error\s*(MSB....)?(CS....)?(MT....)?(MM....)?:", RegexOptions.IgnoreCase | RegexOptions.Singleline);
|
||||
foreach (var line in output) {
|
||||
if (regex.IsMatch (line) && !errors.Contains (line))
|
||||
errors.Add (line);
|
||||
}
|
||||
if (errors.Count > 0)
|
||||
errorMessage = "\n\t[Summary of errors from the build output below]\n\t" + string.Join ("\n\t", errors);
|
||||
}
|
||||
Assert.IsFalse (timed_out, $"{message} timed out after {timeout.TotalMinutes} minutes{errorMessage}");
|
||||
Assert.AreEqual (0, exitCode, $"{message} failed (unexpected exit code){errorMessage}");
|
||||
}
|
||||
|
||||
public static void BuildSolution (string solution, string platform, string configuration, Dictionary<string, string> environment_variables, TimeSpan timeout, string target = "", string codesignKey = null)
|
||||
{
|
||||
// nuget restore
|
||||
var solution_dir = string.Empty;
|
||||
var solutions = new string [] { solution };
|
||||
var nuget_args = new List<string> ();
|
||||
nuget_args.Add ("restore");
|
||||
nuget_args.Add ("sln"); // replaced later
|
||||
nuget_args.Add ("-Verbosity");
|
||||
nuget_args.Add ("detailed");
|
||||
var slndir = Path.GetDirectoryName (solution);
|
||||
if (!solution.EndsWith (".sln", StringComparison.Ordinal)) {
|
||||
while ((solutions = Directory.GetFiles (slndir, "*.sln", SearchOption.TopDirectoryOnly)).Length == 0 && slndir.Length > 1)
|
||||
slndir = Path.GetDirectoryName (slndir);
|
||||
nuget_args.Add ("-SolutionDir");
|
||||
nuget_args.Add (slndir);
|
||||
}
|
||||
|
||||
foreach (var sln in solutions) {
|
||||
nuget_args [1] = sln; // replacing here
|
||||
AssertRunProcess ("nuget", nuget_args.ToArray (), timeout, Configuration.SampleRootDirectory, environment_variables, "nuget restore");
|
||||
}
|
||||
|
||||
// msbuild
|
||||
var sb = new List<string> ();
|
||||
sb.Add ("/verbosity:diag");
|
||||
if (!string.IsNullOrEmpty (platform))
|
||||
sb.Add ($"/p:Platform={platform}");
|
||||
if (!string.IsNullOrEmpty (configuration))
|
||||
sb.Add ($"/p:Configuration={configuration}");
|
||||
sb.Add (solution);
|
||||
if (!string.IsNullOrEmpty (target))
|
||||
sb.Add ($"/t:{target}");
|
||||
if (!string.IsNullOrEmpty (codesignKey))
|
||||
sb.Add ($"/p:CodesignKey={codesignKey}");
|
||||
|
||||
environment_variables ["MTOUCH_ENV_OPTIONS"] = "--time --time --time --time -vvvv";
|
||||
environment_variables ["MMP_ENV_OPTIONS"] = "--time --time --time --time -vvvv";
|
||||
|
||||
var watch = Stopwatch.StartNew ();
|
||||
var failed = false;
|
||||
string msbuild_logfile;
|
||||
try {
|
||||
AssertRunProcess ("msbuild", sb.ToArray (), timeout, Configuration.SampleRootDirectory, environment_variables, "build", out msbuild_logfile);
|
||||
} catch {
|
||||
failed = true;
|
||||
throw;
|
||||
} finally {
|
||||
watch.Stop ();
|
||||
}
|
||||
|
||||
// Write performance data to disk
|
||||
var subdirs = Directory.GetDirectories (slndir, "*", SearchOption.AllDirectories);
|
||||
|
||||
// First figure out which .app subdirectory is the actual .app. This is a bit more complicated than it would seem...
|
||||
var apps = subdirs.Where ((v) => {
|
||||
var names = v.Substring (slndir.Length).Split (Path.DirectorySeparatorChar);
|
||||
if (names.Length < 2)
|
||||
return false;
|
||||
|
||||
if (!names [names.Length - 1].EndsWith (".app", StringComparison.Ordinal))
|
||||
return false;
|
||||
|
||||
if (names.Any ((v2) => v2 == "copySceneKitAssets"))
|
||||
return false;
|
||||
|
||||
var bin_idx = Array.IndexOf (names, "bin");
|
||||
var conf_idx = Array.IndexOf (names, configuration);
|
||||
if (bin_idx < 0 || conf_idx < 0)
|
||||
return false;
|
||||
|
||||
if (bin_idx > conf_idx)
|
||||
return false;
|
||||
|
||||
if (platform.Length > 0) {
|
||||
var platform_idx = Array.IndexOf (names, platform);
|
||||
if (platform_idx < 0)
|
||||
return false;
|
||||
|
||||
if (bin_idx > platform_idx)
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}).ToArray ();
|
||||
|
||||
if (apps.Length > 1) {
|
||||
// Found more than one .app subdirectory, use additional logic to choose between them.
|
||||
var filtered_apps = apps.Where ((v) => {
|
||||
// If one .app is a subdirectory of another .app, we don't care about the former.
|
||||
if (apps.Any ((v2) => v2.Length < v.Length && v.StartsWith (v2, StringComparison.Ordinal)))
|
||||
return false;
|
||||
|
||||
// If one .app is contained within another .app, we don't care about the former.
|
||||
var vname = Path.GetFileName (v);
|
||||
var otherApps = apps.Where ((v2) => v != v2);
|
||||
if (otherApps.Any ((v2) => {
|
||||
var otherSubdirs = subdirs.Where ((v3) => v3.StartsWith (v2, StringComparison.Ordinal));
|
||||
return otherSubdirs.Any ((v3) => Path.GetFileName (v3) == vname);
|
||||
}))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}).ToArray ();
|
||||
if (apps.Length == 0)
|
||||
Assert.Fail ($"Filtered away all the .apps, from:\n\t{string.Join ("\n\t", apps)}");
|
||||
apps = filtered_apps;
|
||||
}
|
||||
|
||||
if (apps.Length > 1) {
|
||||
Assert.Fail ($"Found more than one .app directory:\n\t{string.Join ("\n\t", apps)}");
|
||||
} else if (apps.Length == 0) {
|
||||
Assert.Fail ($"Found no .app directories for platform: {platform} configuration: {configuration} target: {target}. All directories:\n\t{string.Join ("\n\t", subdirs)}");
|
||||
}
|
||||
|
||||
var logfile = Path.Combine (LogDirectory, $"{Path.GetFileNameWithoutExtension (solution)}-perfdata-{Interlocked.Increment (ref counter)}.xml");
|
||||
|
||||
var xmlSettings = new XmlWriterSettings {
|
||||
Indent = true,
|
||||
};
|
||||
var xml = XmlWriter.Create (logfile, xmlSettings);
|
||||
xml.WriteStartDocument (true);
|
||||
xml.WriteStartElement ("performance");
|
||||
xml.WriteStartElement ("sample-build");
|
||||
xml.WriteAttributeString ("mono-version", Configuration.MonoVersion);
|
||||
xml.WriteAttributeString ("os-version", Configuration.OSVersion);
|
||||
xml.WriteAttributeString ("xamarin-macios-hash", Configuration.TestedHash);
|
||||
xml.WriteAttributeString ("sample-repository", Configuration.GetCurrentRemoteUrl (slndir));
|
||||
xml.WriteAttributeString ("sample-hash", Configuration.GetCurrentHash (slndir));
|
||||
xml.WriteAttributeString ("agent-machinename", Environment.GetEnvironmentVariable ("AGENT_MACHINENAME"));
|
||||
xml.WriteAttributeString ("agent-name", Environment.GetEnvironmentVariable ("AGENT_NAME"));
|
||||
foreach (var app in apps) {
|
||||
xml.WriteStartElement ("test");
|
||||
xml.WriteAttributeString ("name", TestContext.CurrentContext.Test.FullName);
|
||||
xml.WriteAttributeString ("result", failed ? "failed" : "success");
|
||||
if (platform.Length > 0)
|
||||
xml.WriteAttributeString ("platform", platform);
|
||||
xml.WriteAttributeString ("configuration", configuration);
|
||||
if (!failed) {
|
||||
xml.WriteAttributeString ("duration", watch.ElapsedTicks.ToString ());
|
||||
xml.WriteAttributeString ("duration-formatted", watch.Elapsed.ToString ());
|
||||
|
||||
var files = Directory.GetFiles (app, "*", SearchOption.AllDirectories).OrderBy ((v) => v).ToArray ();
|
||||
var lengths = files.Select ((v) => new FileInfo (v).Length).ToArray ();
|
||||
var total_size = lengths.Sum ();
|
||||
|
||||
xml.WriteAttributeString ("total-size", total_size.ToString ());
|
||||
var appstart = Path.GetDirectoryName (app).Length;
|
||||
for (var i = 0; i < files.Length; i++) {
|
||||
xml.WriteStartElement ("file");
|
||||
xml.WriteAttributeString ("name", files [i].Substring (appstart + 1));
|
||||
xml.WriteAttributeString ("size", lengths [i].ToString ());
|
||||
xml.WriteEndElement ();
|
||||
}
|
||||
|
||||
if (File.Exists (msbuild_logfile)) {
|
||||
var lines = File.ReadAllLines (msbuild_logfile);
|
||||
var target_perf_summary = new List<string> ();
|
||||
var task_perf_summary = new List<string> ();
|
||||
var timestamps = new List<string> ();
|
||||
for (var i = lines.Length - 1; i >= 0; i--) {
|
||||
if (lines [i].EndsWith ("Target Performance Summary:", StringComparison.Ordinal)) {
|
||||
for (var k = i + 1; k < lines.Length && lines [k].EndsWith ("calls", StringComparison.Ordinal); k++) {
|
||||
target_perf_summary.Add (lines [k].Substring (18).Trim ());
|
||||
}
|
||||
} else if (lines [i].EndsWith ("Task Performance Summary:", StringComparison.Ordinal)) {
|
||||
for (var k = i + 1; k < lines.Length && lines [k].EndsWith ("calls", StringComparison.Ordinal); k++) {
|
||||
task_perf_summary.Add (lines [k].Substring (18).Trim ());
|
||||
}
|
||||
} else if (lines [i].Contains ("!Timestamp")) {
|
||||
timestamps.Add (lines [i]);
|
||||
}
|
||||
}
|
||||
foreach (var tps in target_perf_summary) {
|
||||
var split = tps.Split (new char [] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
xml.WriteStartElement ("target");
|
||||
xml.WriteAttributeString ("name", split [2]);
|
||||
xml.WriteAttributeString ("ms", split [0]);
|
||||
xml.WriteAttributeString ("calls", split [3]);
|
||||
xml.WriteEndElement ();
|
||||
}
|
||||
foreach (var tps in task_perf_summary) {
|
||||
var split = tps.Split (new char [] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
xml.WriteStartElement ("task");
|
||||
xml.WriteAttributeString ("name", split [2]);
|
||||
xml.WriteAttributeString ("ms", split [0]);
|
||||
xml.WriteAttributeString ("calls", split [3]);
|
||||
xml.WriteEndElement ();
|
||||
}
|
||||
foreach (var ts in timestamps) {
|
||||
// Sample line:
|
||||
// 15:04:50.4609520: !Timestamp Setup: 28 ms (TaskId:137)
|
||||
var splitFirst = ts.Split (new char [] { ':' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
var splitSecondA = splitFirst [3].Split (new char [] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
var splitSecondB = splitFirst [4].Split (new char [] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
var name = string.Join (" ", splitSecondA.Skip (1));
|
||||
var level = splitSecondA [0].Count ((v) => v == '!').ToString ();
|
||||
var ms = splitSecondB [0];
|
||||
xml.WriteStartElement ("timestamp");
|
||||
xml.WriteAttributeString ("name", name);
|
||||
xml.WriteAttributeString ("level", level);
|
||||
xml.WriteAttributeString ("ms", ms);
|
||||
xml.WriteEndElement ();
|
||||
}
|
||||
}
|
||||
|
||||
xml.WriteEndElement ();
|
||||
}
|
||||
|
||||
xml.WriteEndElement (); // sample-build
|
||||
xml.WriteEndElement (); // performance
|
||||
xml.WriteEndDocument ();
|
||||
xml.Dispose ();
|
||||
|
||||
TestContext.AddTestAttachment (logfile, $"Performance data");
|
||||
}
|
||||
}
|
||||
|
||||
internal static string RunProcess (string filename, string arguments = "", string working_directory = null)
|
||||
{
|
||||
using (var p = Process.Start (filename, arguments)) {
|
||||
p.StartInfo.RedirectStandardOutput = true;
|
||||
p.StartInfo.UseShellExecute = false;
|
||||
if (!string.IsNullOrEmpty (working_directory))
|
||||
p.StartInfo.WorkingDirectory = working_directory;
|
||||
p.Start ();
|
||||
var output = p.StandardOutput.ReadToEnd ();
|
||||
p.WaitForExit ();
|
||||
return output;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,4 +0,0 @@
|
|||
using NUnit.Framework;
|
||||
|
||||
// Two tests at the same time is enough: mtouch already parallelizes things, so we don't want to overload the bots either.
|
||||
[assembly: LevelOfParallelism (2)]
|
|
@ -1,34 +0,0 @@
|
|||
# Sample testing
|
||||
|
||||
These unit tests clone a series of known repositories that contain sample
|
||||
projects, and build all the relevant projects in those repositories.
|
||||
|
||||
It is executed automatically in [Azure DevOps][1] every [Saturday][2] for the listed branches. This includes:
|
||||
|
||||
* `main`
|
||||
* `d16-x` - i.e. one or many active release branches
|
||||
* `xcodeY` - i.e. the current xcode *beta* feature branch
|
||||
* `mono-202z-zz` - i.e. the mono integration branches (new one every two months)
|
||||
|
||||
where `x`, `Y` and `z` needs to be periodically updated as new branches are created (e.g. `d16-x`) and old ones are merged into `main` (e.g. `xcodeY` and `mono-202z-zz`).
|
||||
|
||||
It can also be triggered manually, but have in mind that the commit in
|
||||
question must already have packages (as GitHub statuses).
|
||||
|
||||
It's also possible to use the sample tests from one commit, and then test with
|
||||
Xamarin.iOS/Xamarin.Mac a completely different commit, by setting the
|
||||
`PROVISION_FROM_COMMIT` variable to the commit that's to be tested:
|
||||
|
||||
![screenshot](images/provision_from_commit.png)
|
||||
|
||||
The previous point is still required: the commit to provision from must have
|
||||
packages.
|
||||
|
||||
There are two ways to run these tests locally:
|
||||
|
||||
* Launching xharness in server mode and execute the "Sample tests" (they're
|
||||
disabled by default).
|
||||
* Executing `make` in this directory.
|
||||
|
||||
[1]: https://dev.azure.com/xamarin/internal/_build?definitionId=23
|
||||
[2]: https://dev.azure.com/xamarin/internal/_apps/hub/ms.vss-ciworkflow.build-ci-hub?_a=edit-build-definition&id=23&view=Tab_Triggers
|
|
@ -1,319 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
using NUnit.Framework;
|
||||
|
||||
using Xamarin.Tests;
|
||||
|
||||
namespace Samples {
|
||||
public class SampleTest {
|
||||
public ProjectInfo Project;
|
||||
public string Solution;
|
||||
public bool BuildSolution;
|
||||
public string KnownFailure;
|
||||
public string CodesignKey;
|
||||
public string [] DebugConfigurations;
|
||||
public string [] ReleaseConfigurations;
|
||||
public string [] Platforms;
|
||||
|
||||
// for various reasons (build'ability, compatibility, performance) it can be
|
||||
// better to build a subset of a solution
|
||||
// e.g. `nuget restore` requires removing the projects from the .sln
|
||||
public string [] RemoveProjects;
|
||||
}
|
||||
|
||||
public class SampleTestData {
|
||||
public SampleTest SampleTest;
|
||||
public string Configuration;
|
||||
public string Platform;
|
||||
public TimeSpan Timeout;
|
||||
|
||||
public override string ToString ()
|
||||
{
|
||||
if (string.IsNullOrEmpty (Platform))
|
||||
return $"{SampleTest.Project.Title}: {Configuration}";
|
||||
return $"{SampleTest.Project.Title}: {Configuration}|{Platform}";
|
||||
}
|
||||
}
|
||||
|
||||
public class ProjectInfo {
|
||||
public string Title;
|
||||
public string RelativePath;
|
||||
public string FullPath;
|
||||
public bool IsExecutable;
|
||||
public string [] Imports;
|
||||
public TestPlatform Platform;
|
||||
|
||||
public bool IsApplicable (bool assert)
|
||||
{
|
||||
if (!IsExecutable) {
|
||||
if (assert)
|
||||
Assert.Ignore ("Project is not an executable project");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Platform == TestPlatform.None) {
|
||||
if (assert)
|
||||
Assert.Ignore ("Project is not an Xamarin.iOS/Xamarin.Mac/Xamarin.WatchOS/Xamarin.TVOS project. Imports:\n\t{0}", string.Join ("\t\n", Imports));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Platform == TestPlatform.watchOS) {
|
||||
if (assert)
|
||||
Assert.Ignore ("Project is a watchOS app"); // no need to build watchOS apps, they're built as part of their containing iOS project.
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class SampleTester : BaseTester {
|
||||
|
||||
public static TimeSpan DefaultTimeout { get; } = TimeSpan.FromMinutes (5);
|
||||
|
||||
protected SampleTester ()
|
||||
{
|
||||
}
|
||||
|
||||
protected SampleTester (string repo, string hash)
|
||||
: base (repo, hash)
|
||||
{
|
||||
}
|
||||
|
||||
static ProjectInfo GetProjectInfo (string relative_path, string full_path)
|
||||
{
|
||||
var xml = File.ReadAllText (full_path);
|
||||
var info = new ProjectInfo ();
|
||||
info.FullPath = full_path;
|
||||
info.RelativePath = relative_path;
|
||||
info.IsExecutable = xml.Contains ("<OutputType>Exe</OutputType>");
|
||||
|
||||
var xml_lines = xml.Split ('\n');
|
||||
var xml_imports = xml_lines.
|
||||
Where ((v) => v.Contains ("<Import Project=")).
|
||||
Select ((v) => v.Split ('"') [1]);
|
||||
info.Imports = xml_imports.ToArray ();
|
||||
|
||||
var test_platform = TestPlatform.None;
|
||||
if (xml_imports.Any ((v) => v.Contains ("Xamarin.iOS"))) {
|
||||
test_platform = TestPlatform.iOS;
|
||||
} else if (xml_imports.Any ((v) => v.Contains ("Xamarin.TVOS"))) {
|
||||
test_platform = TestPlatform.tvOS;
|
||||
} else if (xml_imports.Any ((v) => v.Contains ("Xamarin.WatchOS"))) {
|
||||
test_platform = TestPlatform.watchOS;
|
||||
} else if (xml_imports.Any ((v) => v.Contains ("Xamarin.Mac"))) {
|
||||
test_platform = TestPlatform.macOS;
|
||||
} else {
|
||||
test_platform = TestPlatform.None;
|
||||
}
|
||||
info.Platform = test_platform;
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
public static Dictionary<string, string> GetEnvironmentVariables (TestPlatform platform)
|
||||
{
|
||||
var environment_variables = new Dictionary<string, string> ();
|
||||
environment_variables ["MD_APPLE_SDK_ROOT"] = Path.GetDirectoryName (Path.GetDirectoryName (Configuration.XcodeLocation));
|
||||
switch (platform) {
|
||||
case TestPlatform.iOS:
|
||||
case TestPlatform.tvOS:
|
||||
case TestPlatform.watchOS:
|
||||
environment_variables ["MD_MTOUCH_SDK_ROOT"] = Path.Combine (Configuration.IOS_DESTDIR, "Library", "Frameworks", "Xamarin.iOS.framework", "Versions", "Current");
|
||||
environment_variables ["TargetFrameworkFallbackSearchPaths"] = Path.Combine (Configuration.IOS_DESTDIR, "Library", "Frameworks", "Mono.framework", "External", "xbuild-frameworks");
|
||||
environment_variables ["MSBuildExtensionsPathFallbackPathsOverride"] = Path.Combine (Configuration.IOS_DESTDIR, "Library", "Frameworks", "Mono.framework", "External", "xbuild");
|
||||
break;
|
||||
case TestPlatform.macOS:
|
||||
environment_variables ["TargetFrameworkFallbackSearchPaths"] = Path.Combine (Configuration.MAC_DESTDIR, "Library", "Frameworks", "Mono.framework", "External", "xbuild-frameworks");
|
||||
environment_variables ["MSBuildExtensionsPathFallbackPathsOverride"] = Path.Combine (Configuration.MAC_DESTDIR, "Library", "Frameworks", "Mono.framework", "External", "xbuild");
|
||||
environment_variables ["XamarinMacFrameworkRoot"] = Path.Combine (Configuration.MAC_DESTDIR, "Library", "Frameworks", "Xamarin.Mac.framework", "Versions", "Current");
|
||||
environment_variables ["XAMMAC_FRAMEWORK_PATH"] = Path.Combine (Configuration.MAC_DESTDIR, "Library", "Frameworks", "Xamarin.Mac.framework", "Versions", "Current");
|
||||
break;
|
||||
default:
|
||||
throw new NotImplementedException (platform.ToString ());
|
||||
}
|
||||
return environment_variables;
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void BuildSample ([ValueSource ("GetSampleData")] SampleTestData sampleTestData)
|
||||
{
|
||||
try {
|
||||
var data = sampleTestData.SampleTest;
|
||||
if (!string.IsNullOrEmpty (data.KnownFailure))
|
||||
Assert.Ignore (data.KnownFailure);
|
||||
|
||||
switch (data.Project.Platform) {
|
||||
case TestPlatform.iOS:
|
||||
if (!Configuration.include_ios)
|
||||
Assert.Ignore ("iOS support has been disabled.");
|
||||
break;
|
||||
case TestPlatform.tvOS:
|
||||
if (!Configuration.include_tvos)
|
||||
Assert.Ignore ("tvOS support has been disabled");
|
||||
break;
|
||||
case TestPlatform.watchOS:
|
||||
if (!Configuration.include_watchos)
|
||||
Assert.Ignore ("watchOS support has been disabled");
|
||||
break;
|
||||
case TestPlatform.macOS:
|
||||
if (!Configuration.include_mac)
|
||||
Assert.Ignore ("macOS support has been disabled");
|
||||
break;
|
||||
default:
|
||||
throw new NotImplementedException (sampleTestData.Platform.ToString ());
|
||||
}
|
||||
|
||||
var file_to_build = sampleTestData.SampleTest.Project.RelativePath;
|
||||
var target = string.Empty;
|
||||
if (data.BuildSolution) {
|
||||
file_to_build = data.Solution;
|
||||
target = Path.GetFileNameWithoutExtension (data.Project.RelativePath).Replace ('.', '_');
|
||||
}
|
||||
|
||||
var repo = CloneRepo ();
|
||||
file_to_build = Path.Combine (repo, file_to_build);
|
||||
|
||||
if (data.RemoveProjects is not null) {
|
||||
if (String.IsNullOrEmpty (data.Solution))
|
||||
Assert.Fail ("'RemoveProjects' used without a 'Solution' path!");
|
||||
var sln_path = Path.Combine (repo, data.Solution);
|
||||
var filtered_sln = new List<string> (File.ReadAllLines (sln_path));
|
||||
foreach (var p in data.RemoveProjects) {
|
||||
for (int i = 0; i < filtered_sln.Count; i++) {
|
||||
var line = filtered_sln [i];
|
||||
if (line.StartsWith ("Project(", StringComparison.Ordinal)) {
|
||||
if (line.Contains ($") = \"{p}\", \"")) {
|
||||
filtered_sln.RemoveAt (i);
|
||||
filtered_sln.RemoveAt (i); // EndProject (same `i` as things moved up)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
File.WriteAllLines (sln_path, filtered_sln);
|
||||
}
|
||||
|
||||
ProcessHelper.BuildSolution (file_to_build, sampleTestData.Platform, sampleTestData.Configuration, GetEnvironmentVariables (data.Project.Platform), sampleTestData.Timeout, target, data.CodesignKey);
|
||||
Console.WriteLine ("✅ {0} succeeded.", TestContext.CurrentContext.Test.FullName);
|
||||
} catch (Exception e) {
|
||||
Console.WriteLine ("❌ {0} failed: {1}", TestContext.CurrentContext.Test.FullName, e.Message);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
static Dictionary<string, ProjectInfo []> projects = new Dictionary<string, ProjectInfo []> ();
|
||||
protected static ProjectInfo [] GetExecutableProjects (string org, string repo, string hash, string default_branch)
|
||||
{
|
||||
if (!projects.TryGetValue (repo, out var rv)) {
|
||||
var project_paths = GitHub.GetProjects (org, repo, hash, default_branch);
|
||||
|
||||
// We can filter out project we don't care about.
|
||||
rv = project_paths.
|
||||
Select ((v) => GetProjectInfo (v, Path.Combine (GitHub.CloneRepository (org, repo, hash, default_branch, false), v))).
|
||||
Where ((v) => v.IsApplicable (false)).
|
||||
ToArray ();
|
||||
|
||||
projects [repo] = rv;
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
protected static IEnumerable<SampleTestData> GetSampleTestData (Dictionary<string, SampleTest> samples, string org, string repo, string hash, string default_branch, TimeSpan timeout)
|
||||
{
|
||||
var defaultDebugConfigurations = new string [] { "Debug" };
|
||||
var defaultReleaseConfigurations = new string [] { "Release" };
|
||||
|
||||
if (samples is null) {
|
||||
samples = new Dictionary<string, SampleTest> ();
|
||||
} else {
|
||||
samples = new Dictionary<string, SampleTest> (samples);
|
||||
}
|
||||
|
||||
// If a project's filename is unique in this repo, use the filename (without extension) as the name of the test.
|
||||
// Otherwise use the project's relative path.
|
||||
var executable_projects = GetExecutableProjects (org, repo, hash, default_branch);
|
||||
var duplicateProjects = executable_projects.GroupBy ((v) => Path.GetFileNameWithoutExtension (v.RelativePath)).Where ((v) => v.Count () > 1);
|
||||
foreach (var group in duplicateProjects) {
|
||||
foreach (var proj in group) {
|
||||
proj.Title = proj.RelativePath;
|
||||
}
|
||||
}
|
||||
foreach (var proj in executable_projects) {
|
||||
if (proj.Title is null) {
|
||||
proj.Title = Path.GetFileNameWithoutExtension (proj.RelativePath);
|
||||
}
|
||||
}
|
||||
|
||||
var platform_filter = Environment.GetEnvironmentVariable ("TEST_PLATFORM_FILTER_EXPRESSION");
|
||||
var config_filter = Environment.GetEnvironmentVariable ("TEST_CONFIG_FILTER_EXPRESSION");
|
||||
var name_filter = Environment.GetEnvironmentVariable ("TEST_NAME_FILTER_EXPRESSION");
|
||||
|
||||
IEnumerable<T> filter<T> (string name, string proj, IEnumerable<T> input, string filter_expression, Func<T, string> tostring)
|
||||
{
|
||||
if (string.IsNullOrEmpty (filter_expression))
|
||||
return input;
|
||||
|
||||
var filtered = input.Where ((v) => Regex.IsMatch (tostring (v), filter_expression));
|
||||
var removed = input.Where ((v) => !filtered.Contains (v));
|
||||
if (removed.Any ()) {
|
||||
return filtered;
|
||||
}
|
||||
return input;
|
||||
}
|
||||
|
||||
// Create the test variations for each project.
|
||||
foreach (var proj in filter ("name", "*", executable_projects, name_filter, (v) => Path.GetFileName (v.RelativePath))) {
|
||||
if (!samples.TryGetValue (proj.RelativePath, out var sample))
|
||||
samples [proj.RelativePath] = sample = new SampleTest ();
|
||||
sample.Project = proj;
|
||||
IEnumerable<string> platforms = sample.Platforms;
|
||||
if (platforms is null) {
|
||||
switch (proj.Platform) {
|
||||
case TestPlatform.iOS:
|
||||
case TestPlatform.tvOS:
|
||||
platforms = new string [] { "iPhone", "iPhoneSimulator" };
|
||||
break;
|
||||
case TestPlatform.macOS:
|
||||
platforms = new string [] { "" };
|
||||
break;
|
||||
case TestPlatform.watchOS:
|
||||
default:
|
||||
throw new NotImplementedException (proj.Platform.ToString ());
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var platform in filter ("platform", proj.Title, platforms, platform_filter, (v) => v)) {
|
||||
var configs = new List<string> ();
|
||||
configs.AddRange (sample.DebugConfigurations ?? defaultDebugConfigurations);
|
||||
configs.AddRange (sample.ReleaseConfigurations ?? defaultReleaseConfigurations);
|
||||
foreach (var config in filter ("config", proj.Title, configs, config_filter, (v) => v)) {
|
||||
yield return new SampleTestData { SampleTest = sample, Configuration = config, Platform = platform, Timeout = timeout };
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
string CloneRepo ()
|
||||
{
|
||||
return GitHub.CloneRepository (Org, Repository, Hash, DefaultBranch);
|
||||
}
|
||||
}
|
||||
|
||||
[TestFixture]
|
||||
public class BaselineTester {
|
||||
[Test]
|
||||
public void DeviceDebug ()
|
||||
{
|
||||
var sln = Path.Combine (Configuration.SourceRoot, "tests", "sampletester", "BaselineTest", "BaselineTest.sln");
|
||||
GitHub.CleanRepository (Path.GetDirectoryName (sln));
|
||||
ProcessHelper.BuildSolution (sln, "iPhone", "Debug", SampleTester.GetEnvironmentVariables (TestPlatform.iOS), SampleTester.DefaultTimeout);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -1,254 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Samples {
|
||||
[Category (CATEGORY)]
|
||||
public class IosSampleTester : SampleTester {
|
||||
const string ORG = "xamarin";
|
||||
const string REPO = "ios-samples"; // monotouch-samples redirects to ios-samples
|
||||
const string CATEGORY = "iossamples"; // categories can't contain dashes
|
||||
const string HASH = "0a6947d766ad71a711b62e10c2eee08b411057e4";
|
||||
const string DEFAULT_BRANCH = "main";
|
||||
|
||||
static Dictionary<string, SampleTest> test_data = new Dictionary<string, SampleTest> {
|
||||
// Build solution instead of csproj
|
||||
{ "BindingSample/XMBindingLibrarySample/XMBindingLibrarySample.csproj", new SampleTest { BuildSolution = true, Solution = "BindingSample/BindingSample.sln" } },
|
||||
{ "BouncingGameCompleteiOS/BouncingGame.iOS/BouncingGame.iOS.csproj", new SampleTest { BuildSolution = true, Solution = "BouncingGameCompleteiOS/BouncingGame.sln" } },
|
||||
{ "BouncingGameEmptyiOS/BouncingGame.iOS/BouncingGame.iOS.csproj", new SampleTest { BuildSolution = true, Solution = "BouncingGameEmptyiOS/BouncingGame.sln" } },
|
||||
{ "FileSystemSampleCode/FileSystem/FileSystem.csproj", new SampleTest { BuildSolution = true, Solution = "FileSystemSampleCode/WorkingWithTheFileSystem.sln" } },
|
||||
{ "InfColorPicker/InfColorPickerBinding/InfColorPickerSample/InfColorPickerSample.csproj", new SampleTest { BuildSolution = true, Solution = "InfColorPicker/InfColorPickerBinding/InfColorPickerBinding.sln" } },
|
||||
{ "ios10/ElizaChat/ElizaChat/ElizaChat.csproj", new SampleTest { BuildSolution = true, Solution = "ios10/ElizaChat/ElizaChat.sln" } },
|
||||
{ "ios10/IceCreamBuilder/IceCreamBuilder/IceCreamBuilder.csproj", new SampleTest { BuildSolution = true, Solution = "ios10/IceCreamBuilder/IceCreamBuilder.sln" } },
|
||||
{ "ios11/ARKitPlacingObjects/PlacingObjects/PlacingObjects.csproj", new SampleTest { BuildSolution = true, Solution = "ios11/ARKitPlacingObjects/PlacingObjects.sln" } },
|
||||
{ "ios11/WeatherWidget/WeatherWidget/WeatherWidget.csproj", new SampleTest { BuildSolution = true, Solution = "ios11/WeatherWidget/WeatherWidget.sln" } },
|
||||
{ "ios12/SoupChef/SoupChef/SoupChef.csproj", new SampleTest { BuildSolution = true, Solution = "ios12/SoupChef/SoupChef.sln" } },
|
||||
{ "ios12/XamarinShot/XamarinShot/XamarinShot.csproj", new SampleTest { BuildSolution = true, Solution = "ios12/XamarinShot/XamarinShot.sln", Platforms = new string [] { "iPhone" } } }, // Requires Metal, which doesn't work/build in the simulator.
|
||||
{ "ios8/Lister/Lister/Lister.csproj", new SampleTest { BuildSolution = true, Solution = "ios8/Lister/Lister.sln" } },
|
||||
{ "ios8/MetalBasic3D/MetalBasic3D/MetalBasic3D.csproj", new SampleTest { Platforms = new string [] { "iPhone" } } }, // Requires Metal, which doesn't work/build in the simulator.
|
||||
{ "ios8/MetalImageProcessing/MetalImageProcessing/MetalImageProcessing.csproj", new SampleTest { Platforms = new string [] { "iPhone" } } }, // Requires Metal, which doesn't work/build in the simulator.
|
||||
{ "ios8/MetalTexturedQuad/MetalTexturedQuad/MetalTexturedQuad.csproj", new SampleTest { Platforms = new string [] { "iPhone" } } }, // Requires Metal, which doesn't work/build in the simulator.
|
||||
{ "ios9/iTravel/iTravel/iTravel.csproj", new SampleTest { BuildSolution = true, Solution = "ios9/iTravel/iTravel.sln" } },
|
||||
{ "Profiling/MemoryDemo/MemoryDemo/MemoryDemo.csproj", new SampleTest { BuildSolution = true, Solution = "Profiling/MemoryDemo/MemoryDemo.sln", DebugConfigurations = new string [] { "Before-Debug", "After-Debug" }, ReleaseConfigurations = new string [] { "Before-Release", "After-Release" } } },
|
||||
{ "WalkingGameCompleteiOS/WalkingGame.iOS/WalkingGame.iOS.csproj", new SampleTest { BuildSolution = true, Solution = "WalkingGameCompleteiOS/WalkingGame.sln" } },
|
||||
{ "WalkingGameEmptyiOS/WalkingGame.iOS/WalkingGame.iOS.csproj", new SampleTest { BuildSolution = true, Solution = "WalkingGameEmptyiOS/WalkingGame.sln" } },
|
||||
{ "watchOS/WatchConnectivity/WatchConnectivity/WatchConnectivity.csproj", new SampleTest { BuildSolution = true, Solution = "watchOS/WatchConnectivity/WatchConnectivity.sln" } },
|
||||
{ "watchOS/WatchKitCatalog/WatchKitCatalog/WatchKitCatalog.csproj", new SampleTest { BuildSolution = true, Solution = "watchOS/WatchKitCatalog/WatchKitCatalog.sln" } },
|
||||
|
||||
// known failures
|
||||
{ "ios9/Emporium/Emporium/Emporium.csproj", new SampleTest { BuildSolution = true, Solution = "ios9/Emporium/Emporium.sln", KnownFailure = "error : Xcode 10 does not support watchOS 1 apps. Either upgrade to watchOS 2 apps, or use an older version of Xcode." } },
|
||||
{ "WatchKit/GpsWatch/GpsWatch/MainApp.csproj", new SampleTest { KnownFailure = "error : Xcode 10 does not support watchOS 1 apps. Either upgrade to watchOS 2 apps, or use an older version of Xcode." } },
|
||||
{ "WatchKit/WatchNotifications/WatchNotifications_iOS/WatchNotifications_iOS.csproj", new SampleTest { KnownFailure = "error : Xcode 10 does not support watchOS 1 apps. Either upgrade to watchOS 2 apps, or use an older version of Xcode." } },
|
||||
{ "PassKit/PassLibrary/PassLibrary.csproj", new SampleTest { BuildSolution = true, Solution = "PassKit/PassLibrary/PassLibrary.sln", KnownFailure = "Requires custom provisioning to get a proper pass." } },
|
||||
|
||||
};
|
||||
|
||||
static IEnumerable<SampleTestData> GetSampleData ()
|
||||
{
|
||||
return GetSampleTestData (test_data, ORG, REPO, HASH, DEFAULT_BRANCH, DefaultTimeout);
|
||||
}
|
||||
}
|
||||
|
||||
[Category (CATEGORY)]
|
||||
public class MacIosSampleTester : SampleTester {
|
||||
const string ORG = "xamarin";
|
||||
const string REPO = "mac-ios-samples";
|
||||
const string CATEGORY = "maciossamples"; // categories can't contain dashes
|
||||
const string HASH = "2ab4faf9254cecdf5766af573e508f9ac8691663";
|
||||
const string DEFAULT_BRANCH = "main";
|
||||
|
||||
static Dictionary<string, SampleTest> test_data = new Dictionary<string, SampleTest> {
|
||||
// Build solution instead of csproj
|
||||
{ "ExceptionMarshaling/ExceptionMarshaling.Mac.csproj", new SampleTest { BuildSolution = true, Solution = "ExceptionMarshaling/ExceptionMarshaling.sln" } },
|
||||
{ "Fox2/Fox2.macOS/Fox2.macOS.csproj", new SampleTest { BuildSolution = true, Solution = "Fox2/Fox2.sln" } },
|
||||
{ "MetalKitEssentials/MetalKitEssentials.iOS/MetalKitEssentials.iOS.csproj", new SampleTest { BuildSolution = true, Solution = "MetalKitEssentials/MetalKitEssentials.sln", Platforms = new string [] { "iPhone" } } }, // Requires Metal, which doesn't work/build in the simulator.
|
||||
{ "SceneKitReel/SceneKitReelMac/SceneKitReelMac.csproj", new SampleTest { BuildSolution = true, Solution = "SceneKitReel/SceneKitReel.sln" } },
|
||||
};
|
||||
|
||||
static IEnumerable<SampleTestData> GetSampleData ()
|
||||
{
|
||||
return GetSampleTestData (test_data, ORG, REPO, HASH, DEFAULT_BRANCH, DefaultTimeout);
|
||||
}
|
||||
}
|
||||
|
||||
[Category (CATEGORY)]
|
||||
public class MacSampleTester : SampleTester {
|
||||
const string ORG = "xamarin";
|
||||
const string REPO = "mac-samples";
|
||||
const string CATEGORY = "macsamples"; // categories can't contain dashes
|
||||
const string HASH = "6f905972c98e64759ff84a25e4e2b42366fa197b";
|
||||
const string DEFAULT_BRANCH = "main";
|
||||
|
||||
static Dictionary<string, SampleTest> test_data = new Dictionary<string, SampleTest> {
|
||||
// Known failures
|
||||
{ "QTRecorder/QTRecorder.csproj", new SampleTest { KnownFailure = "The sample uses deprecated QTKit types (and .xib fails building)." } },
|
||||
{ "StillMotion/StillMotion/StillMotion.csproj", new SampleTest { KnownFailure = "The sample uses deprecated QTKit types (and .xib fails building)." } },
|
||||
};
|
||||
|
||||
static IEnumerable<SampleTestData> GetSampleData ()
|
||||
{
|
||||
return GetSampleTestData (test_data, ORG, REPO, HASH, DEFAULT_BRANCH, DefaultTimeout);
|
||||
}
|
||||
}
|
||||
|
||||
[Category (CATEGORY)]
|
||||
public class MobileSampleTester : SampleTester {
|
||||
const string ORG = "xamarin";
|
||||
const string REPO = "mobile-samples";
|
||||
const string CATEGORY = "mobilesamples"; // categories can't contain dashes
|
||||
const string HASH = "257f7fe81e70b412d6a6b42e97019ecc2c46ed40";
|
||||
const string DEFAULT_BRANCH = "master";
|
||||
|
||||
static Dictionary<string, SampleTest> test_data = new Dictionary<string, SampleTest> {
|
||||
// Build solution instead of csproj
|
||||
{ "BouncingGame/BouncingGame/BouncingGame.iOS/BouncingGame.iOS.csproj", new SampleTest { BuildSolution = true, Solution = "BouncingGame/BouncingGame.sln" } },
|
||||
{ "CCAction/ActionProject/ActionProject.iOS/ActionProject.iOS.csproj", new SampleTest { BuildSolution = true, Solution = "CCAction/ActionProject.sln" } },
|
||||
{ "CCRenderTexture/RenderTextureExample/RenderTextureExample.iOS/RenderTextureExample.iOS.csproj", new SampleTest { BuildSolution = true, Solution = "CCRenderTexture/RenderTextureExample.sln" } },
|
||||
{ "EmbeddedResources/EmbeddedResources/EmbeddedResources.iOS.csproj", new SampleTest { BuildSolution = true, Solution = "EmbeddedResources/EmbeddedResources.sln" } },
|
||||
{ "FruityFalls/FruityFalls/FruityFalls.iOS/FruityFalls.iOS.csproj", new SampleTest { BuildSolution = true, Solution = "FruityFalls/FruityFalls.sln" } },
|
||||
{ "LivePlayer/BasicCalculator/Calculator.iOS/Calculator.iOS.csproj", new SampleTest { BuildSolution = true, Solution = "LivePlayer/BasicCalculator/Calculator.sln" } },
|
||||
{ "MonoGameTvOs/MonoGameTvOs/MonoGameTvOs.csproj", new SampleTest { BuildSolution = true, Solution = "MonoGameTvOs/MonoGameTvOs.sln" } },
|
||||
{ "SpriteSheetDemo/iOS/SpriteSheetDemo.iOS.csproj", new SampleTest { BuildSolution = true, Solution = "SpriteSheetDemo/SpriteSheetDemo.sln" } },
|
||||
{ "TaskyPortable/TaskyiOS/TaskyiOS.csproj", new SampleTest { BuildSolution = true, Solution = "TaskyPortable/TaskyPortable.sln" } },
|
||||
{ "TipCalc/TipCalc-UI-iOS/TipCalc-UI-iOS.csproj", new SampleTest { BuildSolution = true, Solution = "TipCalc/TipCalc.sln" } },
|
||||
|
||||
// Known failures
|
||||
{ "RazorTodo/RazorNativeTodo/RazorNativeTodo.iOS/RazorNativeTodo.iOS.csproj", new SampleTest { BuildSolution = true, Solution = "RazorTodo/RazorNativeTodo/RazorNativeTodo.sln", KnownFailure = "There's a Xamarin.Android project in the solution, and I can't figure out how to build only the Xamarin.iOS project." } },
|
||||
{ "RazorTodo/RazorTodo/RazorTodo.iOS/RazorTodo.iOS.csproj", new SampleTest { BuildSolution = true, Solution = "RazorTodo/RazorTodo/RazorTodo.sln", KnownFailure = "There's a Xamarin.Android project in the solution, and I can't figure out how to build only the Xamarin.iOS project." } },
|
||||
{ "VisualBasic/TaskyPortableVB/TaskyiOS/TaskyiOS.csproj", new SampleTest { KnownFailure = "VisualBasic not supported on macOS: error MSB4057: The target \"Build\" does not exist in the project." } },
|
||||
{ "VisualBasic/XamarinFormsVB/XamarinForms.iOS/XamarinForms.iOS.csproj", new SampleTest { KnownFailure = "VisualBasic not supported on macOS." } },
|
||||
{ "WebServices/WebServiceSamples/WebServices.RxNorm/src/WebServices.RxNormSample/WebServices.RxNormSample.csproj", new SampleTest { KnownFailure = "Xamarin.iOS Classic isn't supported anymore." } },
|
||||
};
|
||||
|
||||
static IEnumerable<SampleTestData> GetSampleData ()
|
||||
{
|
||||
return GetSampleTestData (test_data, ORG, REPO, HASH, DEFAULT_BRANCH, DefaultTimeout);
|
||||
}
|
||||
}
|
||||
|
||||
[Category (CATEGORY)]
|
||||
public class PrebuiltAppTester : SampleTester {
|
||||
const string ORG = "xamarin";
|
||||
const string REPO = "prebuilt-apps";
|
||||
const string CATEGORY = "prebuiltapps"; // categories can't contain dashes
|
||||
const string HASH = "f111672bc6915ceb402abb47dedfe3480e111720";
|
||||
const string DEFAULT_BRANCH = "master";
|
||||
|
||||
static Dictionary<string, SampleTest> test_data = new Dictionary<string, SampleTest> {
|
||||
// Known failures
|
||||
{ "FieldService/FieldService.iOS/FieldService.iOS.csproj", new SampleTest { KnownFailure = "The sample uses Xamarin Components which don't work anymore." } },
|
||||
};
|
||||
|
||||
static IEnumerable<SampleTestData> GetSampleData ()
|
||||
{
|
||||
return GetSampleTestData (test_data, ORG, REPO, HASH, DEFAULT_BRANCH, DefaultTimeout);
|
||||
}
|
||||
}
|
||||
|
||||
[Category (CATEGORY)]
|
||||
public class XamarinFormsTester : SampleTester {
|
||||
const string ORG = "xamarin";
|
||||
const string REPO = "xamarin-forms-samples";
|
||||
const string CATEGORY = "xamarinformssamples"; // categories can't contain dashes
|
||||
const string HASH = "d196d3f7ba418d06ef799074eb4f6120e26a9cf4";
|
||||
const string DEFAULT_BRANCH = "master";
|
||||
|
||||
static Dictionary<string, SampleTest> test_data = new Dictionary<string, SampleTest> {
|
||||
// avoid building unneeded projects since they require a lot of nuget packages (and cause a lot of unrelated/network build issues)
|
||||
{ "WebServices/TodoREST/iOS/TodoREST.iOS.csproj", new SampleTest { Solution = "WebServices/TodoREST/TodoREST.sln", RemoveProjects = new [] { "TodoAPI", "TodoREST.Droid" } } },
|
||||
{ "WorkingWithMaps/iOS/WorkingWithMaps.iOS.csproj", new SampleTest { Solution = "WorkingWithMaps/WorkingWithMaps.sln", RemoveProjects = new [] { "WorkingWithMaps.Android", "WorkingWithMaps.UWP" } } },
|
||||
// Build solution instead of csproj.
|
||||
{ "WebServices/TodoWCF/iOS/TodoWCF.iOS.csproj", new SampleTest { BuildSolution = true, Solution = "WebServices/TodoWCF/TodoWCF.sln" } },
|
||||
};
|
||||
|
||||
static IEnumerable<SampleTestData> GetSampleData ()
|
||||
{
|
||||
// Samples.XamarinFormsTester.BuildSample(MarkupExtensions.iOS: Debug|iPhone) needs some extra time 10 minutes
|
||||
return GetSampleTestData (test_data, ORG, REPO, HASH, DEFAULT_BRANCH, TimeSpan.FromMinutes (10));
|
||||
}
|
||||
}
|
||||
|
||||
[Category (CATEGORY)]
|
||||
public class XamarinFormsBooksTester : SampleTester {
|
||||
const string ORG = "xamarin";
|
||||
const string REPO = "xamarin-forms-book-samples";
|
||||
const string CATEGORY = "xamarinformsbookssamples"; // categories can't contain dashes
|
||||
const string HASH = "c215bab3324d77e13bd80a0c20e60786d2bd344b";
|
||||
const string DEFAULT_BRANCH = "master";
|
||||
|
||||
static Dictionary<string, SampleTest> test_data = new Dictionary<string, SampleTest> {
|
||||
// Build solution instead of csproj,
|
||||
{ "Chapter20/TextFileAsync/TextFileAsync/TextFileAsync.iOS/TextFileAsync.iOS.csproj", new SampleTest { BuildSolution = true, Solution = "Chapter20/TextFileAsync/TextFileAsync.sln" } },
|
||||
{ "Chapter24/NoteTaker/NoteTaker/NoteTaker.iOS/NoteTaker.iOS.csproj", new SampleTest { BuildSolution = true, Solution = "Chapter24/NoteTaker/NoteTaker.sln" } },
|
||||
{ "Chapter27/BouncingBall/BouncingBall/BouncingBall.iOS/BouncingBall.iOS.csproj", new SampleTest { BuildSolution = true, Solution = "Chapter27/BouncingBall/BouncingBall.sln" } },
|
||||
{ "Chapter27/EllipseDemo/EllipseDemo/EllipseDemo.iOS/EllipseDemo.iOS.csproj", new SampleTest { BuildSolution = true, Solution = "Chapter27/EllipseDemo/EllipseDemo.sln" } },
|
||||
{ "Chapter27/StepSliderDemo/StepSliderDemo/StepSliderDemo.iOS/StepSliderDemo.iOS.csproj", new SampleTest { BuildSolution = true, Solution = "Chapter27/StepSliderDemo/StepSliderDemo.sln" } },
|
||||
{ "Chapter28/MapDemos/MapDemos/MapDemos.iOS/MapDemos.iOS.csproj", new SampleTest { BuildSolution = true, Solution = "Chapter28/MapDemos/MapDemos.sln" } },
|
||||
{ "Chapter28/WhereAmI/WhereAmI/WhereAmI.iOS/WhereAmI.iOS.csproj", new SampleTest { BuildSolution = true, Solution = "Chapter28/WhereAmI/WhereAmI.sln" } },
|
||||
};
|
||||
|
||||
static IEnumerable<SampleTestData> GetSampleData ()
|
||||
{
|
||||
// Samples.XamarinFormsBooksTester.BuildSample(FormattedTextToggle.iOS: Release|iPhone) needs some extra time 10 minutes
|
||||
return GetSampleTestData (test_data, ORG, REPO, HASH, DEFAULT_BRANCH, TimeSpan.FromMinutes (10));
|
||||
}
|
||||
}
|
||||
|
||||
[Category (CATEGORY)]
|
||||
public class EmbeddedFrameworksTester : SampleTester {
|
||||
const string ORG = "rolfbjarne";
|
||||
const string REPO = "embedded-frameworks";
|
||||
const string CATEGORY = "embeddedframeworks"; // categories can't contain dashes
|
||||
const string HASH = "faaad6f9dcda53b2c49cec567eca769cb534307f";
|
||||
const string DEFAULT_BRANCH = "main";
|
||||
|
||||
static Dictionary<string, SampleTest> test_data = new Dictionary<string, SampleTest> {
|
||||
// Known failures
|
||||
{ "simpleapp-with-framework/simpleapp-with-framework/simpleapp-with-framework.csproj", new SampleTest { BuildSolution = true, Solution = "simpleapp-with-framework/simpleapp-with-framework.sln" } },
|
||||
};
|
||||
|
||||
static IEnumerable<SampleTestData> GetSampleData ()
|
||||
{
|
||||
return GetSampleTestData (test_data, ORG, REPO, HASH, DEFAULT_BRANCH, DefaultTimeout);
|
||||
}
|
||||
}
|
||||
|
||||
[Category (CATEGORY)]
|
||||
public class XappyTester : SampleTester {
|
||||
const string ORG = "davidortinau";
|
||||
const string REPO = "Xappy";
|
||||
const string CATEGORY = "davidortinauxappy"; // categories can't contain dashes
|
||||
const string HASH = "46e5897bac974e000fcc7e1d10d01ab8d3072eb2";
|
||||
const string DEFAULT_BRANCH = "master";
|
||||
|
||||
static Dictionary<string, SampleTest> test_data = new Dictionary<string, SampleTest> {
|
||||
{ "Xappy/Xappy.iOS/Xappy.iOS.csproj", new SampleTest { BuildSolution = true, Solution = "Xappy.sln", RemoveProjects = new [] { "Xappy.Android", "Xappy.UWP" } } },
|
||||
};
|
||||
|
||||
static IEnumerable<SampleTestData> GetSampleData ()
|
||||
{
|
||||
return GetSampleTestData (test_data, ORG, REPO, HASH, DEFAULT_BRANCH, DefaultTimeout);
|
||||
}
|
||||
}
|
||||
|
||||
[Category (CATEGORY)]
|
||||
public class SmartHotelTester : SampleTester {
|
||||
const string ORG = "microsoft";
|
||||
const string REPO = "SmartHotel360-Mobile";
|
||||
const string CATEGORY = "microsoftsmarthotel"; // categories can't contain dashes
|
||||
const string HASH = "4004b32c955f8340a0306bad2b180ecf5adaf117";
|
||||
const string DEFAULT_BRANCH = "master";
|
||||
|
||||
static Dictionary<string, SampleTest> test_data = new Dictionary<string, SampleTest> {
|
||||
// Override CodesignKey key
|
||||
{ "Source/SmartHotel.Clients/SmartHotel.Clients.iOS/SmartHotel.Clients.iOS.csproj", new SampleTest { CodesignKey = "iPhone Developer" } },
|
||||
{ "Source/SmartHotel.Clients.Maintenance/SmartHotel.Clients.Maintenance.iOS/SmartHotel.Clients.Maintenance.iOS.csproj", new SampleTest { CodesignKey = "iPhone Developer" } },
|
||||
};
|
||||
|
||||
static IEnumerable<SampleTestData> GetSampleData ()
|
||||
{
|
||||
return GetSampleTestData (test_data, ORG, REPO, HASH, DEFAULT_BRANCH, timeout: TimeSpan.FromMinutes (10));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
public enum TestPlatform {
|
||||
None,
|
||||
iOS,
|
||||
macOS,
|
||||
watchOS,
|
||||
tvOS,
|
||||
}
|
Двоичные данные
tests/sampletester/images/provision_from_commit.png
Двоичные данные
tests/sampletester/images/provision_from_commit.png
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 98 KiB |
|
@ -1,79 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\..\packages\NUnit.3.11.0\build\NUnit.props" Condition="Exists('..\..\packages\NUnit.3.11.0\build\NUnit.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{7340A1C6-61A5-42D2-9DBC-6688D2E70F62}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>sampletester</RootNamespace>
|
||||
<AssemblyName>sampletester</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<LangVersion>latest</LangVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.Xml" />
|
||||
<PackageReference Include="NUnit" Version="3.12.0" />
|
||||
<PackageReference Include="NUnit.ConsoleRunner" Version="3.11.1" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="SampleTester.cs" />
|
||||
<Compile Include="GitHub.cs" />
|
||||
<Compile Include="Configuration.cs" />
|
||||
<Compile Include="ProcessHelper.cs" />
|
||||
<Compile Include="BaseTester.cs" />
|
||||
<Compile Include="TestPlatform.cs" />
|
||||
<Compile Include="..\mtouch\Cache.cs">
|
||||
<Link>external\Cache.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\tools\common\StringUtils.cs">
|
||||
<Link>external\StringUtils.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\common\Configuration.cs">
|
||||
<Link>external\Configuration.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\common\Profile.cs">
|
||||
<Link>external\Profile.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\common\ExecutionHelper.cs">
|
||||
<Link>external\ExecutionHelper.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Samples.cs" />
|
||||
<Compile Include="..\..\tools\common\Execution.cs">
|
||||
<Link>external\Execution.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\tools\common\ApplePlatform.cs">
|
||||
<Link>external\ApplePlatform.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\tools\common\SdkVersions.cs">
|
||||
<Link>external\SdkVersions.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\..\tools\common\TargetFramework.cs">
|
||||
<Link>external\TargetFramework.cs</Link>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="external\" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
|
@ -1,25 +0,0 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "sampletester", "sampletester.csproj", "{7340A1C6-61A5-42D2-9DBC-6688D2E70F62}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{7340A1C6-61A5-42D2-9DBC-6688D2E70F62}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{7340A1C6-61A5-42D2-9DBC-6688D2E70F62}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{7340A1C6-61A5-42D2-9DBC-6688D2E70F62}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{7340A1C6-61A5-42D2-9DBC-6688D2E70F62}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{7340A1C6-61A5-42D2-9DBC-6688D2E70F62}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
|
||||
{7340A1C6-61A5-42D2-9DBC-6688D2E70F62}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
|
||||
{7340A1C6-61A5-42D2-9DBC-6688D2E70F62}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
|
||||
{7340A1C6-61A5-42D2-9DBC-6688D2E70F62}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
|
||||
{7340A1C6-61A5-42D2-9DBC-6688D2E70F62}.Debug|iPhone.ActiveCfg = Debug|Any CPU
|
||||
{7340A1C6-61A5-42D2-9DBC-6688D2E70F62}.Debug|iPhone.Build.0 = Debug|Any CPU
|
||||
{7340A1C6-61A5-42D2-9DBC-6688D2E70F62}.Release|iPhone.ActiveCfg = Release|Any CPU
|
||||
{7340A1C6-61A5-42D2-9DBC-6688D2E70F62}.Release|iPhone.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -212,7 +212,6 @@ Describe "TestResults tests" {
|
|||
"configuration.BuildNugets": "True",
|
||||
"configuration.BuildPkgs": "True",
|
||||
"configuration.PR_ID": "20434",
|
||||
"configuration.RunSampleTests": "",
|
||||
"configuration.SignPkgs": "True",
|
||||
"build.TESTS_BOT": "XAMBOT-1001.Sonoma"
|
||||
},
|
||||
|
|
|
@ -302,7 +302,6 @@ class BuildConfiguration {
|
|||
"skip-packages",
|
||||
"skip-nugets",
|
||||
"skip-signing",
|
||||
"run-sample-tests",
|
||||
"skip-packaged-macos-tests",
|
||||
"run-packaged-macos-tests",
|
||||
"skip-api-comparison",
|
||||
|
|
|
@ -46,17 +46,12 @@ if ($BuildReason -eq "PullRequest" -or (($BuildReason -eq "Manual" -or $BuildRea
|
|||
$configVars.Add("SignPkgs", "True")
|
||||
}
|
||||
|
||||
$configVars.Add("RunSampleTests", $Env:RunSampleTests)
|
||||
|
||||
} else {
|
||||
# set the defaults, all the things! o/
|
||||
# build pkg, nugets and sign them
|
||||
$configVars.Add("BuildPkgs", "True")
|
||||
$configVars.Add("BuildNugets", "True")
|
||||
$configVars.Add("SignPkgs", "True")
|
||||
|
||||
# tests, run all of them, internal, external, mac but not sample tests
|
||||
$configVars.Add("RunSampleTests", "False")
|
||||
}
|
||||
# write debugging and process of the vars
|
||||
foreach($key in $configVars.Keys) {
|
||||
|
|
|
@ -68,12 +68,10 @@ jobs:
|
|||
# skip-packages
|
||||
# skip-nugets
|
||||
# skip-signing
|
||||
# run-sample-tests
|
||||
BuildPackage: $[ stageDependencies.configure_build.configure.outputs['labels.build_package'] ]
|
||||
SkipPackages: $[ stageDependencies.configure_build.configure.outputs['labels.skip_packages'] ]
|
||||
SkipNugets: $[ stageDependencies.configure_build.configure.outputs['labels.skip_nugets'] ]
|
||||
SkipSigning: $[ stageDependencies.configure_build.configure.outputs['labels.skip_signing'] ]
|
||||
RunSampleTests: $[ stageDependencies.configure_build.configure.outputs['labels.run_sample_tests'] ]
|
||||
SkipApiComparison: $[ stageDependencies.configure_build.configure.outputs['labels.skip_api_comparison'] ]
|
||||
# old and ugly env var use by jenkins, we do have parts of the code that use it, contains the PR number
|
||||
PR_ID: $[ stageDependencies.configure_build.configure.outputs['labels.pr_number'] ]
|
||||
|
|
|
@ -45,11 +45,6 @@ parameters:
|
|||
type: boolean
|
||||
default: true
|
||||
|
||||
- name: runSamples
|
||||
displayName: Run Samples
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
- name: testConfigurations
|
||||
displayName: Test configurations to run
|
||||
type: object
|
||||
|
@ -128,7 +123,6 @@ stages:
|
|||
runTests: ${{ parameters.runTests }}
|
||||
runDeviceTests: ${{ parameters.runDeviceTests }}
|
||||
runWindowsIntegration: ${{ parameters.runWindowsIntegration }}
|
||||
runSamples: ${{ parameters.runSamples }}
|
||||
${{ if ne(length(parameters.testConfigurations), 0)}}:
|
||||
testConfigurations: ${{ parameters.testConfigurations }}
|
||||
deviceTestsConfigurations: ${{ parameters.deviceTestsConfigurations }}
|
||||
|
|
|
@ -24,10 +24,6 @@ parameters:
|
|||
type: boolean
|
||||
default: true
|
||||
|
||||
- name: runSamples
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
- name: isPR
|
||||
type: boolean
|
||||
|
||||
|
@ -271,20 +267,3 @@ stages:
|
|||
gitHubToken: $(Github.Token)
|
||||
xqaCertPass: $(xqa--certificates--password)
|
||||
postPipeline: true
|
||||
|
||||
- ${{ if eq(parameters.runSamples, true) }}:
|
||||
# TODO: Not the real step
|
||||
- stage: sample_testing
|
||||
displayName: '${{ stageDisplayNamePrefix }}Sample testing'
|
||||
dependsOn:
|
||||
- build_packages
|
||||
condition: and(succeeded(), contains (stageDependencies.build_packages.build.outputs['configuration.RunSampleTests'], 'True'))
|
||||
jobs:
|
||||
- job: sample_testing
|
||||
pool:
|
||||
vmImage: ubuntu-latest
|
||||
steps:
|
||||
# TODO: do parse labels
|
||||
- bash: |
|
||||
echo "Samples!"
|
||||
displayName: 'Sample testing'
|
||||
|
|
|
@ -1,39 +0,0 @@
|
|||
#!/bin/bash -ex
|
||||
|
||||
# This script takes
|
||||
# First argument: the github token to authenticate with
|
||||
# Subsequent arguments: the names of each test variation in the test matrix.
|
||||
# There is a corresponding environment variable with the result from each test variation.
|
||||
|
||||
|
||||
# Print environment for debugging
|
||||
env | sort
|
||||
|
||||
TOKEN=$1
|
||||
shift 1
|
||||
STEPS="$*"
|
||||
|
||||
EMOJII="✅"
|
||||
GH_STATE=success
|
||||
FILE=commit-comment.md
|
||||
|
||||
for STEP in $STEPS; do
|
||||
# The environment variable's name is the variation name in uppercase, and special symbols removed (|-_)
|
||||
STEPNAME=JOBRESULT$(echo "$STEP" | tr '[:lower:]' '[:upper:]' | sed -e 's/|//g' -e 's/-//g' -e 's/_//g')
|
||||
STEPSTATUS=${!STEPNAME}
|
||||
if [[ "$STEPSTATUS" == "Succeeded" ]]; then
|
||||
STEPEMOJII="✅"
|
||||
else
|
||||
STEPEMOJII="❌"
|
||||
EMOJII="❌"
|
||||
GH_STATE=failure
|
||||
fi
|
||||
echo "* $STEPEMOJII $STEP: $STEPSTATUS" >> "$FILE"
|
||||
done
|
||||
|
||||
printf "%s\n\n" "$EMOJII Status for '$BUILD_DEFINITIONNAME': [$GH_STATE]($AZURE_BUILD_URL)." | cat - "$FILE" > "$FILE.tmp"
|
||||
mv "$FILE.tmp" "$FILE"
|
||||
|
||||
./jenkins/add-commit-comment.sh "--token=$TOKEN" "--hash=$BUILD_SOURCEVERSION" "--file=$FILE"
|
||||
./jenkins/add-commit-status.sh "--token=$TOKEN" "--hash=$BUILD_SOURCEVERSION" "--state=$GH_STATE" --target-url="$AZURE_BUILD_URL" --description="$BUILD_DEFINITIONNAME" --context="$BUILD_DEFINITIONNAME"
|
||||
rm -f "$FILE"
|
|
@ -1,57 +0,0 @@
|
|||
#load "utils.csx"
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
using Xamarin.Provisioning;
|
||||
using Xamarin.Provisioning.Model;
|
||||
|
||||
// Provision Mono, Mono, Objective-Sharpie, provisioning profiles.
|
||||
//
|
||||
// We get Mono from the current commit's MIN_MONO_URL value in Make.config
|
||||
//
|
||||
// Overrides:
|
||||
// * Each download URL can be overriden by setting an environment variable (MIN_MONO_URL).
|
||||
// * The current commit can be overridden by setting the PROVISION_FROM_COMMIT variable. This is usually easier than overriding each url.
|
||||
|
||||
var commit = Environment.GetEnvironmentVariable ("BUILD_SOURCEVERSION");
|
||||
var provision_from_commit = Environment.GetEnvironmentVariable ("PROVISION_FROM_COMMIT") ?? commit;
|
||||
|
||||
string FindVariable (string variable, bool throwIfNotFound = true)
|
||||
{
|
||||
var value = FindConfigurationVariable (variable, provision_from_commit);
|
||||
if (!string.IsNullOrEmpty (value))
|
||||
return value;
|
||||
|
||||
if (!string.IsNullOrEmpty (value))
|
||||
return value;
|
||||
|
||||
if (!throwIfNotFound)
|
||||
return null;
|
||||
|
||||
throw new Exception ($"Could not find {variable} in environment nor in the commit's ({commit}) manifest.");
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty (provision_from_commit)) {
|
||||
Console.Error.WriteLine ($"Either BUILD_SOURCEVERSION or PROVISION_FROM_COMMIT must be set.");
|
||||
Environment.Exit (1);
|
||||
return 1;
|
||||
}
|
||||
Console.WriteLine ($"Provisioning from {provision_from_commit}...");
|
||||
|
||||
InstallPackage ("Mono", FindVariable ("MIN_MONO_URL"));
|
||||
InstallPackage ("Objective-Sharpie", FindVariable ("MIN_SHARPIE_URL"));
|
||||
|
||||
// Provisioning profiles
|
||||
Console.WriteLine ("Provisioning provisioning profiles...");
|
||||
Exec ($"../../../maccore/tools/install-qa-provisioning-profiles.sh");
|
||||
|
||||
// .NET core
|
||||
// The version number here must match the one in Xamarin.Tests.Configuration:CreateGlobalConfig (tests/sampletester/Configuration.cs).
|
||||
DotNetCoreSdk ("2.2.204");
|
|
@ -1,6 +0,0 @@
|
|||
#!/bin/bash -eux
|
||||
|
||||
cd "$(dirname "${BASH_SOURCE[0]}")/../.."
|
||||
|
||||
make -C tests test-system.config
|
||||
make -C tests/sampletester TESTS_USE_SYSTEM=1
|
|
@ -1,231 +0,0 @@
|
|||
# Xamarin
|
||||
# Build samples
|
||||
|
||||
variables:
|
||||
azure_build_url: '$(System.CollectionUri)/$(System.TeamProject)/_build/results?buildId=$(Build.BuildId)'
|
||||
azpPoolName: 'Azure Pipelines'
|
||||
macOSVersion: 'internal-macos-11'
|
||||
debug_filter: '^.*Debug.*$'
|
||||
release_filter: '^.*Release.*$'
|
||||
iphone_filter: '^iPhone$'
|
||||
iphonesimulator_filter: '^iPhoneSimulator$'
|
||||
mac_platform_filter: '^$'
|
||||
name_filter_af: '^[A-Fa-f].*$'
|
||||
name_filter_gr: '^[G-Rg-r].*$'
|
||||
name_filter_rest: '^[^A-Ra-r].*$'
|
||||
|
||||
resources:
|
||||
repositories:
|
||||
- repository: xamarin-macios-data
|
||||
type: github
|
||||
name: xamarin/xamarin-macios-data
|
||||
ref: refs/heads/main
|
||||
endpoint: xamarin
|
||||
- repository: maccore
|
||||
type: github
|
||||
name: xamarin/maccore
|
||||
ref: refs/heads/main
|
||||
endpoint: xamarin
|
||||
|
||||
###
|
||||
### Tell GitHub we're starting working on this commit
|
||||
###
|
||||
|
||||
jobs:
|
||||
- job: ReportStartToGitHub
|
||||
displayName: Set pending GitHub status
|
||||
pool:
|
||||
name: '$(azpPoolName)'
|
||||
vmImage: '$(macOSVersion)'
|
||||
steps:
|
||||
- bash: ./jenkins/add-commit-status.sh "--token=$(github-pat)" "--hash=$BUILD_SOURCEVERSION" "--state=pending" --target-url="$AZURE_BUILD_URL" --description="$BUILD_DEFINITIONNAME" --context="$BUILD_DEFINITIONNAME"
|
||||
displayName: Set pending GitHub status
|
||||
|
||||
###
|
||||
### Run the sample tests.
|
||||
###
|
||||
### They're split over multiple bots to make them run faster (and not hit the
|
||||
### max job time duration for a single job).
|
||||
###
|
||||
|
||||
- job: macOS
|
||||
dependsOn: ReportStartToGitHub
|
||||
displayName: Build samples
|
||||
timeoutInMinutes: 360
|
||||
strategy:
|
||||
matrix:
|
||||
# We have rougly 900 tests, which take a while to build for device.
|
||||
# So in that case, we split them in 3 buckets of roughly 300 tests each,
|
||||
# based on the first letter of the project's filename.
|
||||
Debug_iPhone_AF:
|
||||
TEST_PLATFORM_FILTER_EXPRESSION: $(iphone_filter)
|
||||
TEST_CONFIG_FILTER_EXPRESSION: $(debug_filter)
|
||||
TEST_NAME_FILTER_EXPRESSION: $(name_filter_af)
|
||||
Debug_iPhone_GR:
|
||||
TEST_PLATFORM_FILTER_EXPRESSION: $(iphone_filter)
|
||||
TEST_CONFIG_FILTER_EXPRESSION: $(debug_filter)
|
||||
TEST_NAME_FILTER_EXPRESSION: $(name_filter_gr)
|
||||
Debug_iPhone_SZ:
|
||||
TEST_PLATFORM_FILTER_EXPRESSION: $(iphone_filter)
|
||||
TEST_CONFIG_FILTER_EXPRESSION: $(debug_filter)
|
||||
TEST_NAME_FILTER_EXPRESSION: $(name_filter_rest)
|
||||
Debug_iPhoneSimulator:
|
||||
TEST_PLATFORM_FILTER_EXPRESSION: $(iphonesimulator_filter)
|
||||
TEST_CONFIG_FILTER_EXPRESSION: $(debug_filter)
|
||||
Release_iPhone_AF:
|
||||
TEST_PLATFORM_FILTER_EXPRESSION: $(iphone_filter)
|
||||
TEST_CONFIG_FILTER_EXPRESSION: $(release_filter)
|
||||
TEST_NAME_FILTER_EXPRESSION: $(name_filter_af)
|
||||
Release_iPhone_GR:
|
||||
TEST_PLATFORM_FILTER_EXPRESSION: $(iphone_filter)
|
||||
TEST_CONFIG_FILTER_EXPRESSION: $(release_filter)
|
||||
TEST_NAME_FILTER_EXPRESSION: $(name_filter_gr)
|
||||
Release_iPhone_SZ:
|
||||
TEST_PLATFORM_FILTER_EXPRESSION: $(iphone_filter)
|
||||
TEST_CONFIG_FILTER_EXPRESSION: $(release_filter)
|
||||
TEST_NAME_FILTER_EXPRESSION: $(name_filter_rest)
|
||||
Release_iPhoneSimulator:
|
||||
TEST_PLATFORM_FILTER_EXPRESSION: $(iphonesimulator_filter)
|
||||
TEST_CONFIG_FILTER_EXPRESSION: $(release_filter)
|
||||
Debug_Mac:
|
||||
TEST_PLATFORM_FILTER_EXPRESSION: $(mac_platform_filter)
|
||||
TEST_CONFIG_FILTER_EXPRESSION: $(debug_filter)
|
||||
Release_Mac:
|
||||
TEST_PLATFORM_FILTER_EXPRESSION: $(mac_platform_filter)
|
||||
TEST_CONFIG_FILTER_EXPRESSION: $(release_filter)
|
||||
|
||||
pool:
|
||||
name: '$(azpPoolName)'
|
||||
vmImage: '$(macOSVersion)'
|
||||
|
||||
steps:
|
||||
- checkout: self
|
||||
path: s/xamarin-macios
|
||||
- checkout: xamarin-macios-data
|
||||
persistCredentials: true
|
||||
- checkout: maccore
|
||||
persistCredentials: true
|
||||
|
||||
- bash: ./xamarin-macios/tools/devops/system-info.sh
|
||||
displayName: System Info
|
||||
|
||||
- bash: ./xamarin-macios/tools/devops/fetch-maccore.sh
|
||||
displayName: Fetch correct maccore hash
|
||||
|
||||
- bash: |
|
||||
echo "Requested Xcode $XCODE_URL"
|
||||
make -C $(System.DefaultWorkingDirectory)/xamarin-macios/tools/devops/ provision-xcode.csx
|
||||
displayName: 'Generate Xcode provisioning csx file'
|
||||
|
||||
- task: provisionator@2
|
||||
displayName: Xcode
|
||||
inputs:
|
||||
provisionator_uri: '$(provisionator-uri)'
|
||||
github_token: '$(github-pat)'
|
||||
provisioning_script: $(System.DefaultWorkingDirectory)/xamarin-macios/tools/devops/provision-xcode.csx
|
||||
|
||||
- task: provisionator@2
|
||||
displayName: Provision XI/XM/Mono/Objective-Sharpie
|
||||
inputs:
|
||||
provisionator_uri: '$(provisionator-uri)'
|
||||
github_token: '$(github-pat)'
|
||||
provisioning_script: $(System.DefaultWorkingDirectory)/xamarin-macios/tools/devops/build-samples.csx
|
||||
|
||||
- bash: ./xamarin-macios/tools/devops/system-info.sh
|
||||
displayName: System Info post provisioning
|
||||
|
||||
- bash: ./xamarin-macios/tools/devops/build-samples.sh
|
||||
displayName: Run tests
|
||||
|
||||
- task: PublishTestResults@2
|
||||
displayName: Publish test results
|
||||
condition: always()
|
||||
inputs:
|
||||
testResultsFormat: NUnit
|
||||
testResultsFiles: '**/TestResult*.xml'
|
||||
testRunTitle: Sample tests (build)
|
||||
publishRunAttachments: true
|
||||
mergeTestResults: true
|
||||
|
||||
- bash: ./xamarin-macios/tools/devops/prepare-performance-data.sh
|
||||
displayName: Prepare performance data
|
||||
condition: always()
|
||||
|
||||
- publish: logs
|
||||
displayName: 'Upload perf data'
|
||||
condition: always()
|
||||
artifact: logs-$(System.JobId)
|
||||
|
||||
- bash: echo "##vso[task.setvariable variable=JobStatus;isOutput=true]$AGENT_JOBSTATUS"
|
||||
name: ExportedVariables
|
||||
displayName: Export status
|
||||
condition: always()
|
||||
|
||||
###
|
||||
### Push performance data to the xamarin-macios-data repository
|
||||
###
|
||||
|
||||
- job: PublishPerformanceData
|
||||
displayName: Publish Performance Data
|
||||
condition: always()
|
||||
dependsOn: macOS
|
||||
pool:
|
||||
name: '$(azpPoolName)'
|
||||
vmImage: '$(macOSVersion)'
|
||||
steps:
|
||||
- checkout: self
|
||||
path: s/xamarin-macios
|
||||
- checkout: xamarin-macios-data
|
||||
persistCredentials: true
|
||||
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: Download performance data
|
||||
inputs:
|
||||
source: current
|
||||
path: logs
|
||||
|
||||
- bash: ./xamarin-macios/tools/devops/push-performance-data.sh
|
||||
displayName: Publish perf data
|
||||
|
||||
- bash: echo "##vso[task.setvariable variable=JobStatus;isOutput=true]$AGENT_JOBSTATUS"
|
||||
name: ExportedVariables
|
||||
displayName: Export status
|
||||
condition: always()
|
||||
|
||||
###
|
||||
### Report final results to GitHub
|
||||
###
|
||||
|
||||
- job: ReportResultsToGitHub
|
||||
displayName: Report status/results to GitHub
|
||||
dependsOn:
|
||||
- PublishPerformanceData
|
||||
- macOS
|
||||
condition: always()
|
||||
pool:
|
||||
name: '$(azpPoolName)'
|
||||
vmImage: '$(macOSVersion)'
|
||||
variables:
|
||||
jobResultDebugiPhoneAF: $[ dependencies.macOS.outputs['Debug_iPhone_AF.ExportedVariables.JobStatus'] ]
|
||||
jobResultDebugiPhoneGR: $[ dependencies.macOS.outputs['Debug_iPhone_GR.ExportedVariables.JobStatus'] ]
|
||||
jobResultDebugiPhoneSZ: $[ dependencies.macOS.outputs['Debug_iPhone_SZ.ExportedVariables.JobStatus'] ]
|
||||
jobResultDebugiPhoneSimulator: $[ dependencies.macOS.outputs['Debug_iPhoneSimulator.ExportedVariables.JobStatus'] ]
|
||||
jobResultReleaseiPhoneAF: $[ dependencies.macOS.outputs['Release_iPhone_AF.ExportedVariables.JobStatus'] ]
|
||||
jobResultReleaseiPhoneGR: $[ dependencies.macOS.outputs['Release_iPhone_GR.ExportedVariables.JobStatus'] ]
|
||||
jobResultReleaseiPhoneSZ: $[ dependencies.macOS.outputs['Release_iPhone_SZ.ExportedVariables.JobStatus'] ]
|
||||
jobResultReleaseiPhoneSimulator: $[ dependencies.macOS.outputs['Release_iPhoneSimulator.ExportedVariables.JobStatus'] ]
|
||||
jobResultDebugMac: $[ dependencies.macOS.outputs['Debug_Mac.ExportedVariables.JobStatus'] ]
|
||||
jobResultReleaseMac: $[ dependencies.macOS.outputs['Release_Mac.ExportedVariables.JobStatus'] ]
|
||||
jobResultPublishPerformanceData: $[ dependencies.PublishPerformanceData.outputs['ExportedVariables.JobStatus'] ]
|
||||
steps:
|
||||
- bash: |
|
||||
./tools/devops/build-samples-report-to-github.sh "$(github-pat)" \
|
||||
"Debug_iPhone_AF" "Debug_iPhone_GR" "Debug_iPhone_SZ" \
|
||||
"Debug_iPhoneSimulator" \
|
||||
"Release_iPhone_AF" "Release_iPhone_GR" "Release_iPhone_SZ" \
|
||||
"Release_iPhoneSimulator" \
|
||||
"Debug_Mac" \
|
||||
"Release_Mac" \
|
||||
"PublishPerformanceData"
|
||||
displayName: Report results to GitHub as comment / status
|
||||
condition: always()
|
|
@ -1,14 +0,0 @@
|
|||
#!/bin/bash -ex
|
||||
|
||||
DIR=perf-data/samples/$BUILD_SOURCEBRANCHNAME/$BUILD_SOURCEVERSION/$SYSTEM_JOBID
|
||||
mkdir -p "$DIR"
|
||||
|
||||
XMLS=(xamarin-macios/tests/sampletester/bin/Debug/tmp-test-dir/execution-logs/*.xml)
|
||||
if ! test -f "${XMLS[0]}"; then
|
||||
echo "##vso[task.logissue type=warning]Could not find any performance data to publish"
|
||||
exit 0
|
||||
fi
|
||||
cp -c xamarin-macios/tests/sampletester/bin/Debug/tmp-test-dir/execution-logs/*.xml "$DIR/"
|
||||
|
||||
mkdir -p logs
|
||||
zip -9r "logs/execution-logs-$SYSTEM_JOBID.zip" perf-data
|
Загрузка…
Ссылка в новой задаче