The Kladde now has every kind of test. On GitHub, though, not all of them run yet: the database tests from lesson 2.7.4 skip themselves there because there is no SQL Server, and if the end-to-end test turns red, nobody sees what the browser saw. In this lesson you close both gaps in the template .github/workflows/tests.yml from K1. After that every pull request checks everything, and a red test blocks it. How to design such a check from scratch yourself, with several jobs, caches and pinned versions, you learn in K3.

Where the check stands

After lesson 2.7.7, the template looks like this:

YAML
# .github/workflows/tests.yml
name: Tests

on:
  pull_request:
  push:
    branches: [main]

permissions:
  contents: read

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: actions/setup-dotnet@v6
        with:
          global-json-file: global.json
      - name: Check format
        run: dotnet format --verify-no-changes
      - name: Build
        run: dotnet build
      - name: Browser for Playwright
        run: pwsh tests/Kladde.EndToEnd/bin/Debug/net10.0/playwright.ps1 install --with-deps chromium
      - name: Tests
        run: dotnet test --no-build -- --minimum-expected-tests 1

In the log of the “Tests” step, Kladde.Web.Tests ends with something like skipped: 2: the two database tests, with their reason. The run is green, but it hasn’t checked the Kladde’s most important rule, no double booking.