Skip to content

Commit b111677

Browse files
authored
Remove some flaky tests that were just an overkill (#5486)
remove some tests
1 parent e284585 commit b111677

File tree

1 file changed

+0
-88
lines changed

1 file changed

+0
-88
lines changed

tests/Microsoft.Identity.Test.Integration.netcore/SeleniumTests/DeviceCodeFlowIntegrationTest.cs

Lines changed: 0 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -53,38 +53,6 @@ public async Task SilentTokenAfterDeviceCodeFlowWithBrokerTestAsync()
5353
await AcquireTokenSilentAfterDeviceCodeFlowWithBrokerAsync(labResponse, "aad user").ConfigureAwait(false);
5454
}
5555

56-
[TestMethod]
57-
[Timeout(2 * 60 * 1000)] // 2 min timeout
58-
[TestCategory(TestCategories.Arlington)]
59-
public async Task ArlingtonDeviceCodeFlowTestAsync()
60-
{
61-
LabResponse labResponse = await LabUserHelper.GetArlingtonUserAsync().ConfigureAwait(false);
62-
await AcquireTokenWithDeviceCodeFlowAsync(labResponse, "aad user").ConfigureAwait(false);
63-
}
64-
65-
[TestMethod]
66-
[Timeout(2 * 60 * 1000)] // 2 min timeout
67-
[TestCategory(TestCategories.Arlington)]
68-
#if IGNORE_FEDERATED
69-
[Ignore]
70-
#endif
71-
public async Task ArlingtonDeviceCodeFlowAdfsTestAsync()
72-
{
73-
LabResponse labResponse = await LabUserHelper.GetArlingtonADFSUserAsync().ConfigureAwait(false);
74-
await AcquireTokenWithDeviceCodeFlowAsync(labResponse, "adfs user").ConfigureAwait(false);
75-
}
76-
77-
[TestMethod]
78-
[Timeout(2 * 60 * 1000)] // 2 min timeout
79-
[TestCategory(TestCategories.MSA)]
80-
[Ignore("Currently failing due to environment")] //See https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/issues/5264
81-
public async Task DeviceCodeFlowMsaTestAsync()
82-
{
83-
LabResponse labResponse = await LabUserHelper.GetMsaUserAsync().ConfigureAwait(false);
84-
85-
await AcquireTokenWithDeviceCodeFlowAsync(labResponse, "msa user").ConfigureAwait(false);
86-
}
87-
8856
private async Task AcquireTokenWithDeviceCodeFlowAsync(LabResponse labResponse, string userType)
8957
{
9058
Trace.WriteLine($"Calling AcquireTokenWithDeviceCodeAsync with {0}", userType);
@@ -157,61 +125,5 @@ private async Task AcquireTokenSilentAfterDeviceCodeFlowWithBrokerAsync(LabRespo
157125
Assert.IsNotNull(silentTokenResult);
158126
Assert.IsTrue(!string.IsNullOrEmpty(silentTokenResult.AccessToken));
159127
}
160-
161-
#region Azure AD Kerberos Feature Tests
162-
[IgnoreOnOneBranch]
163-
[RunOn(TargetFrameworks.NetCore)]
164-
[Timeout(2 * 60 * 1000)] // 2 min timeout
165-
public async Task KerberosDeviceCodeFlowTestAsync()
166-
{
167-
LabResponse labResponse = await LabUserHelper.GetDefaultUserAsync().ConfigureAwait(false);
168-
await KerberosAcquireTokenWithDeviceCodeFlowAsync(labResponse, "aad user", KerberosTicketContainer.IdToken).ConfigureAwait(false);
169-
await KerberosAcquireTokenWithDeviceCodeFlowAsync(labResponse, "aad user", KerberosTicketContainer.AccessToken).ConfigureAwait(false);
170-
}
171-
172-
private async Task KerberosAcquireTokenWithDeviceCodeFlowAsync(LabResponse labResponse, string userType, KerberosTicketContainer ticketContainer)
173-
{
174-
Trace.WriteLine($"Calling KerberosAcquireTokenWithDeviceCodeFlowAsync with {0}", userType);
175-
var builder = PublicClientApplicationBuilder.Create(labResponse.App.AppId)
176-
.WithTestLogging()
177-
.WithTenantId(labResponse.Lab.TenantId)
178-
.WithClientId(TestConstants.KerberosTestApplicationId)
179-
.WithKerberosTicketClaim(TestConstants.KerberosServicePrincipalName, ticketContainer);
180-
181-
switch (labResponse.User.AzureEnvironment)
182-
{
183-
case AzureEnvironment.azureusgovernment:
184-
builder.WithAuthority(labResponse.Lab.Authority + labResponse.Lab.TenantId);
185-
break;
186-
default:
187-
break;
188-
}
189-
190-
var pca = builder.Build();
191-
var userCacheAccess = pca.UserTokenCache.RecordAccess();
192-
193-
var result = await pca.AcquireTokenWithDeviceCode(s_scopes, deviceCodeResult =>
194-
{
195-
SeleniumExtensions.PerformDeviceCodeLogin(deviceCodeResult, labResponse.User, TestContext, false);
196-
return Task.FromResult(0);
197-
}).ExecuteAsync(CancellationToken.None).ConfigureAwait(false);
198-
199-
Trace.WriteLine("Running asserts");
200-
201-
userCacheAccess.AssertAccessCounts(0, 1);
202-
Assert.IsFalse(userCacheAccess.LastAfterAccessNotificationArgs.IsApplicationCache);
203-
204-
Assert.IsNotNull(result);
205-
Assert.IsTrue(!string.IsNullOrEmpty(result.AccessToken));
206-
207-
KerberosSupplementalTicket ticket = TestCommon.GetValidatedKerberosTicketFromAuthenticationResult(
208-
result,
209-
ticketContainer,
210-
labResponse.User.Upn);
211-
Assert.IsNotNull(ticket);
212-
TestCommon.ValidateKerberosWindowsTicketCacheOperation(ticket);
213-
}
214-
215-
#endregion
216128
}
217129
}

0 commit comments

Comments
 (0)