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

Update runsettings #216

Merged
merged 10 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
id: init_codeql
uses: github/codeql-action/init@v3.25.15
uses: github/codeql-action/init@v3.26.6
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
Expand Down Expand Up @@ -98,6 +98,6 @@ jobs:
run: dotnet build --configuration Release --no-restore --tl

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3.25.15
uses: github/codeql-action/analyze@v3.26.6
with:
category: "/language:${{matrix.language}}"
34 changes: 21 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: "Run tests"

env:
# Only merge code coverage results if 1
USE_MERGE: 0

on:
push:
pull_request:
Expand Down Expand Up @@ -60,23 +64,26 @@ jobs:
run: dotnet build --configuration Release --no-restore --tl

- name: Test
run: dotnet test -s .runsettings --no-restore --verbosity normal --logger "GitHubActions;summary.includeNotFoundTests=false"

- name: Code coverage
uses: codecov/codecov-action@v4.5.0
with:
flags: unittests
verbose: true
run: dotnet test --configuration Release -s cicd.runsettings --no-build --verbosity quiet --logger "GitHubActions;summary.includeNotFoundTests=false"

- name: ReportGenerator
uses: danielpalme/ReportGenerator-GitHub-Action@5.3.8
uses: danielpalme/ReportGenerator-GitHub-Action@5.3.9
with:
reports: './**/TestResults/**/*.cobertura.xml'
reports: '**/TestResults/**/coverage.cobertura.xml'
targetdir: '${{ github.workspace }}/coveragereport'
reporttypes: 'MarkdownSummaryGithub;MarkdownAssembliesSummary'
classfilters: '-System.*;-Microsoft.*;-Newtonsoft.*;-System.Text.RegularExpressions.*;-xunit.*;-NUnit.*'

- uses: 8BitJonny/gh-get-current-pr@3.0.0
- name: Upload code coverage results to codecov
uses: codecov/codecov-action@v4.5.0
with:
flags: unittests
verbose: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

- name: Check if PR for current commit
uses: 8BitJonny/gh-get-current-pr@3.0.0
with:
# This will work no matter the trigger event and no matter if it is the first PR commit or not.
sha: ${{ github.event.pull_request.head.sha }}
Expand All @@ -87,7 +94,7 @@ jobs:
id: pr-check

# https://github.com/danielpalme/ReportGenerator/issues/431
- name: Publish coverage summary
- name: Publish PR coverage summary
uses: marocchino/sticky-pull-request-comment@v2
if: steps.pr-check.outputs.pr_found == 'true'
env:
Expand All @@ -106,17 +113,18 @@ jobs:
shell: bash

- name: Merge code coverage results
if: env.USE_MERGE == 1
run: dotnet-coverage merge **/*/*.cobertura.xml -f cobertura -o ./cobertura.xml
shell: bash

# In v4, Artifacts are immutable (unless deleted). So you must change
# each of the uploaded Artifacts to have a different name and filter the
# downloads by name to achieve the same effect
- name: Archive code coverage results
- name: Archive results
# https://github.com/actions/upload-artifact/blob/main/docs/MIGRATION.md
uses: actions/upload-artifact@v4
with:
name: code-coverage-report-${{ matrix.os }}
path: |
./cobertura.xml
**/TestResults/**/coverage.cobertura.xml
coveragereport/*.md
5 changes: 3 additions & 2 deletions .github/workflows/update_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Automatically update PR
uses: adRise/update-pr-branch@v0.8.1
uses: adRise/update-pr-branch@v0.9.0
with:
# Add here: https://github.com/AjayKMehta/builderbuilder/settings/secrets/actions
# Add secret here: https://github.com/AjayKMehta/builderbuilder/settings/secrets/actions
token: ${{ secrets.ACTION_USER_TOKEN }}
base: 'master'
required_approval_count: 0
require_passed_checks: true
require_auto_merge_enabled: false
allow_ongoing_checks: true
2 changes: 1 addition & 1 deletion .github/workflows/version-sweeper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
# Issues will be automatically created for any non-ignored projects that are targeting non-LTS versions
- name: .NET version sweeper
id: dotnet-version-sweeper
uses: dotnet/versionsweeper@v1.9
uses: dotnet/versionsweeper@v2.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down
29 changes: 0 additions & 29 deletions .runsettings

This file was deleted.

122 changes: 122 additions & 0 deletions cicd.runsettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- For more information, see: -->
<!-- https://learn.microsoft.com/en-us/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file -->
<!-- https://github.com/microsoft/codecoverage/blob/main/docs/configuration.md -->
<RunSettings>
<RunConfiguration>
<TargetPlatform>x64</TargetPlatform>
<TreatTestAdapterErrorsAsWarnings>False </TreatTestAdapterErrorsAsWarnings>
<ResultsDirectory>./TestResults</ResultsDirectory>
<MaxCpuCount>3</MaxCpuCount>
<!-- Timeout in milliseconds. If 0, timeout will be infinity -->
<TestSessionTimeout>60000</TestSessionTimeout>
<TreatNoTestsAsError>False</TreatNoTestsAsError>
<!-- Disables in-assembly parallel execution. -->
<DisableParallelization>False</DisableParallelization>
<DisableAppDomain>False</DisableAppDomain>
<CollectSourceInformation>True</CollectSourceInformation>
</RunConfiguration>
<DataCollectionRunSettings>
<DataCollectors>
<DataCollector friendlyName="Code Coverage" uri="datacollector://Microsoft/CodeCoverage/2.0" assemblyQualifiedName="Microsoft.VisualStudio.Coverage.DynamicCoverageDataCollector, Microsoft.VisualStudio.TraceCollector, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<Configuration>
<CoverageLogLevel>Dumps</CoverageLogLevel>
<InstrumentationLogLevel>Dumps</InstrumentationLogLevel>
<CoverageFileLogPath>coverage.log</CoverageFileLogPath>
<!-- Below doesn't work 😦. For details, see https://github.com/microsoft/codecoverage/issues/76 -->
<CoverageFileName>coverage.cobertura.xml</CoverageFileName>
<Format>Cobertura</Format>
<PerTestCodeCoverage>False</PerTestCodeCoverage>
<IncludeTestAssembly>False</IncludeTestAssembly>
<CodeCoverage>
<CommunicationTimeout> 120000</CommunicationTimeout>
<ModulePaths>
<Exclude>
<ModulePath>.*Tests\.dll$</ModulePath>
<ModulePath>.*Argon.*\.dll$</ModulePath>
</Exclude>
</ModulePaths>
<Attributes>
<Exclude>
<Attribute>^System\.Diagnostics\.DebuggerHiddenAttribute$</Attribute>
<Attribute>^System\.Diagnostics\.DebuggerNonUserCodeAttribute$</Attribute>
<Attribute>^System\.Diagnostics\.CodeAnalysis\.ExcludeFromCodeCoverageAttribute$</Attribute>
<Attribute>^System\.ObsoleteAttribute$</Attribute>
<Attribute>^System\.Text\.RegularExpressions\.GeneratedRegexAttribute$</Attribute>
<Attribute>^System\.Runtime\.CompilerServices\.CompilerGeneratedAttribute$</Attribute>
<Attribute>^System\.CodeDom\.Compiler\.GeneratedCodeAttribute$</Attribute>
</Exclude>
</Attributes>
<!-- Match the company name property in the assembly: -->
<CompanyNames>
<Exclude>
<CompanyName>.*microsoft.*</CompanyName>
</Exclude>
</CompanyNames>
<CollectFromChildProcesses>True</CollectFromChildProcesses>
<UseVerifiableInstrumentation>False</UseVerifiableInstrumentation>
<EnableStaticNativeInstrumentation>False</EnableStaticNativeInstrumentation>
<EnableDynamicNativeInstrumentation>False</EnableDynamicNativeInstrumentation>
<EnableDynamicManagedInstrumentation>True</EnableDynamicManagedInstrumentation>
<EnableStaticManagedInstrumentation>True</EnableStaticManagedInstrumentation>
<ExcludeAssembliesWithoutSources>MissingAll</ExcludeAssembliesWithoutSources>
</CodeCoverage>
</Configuration>
</DataCollector>
<!-- Isolate test causing crash. -->
<DataCollector friendlyName="blame" enabled="True">
<Configuration>
<CollectDump DumpType="Full" />
<CollectDumpOnTestSessionHang TestTimeout="10min" HangDumpType="Full" />
</Configuration>
</DataCollector>
</DataCollectors>
</DataCollectionRunSettings>
<LoggerRunSettings>
<Loggers>
<Logger friendlyName="console" enabled="true">
<Configuration>
<Verbosity>normal</Verbosity>
</Configuration>
</Logger>
<Logger friendlyName="blame" enabled="true" />
</Loggers>
</LoggerRunSettings>
<!-- https://docs.nunit.org/articles/vs-test-adapter/Tips-And-Tricks.html -->
<NUnit>
<PrivateBinPath>extras;more.extras</PrivateBinPath>
<DefaultTimeout>60000</DefaultTimeout>
<InternalTraceLevel>Off</InternalTraceLevel>
<RandomSeed>1234567</RandomSeed>
<NumberOfTestWorkers>-1</NumberOfTestWorkers>
<Verbosity>1</Verbosity>
<UseVsKeepEngineRunning>False</UseVsKeepEngineRunning>
<ShadowCopyFiles>False</ShadowCopyFiles>
<DefaultTestNamePattern>{m}{a}</DefaultTestNamePattern>
<DumpXmlTestDiscovery>False</DumpXmlTestDiscovery>
<DumpXmlTestResults>False</DumpXmlTestResults>
<ShowInternalProperties>False</ShowInternalProperties>
<NewOutputXmlFileForEachRun>False</NewOutputXmlFileForEachRun>
<OutputXmlFolderMode>UseResultDirectory</OutputXmlFolderMode>
<!-- NUnit filter expression, see -->
<!-- https://docs.nunit.org/articles/nunit/running-tests/Test-Selection-Language.html -->
<ConsoleOut>2</ConsoleOut>
<UseTestNameInConsoleOutput>True</UseTestNameInConsoleOutput>
<StopOnError>False</StopOnError>
<SkipNonTestAssemblies>False</SkipNonTestAssemblies>
<MapWarningTo>Skipped</MapWarningTo>
<!-- Passed, Failed or Skipped -->
<DisplayName>Name</DisplayName>
<FullnameSeparator>:</FullnameSeparator>
<DiscoveryMethod>Current</DiscoveryMethod>
<AssemblySelectLimit>2000</AssemblySelectLimit>
<IncludeStackTraceForSuites>True</IncludeStackTraceForSuites>
<ExplicitMode>Strict</ExplicitMode>
<SkipExecutionWhenNoTests>True</SkipExecutionWhenNoTests>
<PreFilter>True</PreFilter>
<UseParentFQNForParametrizedTests>True</UseParentFQNForParametrizedTests>
<UseNUnitIdforTestCaseId>False</UseNUnitIdforTestCaseId>
<AllowParallelWithDebugger>True</AllowParallelWithDebugger>
<ThrowOnEachFailureUnderDebugger>True</ThrowOnEachFailureUnderDebugger>
</NUnit>
</RunSettings>
Loading