Skip to content

Commit bd778e5

Browse files
committed
fix
1 parent 7f2f7fe commit bd778e5

1 file changed

Lines changed: 11 additions & 10 deletions

File tree

.github/actions/testing/test/action.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,27 +60,28 @@ runs:
6060
- name: 'Test with .NET CLI'
6161
shell: bash
6262
env:
63-
DOTNET_USE_TEST_PLATFORM: '1'
63+
DOTNET_USE_TEST_PLATFORM: '1' # Ensures you're using the new test platform if necessary
6464
run: |
6565
ARGS=()
6666
ARGS+=("${{ inputs.project-path }}")
6767
ARGS+=(--configuration "${{ inputs.build-configuration }}")
6868
ARGS+=(--results-directory "${{ inputs.test-results-directory }}")
6969
70-
# Optional TRX logger
70+
# Optional: TRX logger
7171
if [[ "${{ inputs.use-trf-logger }}" == "true" ]]; then
7272
ARGS+=(--logger:trx)
7373
fi
7474
75-
# Optional code coverage logic
75+
# Native Code Coverage switches
7676
if [[ "${{ inputs.collect-code-coverage }}" == "true" ]]; then
77-
ARGS+=(--collect:"XPlat Code Coverage")
78-
79-
if [[ -n "${{ inputs.code-coverage-settings-file }}" ]]; then
80-
ARGS+=(--property:ExcludeByAttribute="^System\.Diagnostics\.DebuggerHiddenAttribute$,^System\.Diagnostics\.CodeAnalysis\.ExcludeFromCodeCoverageAttribute$" }}")
81-
fi
82-
83-
ARGS+=(--property:CoverletOutputFormat="${{ inputs.code-coverage-output-format }}")
77+
ARGS+=(--collect:"Code Coverage")
78+
# Output format: cobertura, json, etc
79+
ARGS+=(--cc-output-format:"${{ inputs.code-coverage-output-format }}")
80+
# Exclude by attribute (comma-separated, no regex)
81+
ARGS+=(--cc-exclude-attribute:"System.Diagnostics.DebuggerHiddenAttribute,System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute")
82+
# You can add more --cc-* switches if needed, e.g.:
83+
# ARGS+=(--cc-include:"MyNamespace*") # Include filters
84+
# ARGS+=(--cc-exclude:"OtherNamespace*") # Exclude by name
8485
fi
8586
8687
echo "Running: dotnet test ${ARGS[*]}"

0 commit comments

Comments
 (0)