Skip to content

[tests] Improve new BasicAuthWorksWhenBearerIsAdvertisedFirst test. - #25503

Merged
rolfbjarne merged 4 commits into
mainfrom
dev/rolf/test-improvement
May 27, 2026
Merged

rolfbjarne merged 4 commits into
mainfrom
dev/rolf/test-improvement

Conversation

@rolfbjarne

Copy link
Copy Markdown
Member
  • Remove unused 'using System.Net.Http.Headers' directive.

  • Track request counts server-side and assert that at least one
    unauthenticated request was received before the authenticated retry,
    ensuring the test validates the actual challenge/fallback flow.

- Remove unused 'using System.Net.Http.Headers' directive.

- Track request counts server-side and assert that at least one
  unauthenticated request was received before the authenticated retry,
  ensuring the test validates the actual challenge/fallback flow.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR refines the NSUrlSessionHandler authentication regression test to better validate the Basic-auth fallback behavior when the server advertises Bearer before Basic, and removes an unused import.

Changes:

  • Removed an unused using System.Net.Http.Headers; directive.
  • Added server-side request counters and assertions intended to verify that the client performs an unauthenticated request before retrying with Basic authentication.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

rolfbjarne and others added 2 commits May 25, 2026 09:43
Instead of just counting unauthenticated and authenticated requests,
track the index of each to assert that the unauthenticated (401) request
arrived before the authenticated retry, proving the correct ordering.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@rolfbjarne
rolfbjarne marked this pull request as ready for review May 25, 2026 16:33
@rolfbjarne
rolfbjarne enabled auto-merge (squash) May 25, 2026 16:33
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

βœ… [PR Build #f16a2fb] Build passed (Detect API changes) βœ…

Pipeline on Agent
Hash: f16a2fb04d2b6647fffb829336986b4d07e50a17 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

βœ… [PR Build #f16a2fb] Build passed (Build packages) βœ…

Pipeline on Agent
Hash: f16a2fb04d2b6647fffb829336986b4d07e50a17 [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

βœ… API diff for current PR / commit

NET (empty diffs)

βœ… API diff vs stable

NET (empty diffs)

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: f16a2fb04d2b6647fffb829336986b4d07e50a17 [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

βœ… [PR Build #f16a2fb] Build passed (Build macOS tests) βœ…

Pipeline on Agent
Hash: f16a2fb04d2b6647fffb829336986b4d07e50a17 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

πŸš€ [CI Build #f16a2fb] Test results πŸš€

Test results

βœ… All tests passed on VSTS: test results.

πŸŽ‰ All 183 tests passed πŸŽ‰

Tests counts

βœ… cecil: All 1 tests passed. Html Report (VSDrops) Download
βœ… dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
βœ… dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
βœ… dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
βœ… dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
βœ… dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
βœ… framework: All 2 tests passed. Html Report (VSDrops) Download
βœ… fsharp: All 4 tests passed. Html Report (VSDrops) Download
βœ… generator: All 5 tests passed. Html Report (VSDrops) Download
βœ… interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
βœ… introspection: All 6 tests passed. Html Report (VSDrops) Download
βœ… linker (iOS): All 11 tests passed. Html Report (VSDrops) Download
βœ… linker (MacCatalyst): All 11 tests passed. Html Report (VSDrops) Download
βœ… linker (macOS): All 11 tests passed. Html Report (VSDrops) Download
βœ… linker (tvOS): All 11 tests passed. Html Report (VSDrops) Download
βœ… monotouch (iOS): All 18 tests passed. Html Report (VSDrops) Download
βœ… monotouch (MacCatalyst): All 20 tests passed. [attempt 2] Html Report (VSDrops) Download
βœ… monotouch (macOS): All 20 tests passed. Html Report (VSDrops) Download
βœ… monotouch (tvOS): All 18 tests passed. Html Report (VSDrops) Download
βœ… msbuild: All 2 tests passed. Html Report (VSDrops) Download
βœ… sharpie: All 1 tests passed. Html Report (VSDrops) Download
βœ… windows: All 3 tests passed. Html Report (VSDrops) Download
βœ… xcframework: All 4 tests passed. Html Report (VSDrops) Download
βœ… xtro: All 1 tests passed. Html Report (VSDrops) Download

macOS tests

βœ… Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download
βœ… Tests on macOS Ventura (13): All 5 tests passed. Html Report (VSDrops) Download
βœ… Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download
βœ… Tests on macOS Sequoia (15): All 5 tests passed. Html Report (VSDrops) Download
βœ… Tests on macOS Tahoe (26): All 5 tests passed. Html Report (VSDrops) Download

Linux Build Verification

βœ… Linux build succeeded

Pipeline on Agent
Hash: f16a2fb04d2b6647fffb829336986b4d07e50a17 [PR build]

@rolfbjarne
rolfbjarne merged commit b8e66aa into main May 27, 2026
55 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants