Skip to content

Commit 95a0515

Browse files
authored
Merge main to feature/10.0 (#8027)
2 parents d7c0946 + fe471d1 commit 95a0515

File tree

4 files changed

+80
-6
lines changed

4 files changed

+80
-6
lines changed

.github/workflows/sync-branches.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
if: github.repository == 'dotnet/dotnet-monitor'
1515
strategy:
1616
matrix:
17-
branch: ["release/8.0", "release/8.x", "release/9.x"]
17+
branch: ["release/8.x", "release/9.0", "release/9.x"]
1818
name: 'Sync non-code to ${{ matrix.branch }}'
1919
runs-on: ubuntu-latest
2020
permissions:
@@ -52,12 +52,10 @@ jobs:
5252
auth_token: ${{ secrets.GITHUB_TOKEN }}
5353

5454
sync-code:
55-
# Disable code sync
56-
if: false
57-
#if: github.repository == 'dotnet/dotnet-monitor'
55+
if: github.repository == 'dotnet/dotnet-monitor'
5856
strategy:
5957
matrix:
60-
branch: ["feature/9.x"]
58+
branch: ["feature/10.0"]
6159
name: 'Sync branch with ${{ matrix.branch }}'
6260
runs-on: ubuntu-latest
6361
permissions:
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
trigger: none
2+
pr: none
3+
4+
parameters:
5+
- name: IsTestRun
6+
type: boolean
7+
default: true
8+
- name: IsDryRun
9+
type: boolean
10+
default: true
11+
12+
variables:
13+
- template: /eng/common/templates-official/variables/pool-providers.yml@self
14+
- name: _TeamName
15+
value: DotNetCore
16+
readonly: true
17+
- group: Release-Pipeline
18+
- name: IsDryRun
19+
value: ${{ parameters.IsDryRun }}
20+
readonly: true
21+
- name: IsTestRun
22+
value: ${{ parameters.IsTestRun }}
23+
readonly: true
24+
25+
resources:
26+
pipelines:
27+
- pipeline: dotnet-monitor_build
28+
source: 'dotnet\dotnet-monitor\dotnet-dotnet-monitor'
29+
30+
extends:
31+
template: /eng/pipelines/templates/pipeline-template.yml@self
32+
parameters:
33+
sdl:
34+
sbom:
35+
enabled: false
36+
stages:
37+
- stage: Validation
38+
39+
jobs:
40+
- job: Validate
41+
42+
variables:
43+
# Allow for differentiation of runs of this pipeline
44+
# when running it with the same build repeatedly.
45+
- name: RunRevision
46+
value: $[counter(format('{0}|{1}|{2}', variables['resources.pipeline.Build.runID'], variables['IsDryRun'], variables['IsTestRun']), 1)]
47+
readonly: true
48+
49+
workspace:
50+
clean: all
51+
52+
steps:
53+
- download: none
54+

src/Tests/Microsoft.Diagnostics.Monitoring.Tool.FunctionalTests/CollectionRuleTests.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ await ScenarioRunner.SingleTarget(
7272
});
7373
}
7474

75+
#if NET8_0_OR_GREATER
7576
/// <summary>
7677
/// Validates that a startup rule will execute and complete without action beyond
7778
/// discovering the target process.
@@ -110,6 +111,7 @@ await ScenarioRunner.SingleTarget(
110111
ruleCompletedTask = runner.WaitForCollectionRuleCompleteAsync(DefaultRuleName);
111112
});
112113
}
114+
#endif
113115

114116
/// <summary>
115117
/// Validates that a non-startup rule will complete when it has an action limit specified
@@ -289,6 +291,7 @@ await ScenarioRunner.SingleTarget(
289291
});
290292
}
291293

294+
#if NET8_0_OR_GREATER
292295
/// <summary>
293296
/// Validates that a collection rule with a managed entry point assembly name filter can be matched to the
294297
/// target process.
@@ -350,6 +353,7 @@ await ScenarioRunner.SingleTarget(
350353
filteredTask = runner.WaitForCollectionRuleUnmatchedFiltersAsync(DefaultRuleName);
351354
});
352355
}
356+
#endif
353357

354358
/// <summary>
355359
/// Validates that a change in the collection rule configuration is detected and applied correctly.

src/Tests/Microsoft.Diagnostics.Monitoring.WebApi.UnitTests/DefaultProcessConfigurationTests.cs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,13 @@ public void ConvertProcessConfig()
7171
Value = "arg1"
7272
};
7373

74+
var filterDescriptorManagedEntryPointAssemblyName = new ProcessFilterDescriptor
75+
{
76+
Key = ProcessFilterKey.ManagedEntryPointAssemblyName,
77+
MatchType = ProcessFilterType.Exact,
78+
Value = "MyApp"
79+
};
80+
7481
var filter = CreateFilterEntry(filterDescriptorPid);
7582
ValidateProcessFilter(DiagProcessFilterCriteria.ProcessId, filterDescriptorPid.Value, filter);
7683

@@ -90,14 +97,24 @@ public void ConvertProcessConfig()
9097
filter = CreateFilterEntry(filterDescriptorCommandContains);
9198
ValidateProcessFilter(DiagProcessFilterCriteria.CommandLine, filterDescriptorCommandContains.Value, DiagProcessFilterMatchType.Contains, filter);
9299

100+
filter = CreateFilterEntry(filterDescriptorManagedEntryPointAssemblyName);
101+
ValidateProcessFilter(DiagProcessFilterCriteria.ManagedEntryPointAssemblyName, filterDescriptorManagedEntryPointAssemblyName.Value, filter);
102+
93103
//This filter doesn't make any sense but we are just testing that we can combine multiple filters
94-
var options = CreateOptions(filterDescriptorPid, filterDescriptorName, filterDescriptorNameContains, filterDescriptorCommand, filterDescriptorCommandContains);
104+
var options = CreateOptions(
105+
filterDescriptorPid,
106+
filterDescriptorName,
107+
filterDescriptorNameContains,
108+
filterDescriptorCommand,
109+
filterDescriptorCommandContains,
110+
filterDescriptorManagedEntryPointAssemblyName);
95111

96112
ValidateProcessFilter(DiagProcessFilterCriteria.ProcessId, filterDescriptorPid.Value, options.Filters[0]);
97113
ValidateProcessFilter(DiagProcessFilterCriteria.ProcessName, filterDescriptorName.Value, options.Filters[1]);
98114
ValidateProcessFilter(DiagProcessFilterCriteria.ProcessName, filterDescriptorNameContains.Value, DiagProcessFilterMatchType.Contains, options.Filters[2]);
99115
ValidateProcessFilter(DiagProcessFilterCriteria.CommandLine, filterDescriptorCommand.Value, options.Filters[3]);
100116
ValidateProcessFilter(DiagProcessFilterCriteria.CommandLine, filterDescriptorCommandContains.Value, DiagProcessFilterMatchType.Contains, options.Filters[4]);
117+
ValidateProcessFilter(DiagProcessFilterCriteria.ManagedEntryPointAssemblyName, filterDescriptorManagedEntryPointAssemblyName.Value, options.Filters[5]);
101118
}
102119

103120
[Fact]
@@ -115,6 +132,7 @@ public void NewCriteriaTest()
115132
DiagProcessFilterCriteria.RuntimeId,
116133
DiagProcessFilterCriteria.CommandLine,
117134
DiagProcessFilterCriteria.ProcessName,
135+
DiagProcessFilterCriteria.ManagedEntryPointAssemblyName
118136
};
119137

120138
Assert.Equal(expectedValues.Length, actualValues.Length);

0 commit comments

Comments
 (0)