Skip to content

Commit

Permalink
[Tests] Make test inconclusive if httpbin does not return the headers. (
Browse files Browse the repository at this point in the history
#5684)

In some cases, httpbin might return errors or other results. In that
case, we cannot assert that the auth headers are not present. We set the
test to inconclusive to ensure that we do not fail due to the external
page.

Fixes xamarin/maccore#1453
  • Loading branch information
mandel-macaque authored Feb 28, 2019
1 parent 297aebe commit a5232f8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/monotouch-test/System.Net.Http/MessageHandlers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,9 @@ public void RedirectionWithAuthorizationHeaders (Type handlerType)

if (!done) { // timeouts happen in the bost due to dns issues, connection issues etc.. we do not want to fail
Assert.Inconclusive ("Request timedout.");
} else if (!containsHeaders) {
Assert.Inconclusive ("Response from httpbin does not contain headers, therefore we cannot ensure that if the authoriation is present.");
} else {
Assert.IsTrue (containsHeaders, "Request did not reach final destination.");
Assert.IsFalse (containsAuthorizarion, $"Authorization header did reach the final destination. {json}");
Assert.IsNull (ex, $"Exception {ex} for {json}");
}
Expand Down

2 comments on commit a5232f8

@xamarin-release-manager
Copy link
Collaborator

Choose a reason for hiding this comment

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

Build was (probably) aborted

🔥 Jenkins job (on internal Jenkins) failed in stage(s) 'Test run, Test run' 🔥

Build succeeded
✅ Packages: xamarin.ios-12.7.0.192.pkg xamarin.mac-5.7.0.192.pkg
API Diff (from stable)
🔥 Failed to compare API and create generator diff 🔥
    Failed to update apidiff references
    Search for Comparing API & creating generator diff in the log to view the complete log.
Test run succeeded

@dalexsoto
Copy link
Member

@dalexsoto dalexsoto commented on a5232f8 Mar 1, 2019

Choose a reason for hiding this comment

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

Setting state to success where context is continuous-integration/jenkins/branch.

No blocking issues found

Please sign in to comment.