Skip to content

Commit 2f9c7f4

Browse files
committed
wip: add cadente engine tests
1 parent dad5c42 commit 2f9c7f4

File tree

12 files changed

+26
-8
lines changed

12 files changed

+26
-8
lines changed

.github/workflows/dotnet-tests.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,19 @@ on:
1010
branches: [ "main" ]
1111

1212
jobs:
13-
buildnet9:
13+
test:
1414
runs-on: ubuntu-latest
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
sisk-engine: [ 'Default', 'Cadente' ]
19+
1520
defaults:
1621
run:
1722
shell: bash
18-
working-directory: ./tests
23+
working-directory: ./tests/Sisk.Core
1924
concurrency:
20-
group: ${{ github.workflow }}-${{ github.ref }}
25+
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.sisk-engine }}
2126
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
2227

2328
steps:
@@ -26,5 +31,7 @@ jobs:
2631
uses: actions/setup-dotnet@v4
2732
with:
2833
dotnet-version: 9.x
29-
- name: Test
30-
run: dotnet test --verbosity normal
34+
- name: Test with ${{ matrix.sisk-engine }} engine
35+
env:
36+
SISK_TEST_ENGINE: ${{ matrix.sisk-engine }}
37+
run: dotnet test --verbosity normal
Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
using System.Security.Cryptography;
1414
using System.Text;
1515
using System.Threading;
16+
using System;
1617
using System.Threading.Tasks;
18+
using Sisk.Cadente.CoreEngine;
1719
using Sisk.Core.Entity;
1820
using Sisk.Core.Http;
1921
using Sisk.Core.Http.Hosting;
@@ -30,8 +32,16 @@ public sealed class Server {
3032

3133
[AssemblyInitialize]
3234
public static void AssemblyInit ( TestContext testContext ) {
33-
Instance = HttpServer.CreateBuilder ()
34-
.UseCors ( new CrossOriginResourceSharingHeaders ( allowOrigin: "*", allowMethods: [ "GET", "POST", "PUT" ] ) )
35+
var builder = HttpServer.CreateBuilder()
36+
.UseCors(new CrossOriginResourceSharingHeaders(allowOrigin: "*", allowMethods: ["GET", "POST", "PUT"]));
37+
38+
if (string.Equals(Environment.GetEnvironmentVariable("SISK_TEST_ENGINE"), "Cadente", StringComparison.OrdinalIgnoreCase))
39+
{
40+
Console.WriteLine("Using Cadente test engine.");
41+
builder.UseEngine(new CadenteHttpServerEngine());
42+
}
43+
44+
Instance = builder
3545
.UseRouter ( router => {
3646
// Original HTTP Routes
3747
router.MapGet ( "/tests/plaintext", delegate ( HttpRequest request ) {
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)