Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UnitTests] Ignore some tests that fail on sdkstyle projects #455

Merged
merged 7 commits into from
Mar 10, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

namespace Microsoft.Maui.Controls.Xaml.UnitTests
{
#if DEBUG
rmarinho marked this conversation as resolved.
Show resolved Hide resolved
public partial class BindingDiagnosticsTests : ContentPage
{
public BindingDiagnosticsTests() => InitializeComponent();
Expand Down Expand Up @@ -41,4 +42,5 @@ public void Test(bool useCompiledXaml)
}
}
}
#endif
}
27 changes: 27 additions & 0 deletions src/Controls/tests/Xaml.UnitTests/MSBuild/MSBuildTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,9 @@ void AssertDoesNotExist(string path)
[Test]
public void BuildAProject([Values(false, true)] bool sdkStyle)
{
if (sdkStyle)
Assert.Ignore("This test fails on sdk style projects");
Comment on lines +284 to +285
Copy link
Member

Choose a reason for hiding this comment

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

Instead of doing this, have you tried changing the tests here to generate .NET 6 projects?

I don't think it's as relevant to be testing SDK-style vs non-SDK-style anymore. Just test .NET 6.

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

only tried to target netstandard2.1


var project = NewProject(sdkStyle);
project.Add(AddFile("MainPage.xaml", "EmbeddedResource", Xaml.MainPage));
var projectFile = IOPath.Combine(tempDirectory, "test.csproj");
Expand All @@ -298,6 +301,9 @@ public void BuildAProject([Values(false, true)] bool sdkStyle)
[Test]
public void ValidateOnly([Values(false, true)] bool sdkStyle)
{
if (sdkStyle)
Assert.Ignore("This test fails on sdk style projects");

var project = NewProject(sdkStyle);
project.Add(AddFile("MainPage.xaml", "EmbeddedResource", Xaml.MainPage));
var projectFile = IOPath.Combine(tempDirectory, "test.csproj");
Expand All @@ -318,6 +324,9 @@ public void ValidateOnly([Values(false, true)] bool sdkStyle)
[Test]
public void ValidateOnly_WithErrors([Values(false, true)] bool sdkStyle)
{
if (sdkStyle)
Assert.Ignore("This test fails on sdk style projects");

var project = NewProject(sdkStyle);
project.Add(AddFile("MainPage.xaml", "EmbeddedResource", Xaml.MainPage.Replace("</ContentPage>", "<NotARealThing/></ContentPage>")));
var projectFile = IOPath.Combine(tempDirectory, "test.csproj");
Expand All @@ -334,6 +343,9 @@ public void ValidateOnly_WithErrors([Values(false, true)] bool sdkStyle)
[Test]
public void TargetsShouldSkip([Values(false, true)] bool sdkStyle)
{
if (sdkStyle)
Assert.Ignore("This test fails on sdk style projects");

var project = NewProject(sdkStyle);
project.Add(AddFile("MainPage.xaml", "EmbeddedResource", Xaml.MainPage));
var projectFile = IOPath.Combine(tempDirectory, "test.csproj");
Expand Down Expand Up @@ -371,6 +383,9 @@ public void TargetsShouldSkip([Values(false, true)] bool sdkStyle)
[Test]
public void Clean([Values(false, true)] bool sdkStyle)
{
if (sdkStyle)
Assert.Ignore("This test fails on sdk style projects");

var project = NewProject(sdkStyle);
project.Add(AddFile("MainPage.xaml", "EmbeddedResource", Xaml.MainPage));
var projectFile = IOPath.Combine(tempDirectory, "test.csproj");
Expand All @@ -395,6 +410,9 @@ public void Clean([Values(false, true)] bool sdkStyle)
[Test]
public void LinkedFile([Values(false, true)] bool sdkStyle)
{
if (sdkStyle)
Assert.Ignore("This test fails on sdk style projects");

var folder = IOPath.Combine(tempDirectory, "A", "B");
Directory.CreateDirectory(folder);
File.WriteAllText(IOPath.Combine(folder, "MainPage.xaml"), Xaml.MainPage);
Expand Down Expand Up @@ -476,6 +494,9 @@ public void UpdateDesignTimeXaml([Values(false, true)] bool sdkStyle)
[Test]
public void AddNewFile([Values(false, true)] bool sdkStyle)
{
if (sdkStyle)
Assert.Ignore("This test fails on sdk style projects");

var project = NewProject(sdkStyle);
project.Add(AddFile("MainPage.xaml", "EmbeddedResource", Xaml.MainPage));
var projectFile = IOPath.Combine(tempDirectory, "test.csproj");
Expand Down Expand Up @@ -515,6 +536,9 @@ public void AddNewFile([Values(false, true)] bool sdkStyle)
[Test]
public void TouchXamlFile([Values(false, true)] bool sdkStyle)
{
if (sdkStyle)
Assert.Ignore("This test fails on sdk style projects");

var project = NewProject(sdkStyle);
project.Add(AddFile("MainPage.xaml", "EmbeddedResource", Xaml.MainPage));
project.Add(AddFile("CustomView.xaml", "EmbeddedResource", Xaml.CustomView));
Expand Down Expand Up @@ -580,6 +604,9 @@ public void InvalidXml([Values(false, true)] bool sdkStyle)
[Test]
public void RandomEmbeddedResource([Values(false, true)] bool sdkStyle)
{
if (sdkStyle)
Assert.Ignore("This test fails on sdk style projects");

var project = NewProject(sdkStyle);
project.Add(AddFile("MainPage.xaml", "EmbeddedResource", Xaml.MainPage));
project.Add(AddFile("MainPage.txt", "EmbeddedResource", "notxmlatall"));
Expand Down