Skip to content

Commit 5600d8d

Browse files
committed
Merge branch 'main' of https://github.com/masastack/MASA.Framework into refactor/cache
2 parents 854cd98 + 9987acc commit 5600d8d

File tree

2 files changed

+46
-19
lines changed

2 files changed

+46
-19
lines changed

Diff for: .github/workflows/Codecov.yml

+40-19
Original file line numberDiff line numberDiff line change
@@ -68,23 +68,44 @@ jobs:
6868
key: ${{ runner.os }}-sonar-scanner
6969
restore-keys: ${{ runner.os }}-sonar-scanner
7070

71-
- name: SonarScanner for .NET 6 with pull request decoration support
72-
uses: highbyte/sonarscan-dotnet@v2.1.3
73-
with:
74-
# The key of the SonarQube project
75-
sonarProjectKey: masastack_MASA.Framework
76-
# The name of the SonarQube project
77-
sonarProjectName: MASA.Framework
78-
# The name of the SonarQube organization in SonarCloud. For hosted SonarQube, skip this setting.
79-
sonarOrganization: masastack
80-
# Optional command arguments to dotnet test
81-
dotnetTestArguments: --filter FullyQualifiedName!~Masa.Utils --no-build --logger trx --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover
82-
# Optional extra command arguments the the SonarScanner 'begin' command
83-
sonarBeginArguments: /d:sonar.cs.opencover.reportsPaths="**/TestResults/**/coverage.opencover.xml" -d:sonar.cs.vstest.reportsPaths="**/TestResults/*.trx"
71+
# - name: SonarScanner for .NET 6 with pull request decoration support
72+
# uses: highbyte/sonarscan-dotnet@v2.1.3
73+
# with:
74+
# # The key of the SonarQube project
75+
# sonarProjectKey: masastack_MASA.Framework
76+
# # The name of the SonarQube project
77+
# sonarProjectName: MASA.Framework
78+
# # The name of the SonarQube organization in SonarCloud. For hosted SonarQube, skip this setting.
79+
# sonarOrganization: masastack
80+
# # Optional command arguments to dotnet test
81+
# dotnetTestArguments: --filter FullyQualifiedName!~Masa.Utils --no-build --logger trx --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover
82+
# # Optional extra command arguments the the SonarScanner 'begin' command
83+
# sonarBeginArguments: /d:sonar.cs.opencover.reportsPaths="**/TestResults/**/coverage.opencover.xml" -d:sonar.cs.vstest.reportsPaths="**/TestResults/*.trx"
84+
#
85+
#env:
86+
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
87+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
88+
89+
- name: Install SonarCloud scanner
90+
run: |
91+
dotnet tool install --global dotnet-sonarscanner
8492
85-
env:
86-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
87-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
93+
- name: Build and analyze
94+
env:
95+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
96+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
97+
run: |
98+
dotnet sonarscanner begin /k:"masastack_MASA.Framework" /o:"masastack" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
99+
dotnet build /p:ContinuousIntegrationBuild=true
100+
# dotnet test --filter FullyQualifiedName!~Masa.Utils --no-build --verbosity normal --collect "Code Coverage" /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Exclude="[*.Tests]*"
101+
dotnet sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
102+
103+
- name: Opencover Test
104+
run: |
105+
dotnet test --filter FullyQualifiedName~Masa.Contrib --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Exclude="[*.Tests]*"
106+
107+
- name: codecov
108+
uses: codecov/codecov-action@v2
88109

89110
# - name: Install SonarCloud scanner
90111
# run: |
@@ -95,10 +116,10 @@ env:
95116
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
96117
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
97118
# run: |
98-
# dotnet sonarscanner begin /k:"masastack_MASA.Framework" /o:"masastack" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
119+
# dotnet sonarscanner begin /k:"masastack_MASA.Framework" /o:"masastack" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths="**/TestResults/**/coverage.opencover.xml" -d:sonar.cs.vstest.reportsPaths="**/TestResults/*.trx"
99120
# dotnet build /p:ContinuousIntegrationBuild=true
100-
# dotnet test --filter FullyQualifiedName!~Masa.Utils --no-build --verbosity normal --collect "Code Coverage" /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Exclude="[*.Tests]*"
121+
# dotnet test --filter FullyQualifiedName!~Masa.Utils --no-build --logger trx --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover /p:Exclude="[*.Tests]*"
101122
# dotnet sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
102123
#
103124
# - name: codecov
104-
# uses: codecov/codecov-action@v2
125+
# uses: codecov/codecov-action@v2

Diff for: src/Contrib/Caching/Masa.Contrib.Caching.MultilevelCache.Tests/MultilevelCacheClientTest.cs

+6
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,16 @@ public async Task TestGetOrSetAsync()
188188
DistributedCacheEntryFunc = () => new CacheEntry<Guid?>(null, TimeSpan.FromSeconds(3))
189189
}));
190190

191+
Assert.AreEqual(null, await _multilevelCacheClient.GetOrSetAsync("test104", new CombinedCacheEntry<Guid?>()
192+
{
193+
DistributedCacheEntryAsyncFunc = () => Task.FromResult(new CacheEntry<Guid?>(null, TimeSpan.FromSeconds(3)))
194+
}));
195+
191196
await _multilevelCacheClient.RemoveAsync<string>("test100");
192197
await _multilevelCacheClient.RemoveAsync<decimal?>("test101");
193198
await _multilevelCacheClient.RemoveAsync<Guid?>("test102");
194199
await _multilevelCacheClient.RemoveAsync<Guid?>("test103");
200+
await _multilevelCacheClient.RemoveAsync<Guid?>("test104");
195201
}
196202

197203
[TestMethod]

0 commit comments

Comments
 (0)