Skip to content

Commit da31e44

Browse files
authored
[Smoke Tests] Fixing up failures from new packages (Azure#49686)
* [Smoke Tests] Updating local test package versions and adding an exception for an AI/web package that does not target netstandard2.0 and is not compatible with the full set of target frameworks for the tests. * Added handler for platform not supported COM exception * Adding an additional invocation case
1 parent 06e261c commit da31e44

File tree

3 files changed

+30
-8
lines changed

3 files changed

+30
-8
lines changed

common/SmokeTests/SmokeTest/Program.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,11 +191,22 @@ void ProcessType(Type type)
191191
// Expected; this is a known scenario where the type is not impactful to the
192192
// Azure SDK experience and cane be safely ignored.
193193
}
194+
catch (NotSupportedException ex) when (ShouldIgnoreNotSupportedException(ex))
195+
{
196+
// Expected; this is a known scenario where the type is not able to be created
197+
// via reflection using the Activator. These are not types related to the SDK
198+
// and are not impactful to the Azure SDK experience.
199+
}
194200
catch (COMException)
195201
{
196202
// Expected; this is a known scenario where the type is not impactful to the
197203
// Azure SDK experience and cane be safely ignored.
198204
}
205+
catch (PlatformNotSupportedException)
206+
{
207+
// Expected; this is a known scenario where the type is not impactful to the
208+
// Azure SDK experience and can be safely ignored.
209+
}
199210
}
200211
}
201212
catch (Exception ex)
@@ -281,6 +292,7 @@ IEnumerable<Assembly> LoadAssemblies(Assembly rootAssembly, string assemblyFileM
281292
TypeLoadException => true,
282293
TypeInitializationException => true,
283294
ThreadStateException => true,
295+
MissingMethodException => true,
284296

285297
// Occurs when the assembly is locked; this is most likely a framework assembly.
286298
IOException ioEx when (ioEx.Message.ToLower().Contains("being used by another process.")) => true,
@@ -298,6 +310,15 @@ _ when (ex.Message.ToLower().Contains("operation is not supported")) => true,
298310
_ => false
299311
};
300312

313+
bool ShouldIgnoreNotSupportedException(NotSupportedException ex) => ex switch
314+
{
315+
// Occurs when the type cannot be created via Activator.CreateInstance.
316+
_ when (ex.Message.ToLower().Contains("cannot dynamically create an instance of type")) => true,
317+
318+
// By default, do not ignore.
319+
_ => false
320+
};
321+
301322
bool ShouldLoadAssembly(Assembly assembly) => assembly.FullName switch
302323
{
303324
string name when name.StartsWith("System.") => false,

common/SmokeTests/SmokeTest/SmokeTest.csproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,21 @@
2424
The static set is included here to allow for local testing of the smoke tests project
2525
without the need to run CI scripts to rewrite package references.
2626
-->
27-
<PackageReference Include="Azure.Identity" Version="1.11.3" />
28-
<PackageReference Include="Azure.Messaging.EventHubs" Version="5.11.3" />
29-
<PackageReference Include="Azure.Messaging.EventHubs.Processor" Version="5.11.3" />
30-
<PackageReference Include="Azure.Security.Keyvault.Secrets" Version="4.6.0" />
31-
<PackageReference Include="Azure.Storage.Blobs" Version="12.20.0" />
32-
<PackageReference Include="Microsoft.Azure.Amqp" Version="2.6.7" />
33-
<PackageReference Include="Microsoft.Azure.Devices" Version="1.39.1" />
27+
<PackageReference Include="Azure.Identity" Version="1.13.2" />
28+
<PackageReference Include="Azure.Messaging.EventHubs" Version="5.12.1" />
29+
<PackageReference Include="Azure.Messaging.EventHubs.Processor" Version="5.12.1" />
30+
<PackageReference Include="Azure.Security.Keyvault.Secrets" Version="4.7.0" />
31+
<PackageReference Include="Azure.Storage.Blobs" Version="12.24.0" />
32+
<PackageReference Include="Microsoft.Azure.Amqp" Version="2.6.11" />
33+
<PackageReference Include="Microsoft.Azure.Devices" Version="1.40.0" />
3434
<PackageReference Include="Microsoft.Azure.DocumentDB.Core" Version="2.22.0" />
3535
<PackageReference Include="Azure.Template" Version="1.0.3-beta.1218030" />
3636

3737
<!-- This is needed to resolve a build conflict and force the correct version -->
3838
<PackageReference Include="System.Net.NameResolution" Version="4.3.0" />
3939
</ItemGroup>
4040

41-
<ItemGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'netcoreapp3.1'))">
41+
<ItemGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">
4242
<!-- This package supports netcoreapp3.1 -->
4343
<PackageReference Remove="Microsoft.Azure.WebPubSub.AspNetCore" />
4444
</ItemGroup>

common/SmokeTests/SmokeTest/Update-Dependencies.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ param(
1515
$packageExcludeSet = @(
1616
"Microsoft.Azure.WebPubSub.AspNetCore",
1717
"Microsoft.WCF.Azure.StorageQueues",
18+
"Azure.Projects.Web",
1819
"OpenAI"
1920
)
2021

0 commit comments

Comments
 (0)