Skip to content

Commit

Permalink
SWEEP: conditionally ignore tests that are failing due to the Xamarin…
Browse files Browse the repository at this point in the history
….Android platform issues dotnet/android#5423 and dotnet/android#5425
  • Loading branch information
NightOwl888 committed Oct 15, 2023
1 parent 8863567 commit 9971739
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 13 deletions.
8 changes: 4 additions & 4 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ stages:
testTargetFrameworks: 'MonoAndroid90'
androidAbi: 'x86_64'
testResultsArtifactName: '$(TestResultsArtifactName)'
maximumAllowedFailures: 9 # Maximum allowed failures for a successful build
maximumAllowedFailures: 0 # Maximum allowed failures for a successful build
dotNetSdkVersion: '$(DotNetSDKVersion)'

- job: Test_MonoAndroid90_x86 # Only run if explicitly enabled with RunX86Tests
Expand All @@ -335,7 +335,7 @@ stages:
testTargetFrameworks: 'MonoAndroid90'
androidAbi: 'x86'
testResultsArtifactName: '$(TestResultsArtifactName)'
maximumAllowedFailures: 9 # Maximum allowed failures for a successful build
maximumAllowedFailures: 0 # Maximum allowed failures for a successful build
dotNetSdkVersion: '$(DotNetSDKVersion)'

- job: Test_MonoAndroid100_x86_64
Expand All @@ -350,7 +350,7 @@ stages:
testTargetFrameworks: 'MonoAndroid100'
androidAbi: 'x86_64'
testResultsArtifactName: '$(TestResultsArtifactName)'
maximumAllowedFailures: 9 # Maximum allowed failures for a successful build
maximumAllowedFailures: 0 # Maximum allowed failures for a successful build
dotNetSdkVersion: '$(DotNetSDKVersion)'

- job: Test_MonoAndroid100_x86 # Only run if explicitly enabled with RunX86Tests
Expand All @@ -365,7 +365,7 @@ stages:
testTargetFrameworks: 'MonoAndroid100'
androidAbi: 'x86'
testResultsArtifactName: '$(TestResultsArtifactName)'
maximumAllowedFailures: 9 # Maximum allowed failures for a successful build
maximumAllowedFailures: 0 # Maximum allowed failures for a successful build
dotNetSdkVersion: '$(DotNetSDKVersion)'


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ public void TestasIntBuffer()
}

[Test]
public void TestReadOnly() //"Awaits fix: https://github.com/xamarin/xamarin-android/issues/5423"
public void TestReadOnly()
{
Assume.That(!PlatformDetection.IsXamarinAndroid, "J2N TODO: Awaits fix: https://github.com/xamarin/xamarin-android/issues/5423");

using (var fis = new FileStream(tmpFile.FullName, FileMode.Open, FileAccess.Read))
using (var fc = MemoryMappedFile.CreateFromFile(fis, null, 0, MemoryMappedFileAccess.Read,
#if FEATURE_MEMORYMAPPEDFILESECURITY
Expand Down Expand Up @@ -120,8 +122,10 @@ public void TestReadOnly() //"Awaits fix: https://github.com/xamarin/xamarin-and
* @throws IOException
*/
[Test]
public void TestEmptyBuffer() //"Awaits fix: https://github.com/xamarin/xamarin-android/issues/5423"
public void TestEmptyBuffer()
{
Assume.That(!PlatformDetection.IsXamarinAndroid, "J2N TODO: Awaits fix: https://github.com/xamarin/xamarin-android/issues/5423");

// Map empty file
// FileInputStream fis = new FileInputStream(emptyFile);
//FileChannel fc = fis.getChannel();
Expand Down Expand Up @@ -321,8 +325,10 @@ public override void TearDown()


[Test]
public void Test_Position() //"Awaits fix: https://github.com/xamarin/xamarin-android/issues/5423"
public void Test_Position()
{
Assume.That(!PlatformDetection.IsXamarinAndroid, "J2N TODO: Awaits fix: https://github.com/xamarin/xamarin-android/issues/5423");

var tmp = new FileInfo(Path.GetTempFileName());

//File tmp = File.createTempFile("hmy", "tmp");
Expand Down Expand Up @@ -437,8 +443,10 @@ public void TestBasic()
}

[Test]
public void TestFlush() // Force.java //"Awaits fix: https://github.com/xamarin/xamarin-android/issues/5423"
public void TestFlush() // Force.java
{
Assume.That(!PlatformDetection.IsXamarinAndroid, "J2N TODO: Awaits fix: https://github.com/xamarin/xamarin-android/issues/5423");

long fileSize = Random.Next(3 * 1024 * 1024);
int cut = Random.Next((int)fileSize);
var file = new FileInfo(Path.GetTempFileName());
Expand Down Expand Up @@ -470,8 +478,10 @@ public void TestFlush() // Force.java //"Awaits fix: https://github.com/xamarin/
//}

[Test]
public void TestZeroMap() //"Awaits fix: https://github.com/xamarin/xamarin-android/issues/5423"
public void TestZeroMap()
{
Assume.That(!PlatformDetection.IsXamarinAndroid, "J2N TODO: Awaits fix: https://github.com/xamarin/xamarin-android/issues/5423");

long fileSize = Random.Next(1024 * 1024);
int cut = Random.Next((int)fileSize);
var file = new FileInfo(Path.GetTempFileName());
Expand Down
16 changes: 12 additions & 4 deletions tests/J2N.Tests/Text/TestStringExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -454,8 +454,10 @@ public void Test_LastIndexOf_Int32_Int32()
* @tests java.lang.String#regionMatches(int, java.lang.String, int, int)
*/
[Test]
public void Test_RegionMatches_String_Int32_ICharSequence_Int32_Int32_StringComparison() // Awaits Fix: https://github.com/xamarin/xamarin-android/issues/5425
public void Test_RegionMatches_String_Int32_ICharSequence_Int32_Int32_StringComparison()
{
Assume.That(!PlatformDetection.IsXamarinAndroid, "J2N TODO: Awaits fix: https://github.com/xamarin/xamarin-android/issues/5425");

// Test for method boolean java.lang.String.regionMatches(int,
// java.lang.String, int, int)
String bogusString = "xxcedkedkleiorem lvvwr e''' 3r3r 23r";
Expand Down Expand Up @@ -513,8 +515,10 @@ public void Test_RegionMatches_String_Int32_ICharSequence_Int32_Int32_StringComp
* @tests java.lang.String#regionMatches(int, java.lang.String, int, int)
*/
[Test]
public void Test_RegionMatches_String_Int32_CharArray_Int32_Int32_StringComparison() // Awaits Fix: https://github.com/xamarin/xamarin-android/issues/5425
public void Test_RegionMatches_String_Int32_CharArray_Int32_Int32_StringComparison()
{
Assume.That(!PlatformDetection.IsXamarinAndroid, "J2N TODO: Awaits fix: https://github.com/xamarin/xamarin-android/issues/5425");

// Test for method boolean java.lang.String.regionMatches(int,
// java.lang.String, int, int)
String bogusString = "xxcedkedkleiorem lvvwr e''' 3r3r 23r";
Expand Down Expand Up @@ -572,8 +576,10 @@ public void Test_RegionMatches_String_Int32_CharArray_Int32_Int32_StringComparis
* @tests java.lang.String#regionMatches(int, java.lang.String, int, int)
*/
[Test]
public void Test_RegionMatches_String_Int32_StringBuilder_Int32_Int32_StringComparison() // Awaits Fix: https://github.com/xamarin/xamarin-android/issues/5425
public void Test_RegionMatches_String_Int32_StringBuilder_Int32_Int32_StringComparison()
{
Assume.That(!PlatformDetection.IsXamarinAndroid, "J2N TODO: Awaits fix: https://github.com/xamarin/xamarin-android/issues/5425");

// Test for method boolean java.lang.String.regionMatches(int,
// java.lang.String, int, int)
String bogusString = "xxcedkedkleiorem lvvwr e''' 3r3r 23r";
Expand Down Expand Up @@ -631,8 +637,10 @@ public void Test_RegionMatches_String_Int32_StringBuilder_Int32_Int32_StringComp
* @tests java.lang.String#regionMatches(int, java.lang.String, int, int)
*/
[Test]
public void Test_RegionMatches_String_Int32_String_Int32_Int32_StringComparison() // Awaits Fix: https://github.com/xamarin/xamarin-android/issues/5425
public void Test_RegionMatches_String_Int32_String_Int32_Int32_StringComparison()
{
Assume.That(!PlatformDetection.IsXamarinAndroid, "J2N TODO: Awaits fix: https://github.com/xamarin/xamarin-android/issues/5425");

// Test for method boolean java.lang.String.regionMatches(int,
// java.lang.String, int, int)
String bogusString = "xxcedkedkleiorem lvvwr e''' 3r3r 23r";
Expand Down

0 comments on commit 9971739

Please sign in to comment.