Skip to content

Commit 99ed062

Browse files
committed
#43 - рассчёт покрытия через интеграционники
1 parent 73c02eb commit 99ed062

File tree

4 files changed

+14
-15
lines changed

4 files changed

+14
-15
lines changed

.github/workflows/develop.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,16 @@ jobs:
5252
- name: Build
5353
run: dotnet build /p:Version=${{ steps.version_step.outputs.fullSemVer }} --no-restore -c Release -v n
5454
- name: Unit Tests
55+
run: dotnet test -c Release --no-build -v n --filter="Category=Unit"
56+
- name: Integration Tests
5557
run: |
56-
dotnet test -c Release ./tests/HydraScript.Infrastructure.LexerRegexGenerator.UnitTests/HydraScript.Infrastructure.LexerRegexGenerator.UnitTests.csproj --no-build -v n
57-
dotnet test -c Release /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura --no-build -v n --filter="Category=Unit"
58+
dotnet test -c Release /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura --no-build -v n --filter="Category=Integration"
5859
mkdir coverage-report
5960
- name: Code Coverage Summary Report For Merge Request
6061
if: github.event_name == 'pull_request_target'
6162
uses: 5monkeys/cobertura-action@master
6263
with:
63-
path: ./tests/HydraScript.UnitTests/coverage.cobertura.xml
64+
path: ./tests/HydraScript.IntegrationTests/coverage.cobertura.xml
6465
repo_token: ${{ secrets.GITHUB_TOKEN }}
6566
minimum_coverage: 20
6667
fail_below_threshold: true
@@ -72,16 +73,14 @@ jobs:
7273
- name: ReportGenerator
7374
uses: danielpalme/ReportGenerator-GitHub-Action@5.2.1
7475
with:
75-
reports: './tests/HydraScript.UnitTests/coverage.cobertura.xml'
76+
reports: './tests/HydraScript.IntegrationTests/coverage.cobertura.xml'
7677
targetdir: './coverage-report'
7778
- name: Upload coverage report artifact
7879
if: github.event_name == 'push'
7980
uses: actions/upload-artifact@v4
8081
with:
8182
name: CoverageReport
8283
path: coverage-report
83-
- name: Integration Tests
84-
run: dotnet test -c Release --no-build -v n --filter="Category=Integration"
8584
- name: Upload Windows Build
8685
if: github.ref != 'refs/heads/master' && github.event_name == 'push'
8786
uses: actions/upload-artifact@v4

tests/HydraScript.Infrastructure.LexerRegexGenerator.UnitTests/PatternGeneratorTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace HydraScript.Infrastructure.LexerRegexGenerator.UnitTests;
1010

1111
public class PatternGeneratorTests(ITestOutputHelper output)
1212
{
13-
[Fact]
13+
[Fact, Trait("Category", "Unit")]
1414
public void Initialize_PatternContainerMarked_CorrectlyGenerated()
1515
{
1616
var provider = Substitute.For<ITokenTypesStreamProvider>();

tests/HydraScript.IntegrationTests/HydraScript.IntegrationTests.csproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@
99
<PackageReference Include="MartinCostello.Logging.XUnit" />
1010
<PackageReference Include="Microsoft.Extensions.Diagnostics.Testing" />
1111
<PackageReference Include="Xunit.DependencyInjection" />
12+
<PackageReference Include="coverlet.collector">
13+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
14+
<PrivateAssets>all</PrivateAssets>
15+
</PackageReference>
16+
<PackageReference Include="coverlet.msbuild">
17+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
18+
<PrivateAssets>all</PrivateAssets>
19+
</PackageReference>
1220
</ItemGroup>
1321

1422
<ItemGroup>

tests/HydraScript.UnitTests/HydraScript.UnitTests.csproj

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,6 @@
22

33
<ItemGroup>
44
<PackageReference Include="FluentAssertions" />
5-
<PackageReference Include="coverlet.collector">
6-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
7-
<PrivateAssets>all</PrivateAssets>
8-
</PackageReference>
9-
<PackageReference Include="coverlet.msbuild">
10-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
11-
<PrivateAssets>all</PrivateAssets>
12-
</PackageReference>
135
</ItemGroup>
146

157
<ItemGroup>

0 commit comments

Comments
 (0)