Skip to content

Commit

Permalink
Temporarily disable import devices/configs test (Azure#2263)
Browse files Browse the repository at this point in the history
  • Loading branch information
David R. Williamson authored Jan 6, 2022
1 parent de22d9b commit a88fa5c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 32 deletions.
46 changes: 14 additions & 32 deletions e2e/test/iothub/service/RegistryManagerE2ETests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -392,44 +392,26 @@ public async Task RegistryManager_ConfigurationOperations_Work()
public async Task RegistryManager_Query_Works()
{
// arrange

using var registryManager = RegistryManager.CreateFromConnectionString(TestConfiguration.IoTHub.ConnectionString);
string deviceId = $"{_idPrefix}{Guid.NewGuid()}";
string deviceId = TestConfiguration.IoTHub.X509ChainDeviceName;

try
{
Device device = await registryManager
.AddDeviceAsync(new Device(deviceId))
.ConfigureAwait(false);
Device device = await registryManager
.GetDeviceAsync(deviceId)
.ConfigureAwait(false);
device.Should().NotBeNull($"Device {deviceId} should already exist in hub setup for E2E tests");

// act

IQuery query = null;
IEnumerable<Twin> twins = null;
for (int i = 0; i < 30; ++i)
{
string queryText = $"select * from devices where deviceId = '{deviceId}'";
query = registryManager.CreateQuery(queryText);
// act

twins = await query.GetNextAsTwinAsync().ConfigureAwait(false);
string queryText = $"select * from devices where deviceId = '{deviceId}'";
IQuery query = registryManager.CreateQuery(queryText);
IEnumerable<Twin> twins = await query.GetNextAsTwinAsync().ConfigureAwait(false);

if (twins.Any())
{
break;
}
// assert

// A new device may not return immediately from a query, so give it some time and some retries to appear
await Task.Delay(250).ConfigureAwait(false);
}

// assert
twins.Count().Should().Be(1, "only asked for 1 device by its Id");
twins.First().DeviceId.Should().Be(deviceId, "The Id of the device returned should match");
query.HasMoreResults.Should().BeFalse("We've processed the single, expected result");
}
finally
{
await registryManager.RemoveDeviceAsync(deviceId).ConfigureAwait(false);
}
twins.Count().Should().Be(1, "only asked for 1 device by its Id");
twins.First().DeviceId.Should().Be(deviceId, "The Id of the device returned should match");
query.HasMoreResults.Should().BeFalse("We've processed the single, expected result");
}

[LoggedTestMethod]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public class RegistryManagerImportDevicesTests : E2EMsTestBase
[DataRow(StorageAuthenticationType.KeyBased, false)]
[DataRow(StorageAuthenticationType.IdentityBased, false)]
[DataRow(StorageAuthenticationType.IdentityBased, true)]
[Ignore("Waiting on IcM 279379774 to be resolved, estimated early Jan 2022")]
public async Task RegistryManager_ImportDevices(StorageAuthenticationType storageAuthenticationType, bool isUserAssignedMsi)
{
// arrange
Expand Down

0 comments on commit a88fa5c

Please sign in to comment.