Skip to content

Commit

Permalink
summary: Multiple ci-related changes
Browse files Browse the repository at this point in the history
ci: Exclude NewRelic.Api.Agent project from unit test code coverage. (#2031)
test: Generate shorter random network names for container integration tests
ci: Add clarifying comments to build_profiler.yml
  • Loading branch information
tippmar-nr authored Nov 6, 2023
1 parent c6b940d commit 2afee05
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/build_profiler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: Build and Package Profiler

on:
# run this workflow on a push to any branch other than main or a feature branch
#
# NOTE: On a push, only the build jobs will execute; the NuGet jobs will not run.
# Manually run this workflow on your branch when you want it to update the
# NuGet package and create a PR to update the package version reference in
# Home.csproj.
push:
branches-ignore:
- main
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ public override void Start(string commandLineArguments, Dictionary<string, strin
startInfo.EnvironmentVariables.Add("AGENT_PATH", newRelicHomeDirectoryPath);
startInfo.EnvironmentVariables.Add("LOG_PATH", profilerLogDirectoryPath);
startInfo.EnvironmentVariables.Add("CONTAINER_NAME", ContainerName);
startInfo.EnvironmentVariables.Add("NETWORK_NAME", Guid.NewGuid().ToString()); // generate a random network name to keep parallel test execution from failing
// generate a random network name to keep parallel test execution from failing
// network name length needs to be less than 15 characters to be compatible with linux containers
startInfo.EnvironmentVariables.Add("NETWORK_NAME", $"net-{System.Security.Cryptography.RandomNumberGenerator.GetInt32(1000000, 10000000)}");

if (AdditionalEnvironmentVariables != null)
{
Expand Down
2 changes: 1 addition & 1 deletion tests/UnitTests.runsettings
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<!-- See https://github.com/coverlet-coverage/coverlet/blob/master/Documentation/VSTestIntegration.md#advanced-options-supported-via-runsettings
and https://github.com/coverlet-coverage/coverlet/blob/master/Documentation/MSBuildIntegration.md#excluding-from-coverage -->
<Exclude>[NewRelic.OpenTracing.AmazonLambda*]*</Exclude>
<ExcludeByFile>**/tests/**/*, **/NativeMethods.cs, **/NewRelic.Api.Agent/NewRelic.cs, **/AgentManager.cs, **/Agent/Extensions/Providers/**/*</ExcludeByFile>
<ExcludeByFile>**/tests/**/*, **/NativeMethods.cs, **/NewRelic.Api.Agent/*, **/AgentManager.cs, **/Agent/Extensions/Providers/**/*</ExcludeByFile>
<ExcludeByAttribute>NrExcludeFromCodeCoverage,Obsolete,GeneratedCodeAttribute,CompilerGeneratedAttribute</ExcludeByAttribute>
</Configuration>
</DataCollector>
Expand Down

0 comments on commit 2afee05

Please sign in to comment.