mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-06-06 07:04:12 -04:00
Adding tests coverages on sonar
This commit is contained in:
parent
22b9f3240f
commit
1bcd587401
15
.github/workflows/analysis.yml
vendored
15
.github/workflows/analysis.yml
vendored
@ -34,11 +34,18 @@ jobs:
|
|||||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
dotnet test \
|
||||||
|
'-p:CollectCoverage=true;CoverletOutputFormat=opencover' \
|
||||||
|
'-p:SkipTranscoder=true;SkipWebApp=true' || echo "Test failed. Skipping..."
|
||||||
|
|
||||||
|
dotnet build-server shutdown
|
||||||
|
|
||||||
./.sonar/scanner/dotnet-sonarscanner begin \
|
./.sonar/scanner/dotnet-sonarscanner begin \
|
||||||
-k:"AnonymusRaccoon_Kyoo" \
|
-k:"AnonymusRaccoon_Kyoo" \
|
||||||
-o:"anonymus-raccoon" \
|
-o:"anonymus-raccoon" \
|
||||||
-d:sonar.login="${{ secrets.SONAR_TOKEN }}" \
|
-d:sonar.login="${{ secrets.SONAR_TOKEN }}" \
|
||||||
-d:sonar.host.url="https://sonarcloud.io"
|
-d:sonar.host.url="https://sonarcloud.io" \
|
||||||
|
-d:sonar.cs.opencover.reportsPaths="**/coverage.opencover.xml"
|
||||||
|
|
||||||
dotnet build --no-incremental '-p:SkipTranscoder=true;SkipWebApp=true'
|
dotnet build --no-incremental '-p:SkipTranscoder=true;SkipWebApp=true'
|
||||||
|
|
||||||
|
@ -10,6 +10,10 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<PackageReference Include="coverlet.msbuild" Version="3.0.3">
|
||||||
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
|
<PrivateAssets>all</PrivateAssets>
|
||||||
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="5.0.4" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="5.0.4" />
|
||||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
|
||||||
<PackageReference Include="xunit" Version="2.4.1" />
|
<PackageReference Include="xunit" Version="2.4.1" />
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
using System.Linq;
|
|
||||||
using Xunit;
|
|
||||||
|
|
||||||
namespace Kyoo.Tests
|
|
||||||
{
|
|
||||||
public class RepositoryTests
|
|
||||||
{
|
|
||||||
[Fact]
|
|
||||||
public void Get_Test()
|
|
||||||
{
|
|
||||||
TestContext context = new();
|
|
||||||
using DatabaseContext database = context.New();
|
|
||||||
|
|
||||||
Assert.Equal(1, database.Shows.Count());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
17
Kyoo.Tests/Library/SetupTests.cs
Normal file
17
Kyoo.Tests/Library/SetupTests.cs
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
using System.Linq;
|
||||||
|
using Xunit;
|
||||||
|
|
||||||
|
namespace Kyoo.Tests
|
||||||
|
{
|
||||||
|
public class SetupTests
|
||||||
|
{
|
||||||
|
// [Fact]
|
||||||
|
// public void Get_Test()
|
||||||
|
// {
|
||||||
|
// TestContext context = new();
|
||||||
|
// using DatabaseContext database = context.New();
|
||||||
|
//
|
||||||
|
// Assert.Equal(1, database.Shows.Count());
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
}
|
@ -1,42 +0,0 @@
|
|||||||
{
|
|
||||||
"server.urls": "http://*:5000",
|
|
||||||
"public_url": "http://localhost:5000/",
|
|
||||||
|
|
||||||
"database": {
|
|
||||||
"server": "127.0.0.1",
|
|
||||||
"port": "5432",
|
|
||||||
"database": "kyooDB",
|
|
||||||
"user ID": "kyoo",
|
|
||||||
"password": "kyooPassword",
|
|
||||||
"pooling": "true",
|
|
||||||
"maxPoolSize": "95",
|
|
||||||
"timeout": "30"
|
|
||||||
},
|
|
||||||
|
|
||||||
"logging": {
|
|
||||||
"logLevel": {
|
|
||||||
"default": "Warning",
|
|
||||||
"Microsoft": "Warning",
|
|
||||||
"Microsoft.Hosting.Lifetime": "Information"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
"parallelTasks": "1",
|
|
||||||
|
|
||||||
"scheduledTasks": {
|
|
||||||
"scan": "24:00:00"
|
|
||||||
},
|
|
||||||
|
|
||||||
"certificatePassword": "passphrase",
|
|
||||||
|
|
||||||
"transmuxTempPath": "cached/kyoo/transmux",
|
|
||||||
"transcodeTempPath": "cached/kyoo/transcode",
|
|
||||||
"peoplePath": "people",
|
|
||||||
"providerPath": "providers",
|
|
||||||
"profilePicturePath": "users/",
|
|
||||||
"plugins": "plugins/",
|
|
||||||
"defaultPermissions": "read,play,write,admin",
|
|
||||||
"newUserPermissions": "read,play,write,admin",
|
|
||||||
"regex": "(?:\\/(?<Collection>.*?))?\\/(?<Show>.*?)(?: \\(\\d+\\))?\\/\\k<Show>(?: \\(\\d+\\))?(?:(?: S(?<Season>\\d+)E(?<Episode>\\d+))| (?<Absolute>\\d+))?.*$",
|
|
||||||
"subtitleRegex": "^(?<Episode>.*)\\.(?<Language>\\w{1,3})\\.(?<Default>default\\.)?(?<Forced>forced\\.)?.*$"
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user