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 namespace Xamarin.Forms.Controls.Issues
{ {
[Preserve(AllMembers = true)] [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 public class Bugzilla53179 : TestNavigationPage
{ {
class TestPage : ContentPage class TestPage : ContentPage

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

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

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

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

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

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

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

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

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

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

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

@ -48,33 +48,44 @@ namespace Xamarin.Forms.CustomAttributes
{ {
bool _modal; 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; IssueTracker = issueTracker;
IssueNumber = issueNumber; IssueNumber = issueNumber;
Description = description; Description = description;
PlatformsAffected = PlatformAffected.Default; PlatformsAffected = PlatformAffected.Default;
NavigationBehavior = navigationBehavior; 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; IssueTracker = issueTracker;
IssueNumber = issueNumber; IssueNumber = issueNumber;
Description = description; Description = description;
PlatformsAffected = platformsAffected; PlatformsAffected = platformsAffected;
NavigationBehavior = navigationBehavior; NavigationBehavior = navigationBehavior;
IssueTestNumber = issueTestNumber;
} }
public IssueTracker IssueTracker { get; } public IssueTracker IssueTracker { get; }
public int IssueNumber { get; } public int IssueNumber { get; }
public int IssueTestNumber { get; }
public string Description { get; } public string Description { get; }
public PlatformAffected PlatformsAffected { get; } public PlatformAffected PlatformsAffected { get; }
public NavigationBehavior NavigationBehavior { 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")] [Conditional ("DEBUG")]