Skip to content

Commit a913c40

Browse files
[xcode14.2] [tests] Adjust ImageCaptioningTest to skip network-related failures in CI. (#17694)
Fixes: MonoTouchFixtures.MediaAccessibility.ImageCaptioningTest [FAIL] GetCaption : Ignore this failure when network is down at MonoTouchFixtures.MediaAccessibility.ImageCaptioningTest.GetCaption() in /Users/builder/azdo/_work/3/s/xamarin-macios/tests/monotouch-test/MediaAccessibility/ImageCaptioningTest.cs:line 36 Ref: xamarin/maccore#2088. Backport of #16814 Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
1 parent 78d8ca3 commit a913c40

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

tests/monotouch-test/MediaAccessibility/ImageCaptioningTest.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,9 @@ public void GetCaption ()
3333
var s = MAImageCaptioning.GetCaption (url, out var e);
3434
Assert.Null (s, "remote / return value");
3535
if (e != null && e.Description.Contains ("Invalid url:")) {
36-
Assert.Fail ("Ignore this failure when network is down"); // could not connect to the network, fail and add a nice reason
37-
} else {
38-
Assert.Null (e, "remote / no error"); // weird should be an "image on disk"
39-
36+
TestRuntime.IgnoreInCI ($"Ignore this failure when network is down: {e}"); // could not connect to the network, fail and add a nice reason
4037
}
38+
Assert.Null (e, "remote / no error"); // weird should be an "image on disk"
4139
}
4240
string file = Path.Combine (NSBundle.MainBundle.ResourcePath, "basn3p08.png");
4341
file = file.Replace (" ", "%20");

0 commit comments

Comments
 (0)