Allow duplicate issue numbers per tracker (#1127)

This commit is contained in:
E.Z. Hart 2017-09-06 10:36:28 -06:00 коммит произвёл Stephane Delcroix
Родитель 72fd2eef5f
Коммит a544753154
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: EDD442EF80530554
7 изменённых файлов: 39 добавлений и 19 удалений

Просмотреть файл

@ -9,7 +9,8 @@ using NUnit.Framework;
namespace Xamarin.Forms.Controls.Issues
{
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Bugzilla, 53179, "PopAsync crashing after RemovePage when support packages are updated to 25.1.1", PlatformAffected.Android)]
[Issue(IssueTracker.Bugzilla, 53179,
"PopAsync crashing after RemovePage when support packages are updated to 25.1.1", PlatformAffected.Android)]
public class Bugzilla53179 : TestNavigationPage
{
class TestPage : ContentPage

Просмотреть файл

@ -14,10 +14,10 @@ namespace Xamarin.Forms.Controls.Issues
#endif
[Preserve(AllMembers = true)]
[Issue(IssueTracker.None, 0101100101,
[Issue(IssueTracker.Bugzilla, 53179,
"PopAsync crashing after RemovePage when support packages are updated to 25.1.1",
PlatformAffected.Android)]
public class PopAfterRemove : TestNavigationPage
PlatformAffected.Android, issueTestNumber: 1)]
public class Bugzilla53179_1 : TestNavigationPage
{
ContentPage _intermediate1;
ContentPage _intermediate2;

Просмотреть файл

@ -15,8 +15,9 @@ namespace Xamarin.Forms.Controls.Issues
#endif
[Preserve(AllMembers = true)]
[Issue(IssueTracker.None, 1134, "Removing page during OnAppearing throws exception", PlatformAffected.Android)]
public class RemovePageOnAppearing : TestContentPage
[Issue(IssueTracker.Bugzilla, 53179, "Removing page during OnAppearing throws exception", PlatformAffected.Android,
issueTestNumber: 2)]
public class Bugzilla53179_2 : TestContentPage
{
const string Success = "Success";

Просмотреть файл

@ -111,7 +111,7 @@ namespace Xamarin.Forms.Controls
typeIssueAttribute.IssueNumber != 1461 &&
typeIssueAttribute.IssueNumber != 342)
{
cellName = typeIssueAttribute.IssueTracker.ToString().Substring(0, 1) + typeIssueAttribute.IssueNumber.ToString();
cellName = typeIssueAttribute.DisplayName;
}
else {
cellName = typeIssueAttribute.Description;

Просмотреть файл

@ -276,7 +276,7 @@
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla39829.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla39458.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla39853.cs" />
<Compile Include="$(MSBuildThisFileDirectory)RemovePageOnAppearing.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla53179_2.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ScrollViewIsEnabled.cs" />
<Compile Include="$(MSBuildThisFileDirectory)PlatformSpecifics_iOSTranslucentNavBarX.xaml.cs">
<DependentUpon>PlatformSpecifics_iOSTranslucentNavBarX.xaml</DependentUpon>
@ -284,6 +284,7 @@
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)PopAfterRemove.cs" />
<Compile Include="$(MSBuildThisFileDirectory)RestartAppTest.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla53179_1.cs" />
<Compile Include="$(MSBuildThisFileDirectory)TestPages\ScreenshotConditionalApp.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla41842.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Bugzilla42277.cs" />
@ -753,4 +754,4 @@
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource>
</ItemGroup>
</Project>
</Project>

Просмотреть файл

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
@ -93,6 +94,8 @@ namespace Xamarin.Forms.Controls
return page;
}
public TestCaseScreen ()
{
AutomationId = "TestCasesIssueList";
@ -102,28 +105,31 @@ namespace Xamarin.Forms.Controls
var assembly = typeof (TestCases).GetTypeInfo ().Assembly;
var issueModels =
from typeInfo in assembly.DefinedTypes.Select (o => o.AsType ().GetTypeInfo ())
(from typeInfo in assembly.DefinedTypes.Select (o => o.AsType ().GetTypeInfo ())
where typeInfo.GetCustomAttribute<IssueAttribute> () != null
let attribute = (IssueAttribute)typeInfo.GetCustomAttribute<IssueAttribute> ()
let attribute = typeInfo.GetCustomAttribute<IssueAttribute> ()
select new {
IssueTracker = attribute.IssueTracker,
IssueNumber = attribute.IssueNumber,
Name = attribute.IssueTracker.ToString ().Substring(0, 1) + attribute.IssueNumber.ToString (),
IssueTestNumber = attribute.IssueTestNumber,
Name = attribute.DisplayName,
Description = attribute.Description,
Action = ActivatePageAndNavigate (attribute, typeInfo.AsType ())
};
}).ToList();
var root = new TableRoot ();
var section = new TableSection ("Bug Repro");
root.Add (section);
var duplicates = new HashSet<string> ();
issueModels.ForEach (im => {
issueModels.ForEach (im =>
{
if (duplicates.Contains (im.Name) && !IsExempt (im.Name)) {
throw new NotSupportedException ("Please provide unique tracker + issue number combo: " + im.IssueTracker.ToString () + im.IssueNumber.ToString ());
} else {
duplicates.Add (im.Name);
throw new NotSupportedException ("Please provide unique tracker + issue number combo: "
+ im.IssueTracker.ToString () + im.IssueNumber.ToString () + im.IssueTestNumber.ToString());
}
duplicates.Add (im.Name);
});
var githubIssueCells =

Просмотреть файл

@ -48,33 +48,44 @@ namespace Xamarin.Forms.CustomAttributes
{
bool _modal;
public IssueAttribute (IssueTracker issueTracker, int issueNumber, string description, NavigationBehavior navigationBehavior = NavigationBehavior.Default)
public IssueAttribute (IssueTracker issueTracker, int issueNumber, string description,
NavigationBehavior navigationBehavior = NavigationBehavior.Default, int issueTestNumber = 0)
{
IssueTracker = issueTracker;
IssueNumber = issueNumber;
Description = description;
PlatformsAffected = PlatformAffected.Default;
NavigationBehavior = navigationBehavior;
IssueTestNumber = issueTestNumber;
}
public IssueAttribute (IssueTracker issueTracker, int issueNumber, string description, PlatformAffected platformsAffected, NavigationBehavior navigationBehavior = NavigationBehavior.Default)
public IssueAttribute (IssueTracker issueTracker, int issueNumber, string description,
PlatformAffected platformsAffected, NavigationBehavior navigationBehavior = NavigationBehavior.Default,
int issueTestNumber = 0)
{
IssueTracker = issueTracker;
IssueNumber = issueNumber;
Description = description;
PlatformsAffected = platformsAffected;
NavigationBehavior = navigationBehavior;
IssueTestNumber = issueTestNumber;
}
public IssueTracker IssueTracker { get; }
public int IssueNumber { get; }
public int IssueTestNumber { get; }
public string Description { get; }
public PlatformAffected PlatformsAffected { get; }
public NavigationBehavior NavigationBehavior { get; }
public string DisplayName => IssueTestNumber == 0
? $"{IssueTracker.ToString().Substring(0, 1)}{IssueNumber}"
: $"{IssueTracker.ToString().Substring(0, 1)}{IssueNumber} ({IssueTestNumber})";
}
[Conditional ("DEBUG")]