Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pinned locals parsing + bump dotnet version for protobuf and eShopOnWeb exploration tests #6475

Merged
merged 17 commits into from
Jan 14, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 27 additions & 2 deletions tracer/build/_build/Build.ExplorationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Reflection;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using JetBrains.Annotations;
using Nuke.Common;
using Nuke.Common.IO;
using Nuke.Common.Tools.DotNet;
Expand Down Expand Up @@ -335,7 +336,12 @@
var metadataReaders = new List<Tuple<object, MethodInfo, string>>();
foreach (var testAssemblyPath in testAssembliesPaths)
{
var currentAssembly = Assembly.LoadFile(testAssemblyPath);
var currentAssembly = LoadAssemblySafe(testAssemblyPath);
if (currentAssembly == null)
{
continue;
}

var symbolExtractor = createMethod?.Invoke(null, new object[] { currentAssembly });
if (symbolExtractor == null)
{
Expand Down Expand Up @@ -442,6 +448,25 @@
}
}

[CanBeNull]
static Assembly LoadAssemblySafe(string testAssemblyPath)
{
try
{
return Assembly.LoadFile(testAssemblyPath);
}
catch (BadImageFormatException e)

Check warning on line 458 in tracer/build/_build/Build.ExplorationTests.cs

View workflow job for this annotation

GitHub Actions / check-snapshots

The variable 'e' is declared but never used

Check warning on line 458 in tracer/build/_build/Build.ExplorationTests.cs

View workflow job for this annotation

GitHub Actions / add-labels

The variable 'e' is declared but never used

Check warning on line 458 in tracer/build/_build/Build.ExplorationTests.cs

View workflow job for this annotation

GitHub Actions / verify_span_metadata

The variable 'e' is declared but never used

Check warning on line 458 in tracer/build/_build/Build.ExplorationTests.cs

View workflow job for this annotation

GitHub Actions / verify_files_without_nullability

The variable 'e' is declared but never used

Check warning on line 458 in tracer/build/_build/Build.ExplorationTests.cs

View workflow job for this annotation

GitHub Actions / verify_source_generators

The variable 'e' is declared but never used

Check warning on line 458 in tracer/build/_build/Build.ExplorationTests.cs

View workflow job for this annotation

GitHub Actions / Analyze Profiler

The variable 'e' is declared but never used

Check warning on line 458 in tracer/build/_build/Build.ExplorationTests.cs

View workflow job for this annotation

GitHub Actions / bump_package_versions

The variable 'e' is declared but never used

Check warning on line 458 in tracer/build/_build/Build.ExplorationTests.cs

View workflow job for this annotation

GitHub Actions / verify_app_trimming_descriptor_generator

The variable 'e' is declared but never used

Check warning on line 458 in tracer/build/_build/Build.ExplorationTests.cs

View workflow job for this annotation

GitHub Actions / Analyze Tracer

The variable 'e' is declared but never used
Copy link
Member

Choose a reason for hiding this comment

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

Not a blocker, but this is now causing compiler warnings on master 😅

The variable 'e' is declared but never used

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah I saw that... hang in there I'll push a little PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

no rush, thanks!

{
// ignore
}
catch (Exception e)

Check warning on line 462 in tracer/build/_build/Build.ExplorationTests.cs

View workflow job for this annotation

GitHub Actions / check-snapshots

The variable 'e' is declared but never used

Check warning on line 462 in tracer/build/_build/Build.ExplorationTests.cs

View workflow job for this annotation

GitHub Actions / add-labels

The variable 'e' is declared but never used

Check warning on line 462 in tracer/build/_build/Build.ExplorationTests.cs

View workflow job for this annotation

GitHub Actions / verify_span_metadata

The variable 'e' is declared but never used

Check warning on line 462 in tracer/build/_build/Build.ExplorationTests.cs

View workflow job for this annotation

GitHub Actions / verify_files_without_nullability

The variable 'e' is declared but never used

Check warning on line 462 in tracer/build/_build/Build.ExplorationTests.cs

View workflow job for this annotation

GitHub Actions / verify_source_generators

The variable 'e' is declared but never used

Check warning on line 462 in tracer/build/_build/Build.ExplorationTests.cs

View workflow job for this annotation

GitHub Actions / Analyze Profiler

The variable 'e' is declared but never used

Check warning on line 462 in tracer/build/_build/Build.ExplorationTests.cs

View workflow job for this annotation

GitHub Actions / bump_package_versions

The variable 'e' is declared but never used

Check warning on line 462 in tracer/build/_build/Build.ExplorationTests.cs

View workflow job for this annotation

GitHub Actions / verify_app_trimming_descriptor_generator

The variable 'e' is declared but never used

Check warning on line 462 in tracer/build/_build/Build.ExplorationTests.cs

View workflow job for this annotation

GitHub Actions / Analyze Tracer

The variable 'e' is declared but never used
{
Logger.Warning($"Fail to load assembly: {testAssemblyPath}");
}

return null;
}

string GetTracerAssemblyPath(TargetFramework framework)
{
TargetFramework tracerFramework = null;
Expand Down Expand Up @@ -483,7 +508,7 @@

bool Exclude(string path)
{
return path.Contains($"{Path.DirectorySeparatorChar}obj{Path.DirectorySeparatorChar}");
return path.Contains($"{Path.DirectorySeparatorChar}obj{Path.DirectorySeparatorChar}") || Path.GetFileNameWithoutExtension(path).Equals("testhost");
}

bool IsSupportedExtension(string path)
Expand Down
Loading