From b5fa7b907202c4f2d8f741abbdda8c2e9c3a94da Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Sun, 11 Oct 2026 02:26:31 +0100 Subject: [PATCH 01/11] Github tests --- .github/workflows/docker-publish-backend.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish-backend.yml b/.github/workflows/docker-publish-backend.yml index d8466bdb8..6b4d1fca7 100644 --- a/.github/workflows/docker-publish-backend.yml +++ b/.github/workflows/docker-publish-backend.yml @@ -26,7 +26,7 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Test - run: dotnet test --no-build --verbosity normal --filter="Category!=Platform-Android" + run: dotnet test --report-xunit --report-xunit-html --results-directory "test-reports" # 4. Build et Push de l'image de production finale - name: Build and push production image uses: docker/build-push-action@v7 From bc8ae74fc390cc8e6233e8fde11375a37ee00fee Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Sun, 11 Oct 2026 04:29:29 +0100 Subject: [PATCH 02/11] using pazof/yavsc-build-env:debian13-dotnet10-android36-jdk21-v4 --- .github/workflows/docker-publish-backend.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish-backend.yml b/.github/workflows/docker-publish-backend.yml index 6b4d1fca7..89527fd17 100644 --- a/.github/workflows/docker-publish-backend.yml +++ b/.github/workflows/docker-publish-backend.yml @@ -8,7 +8,7 @@ on: jobs: production-deploy: - runs-on: ubuntu-latest + runs-on: pazof/yavsc-build-env:debian13-dotnet10-android36-jdk21-v4 steps: # 1. Récupération du code From d7e274c93a0badc01d5b56c46d39c6c417620ca5 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Sun, 11 Oct 2026 05:08:24 +0100 Subject: [PATCH 03/11] run-on ubuntu-26.04 --- .github/workflows/docker-publish-backend.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish-backend.yml b/.github/workflows/docker-publish-backend.yml index 89527fd17..55f79f0be 100644 --- a/.github/workflows/docker-publish-backend.yml +++ b/.github/workflows/docker-publish-backend.yml @@ -8,7 +8,9 @@ on: jobs: production-deploy: - runs-on: pazof/yavsc-build-env:debian13-dotnet10-android36-jdk21-v4 + runs-on: ubuntu-26.04 + container: + image: pazof/yavsc-build-env:debian13-dotnet10-android36-jdk21-v4 steps: # 1. Récupération du code @@ -25,6 +27,12 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Set up .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 10.0.x + - name: Workloads restore + run: dotnet workload restore - name: Test run: dotnet test --report-xunit --report-xunit-html --results-directory "test-reports" # 4. Build et Push de l'image de production finale From 29a5b8be8da57256ce0fb40e72ff2885f1fcdeae Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Sun, 11 Oct 2026 05:11:53 +0100 Subject: [PATCH 04/11] run-on ubuntu-26.04, using the default container --- .github/workflows/docker-publish-backend.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/docker-publish-backend.yml b/.github/workflows/docker-publish-backend.yml index 55f79f0be..29a378f61 100644 --- a/.github/workflows/docker-publish-backend.yml +++ b/.github/workflows/docker-publish-backend.yml @@ -9,8 +9,6 @@ on: jobs: production-deploy: runs-on: ubuntu-26.04 - container: - image: pazof/yavsc-build-env:debian13-dotnet10-android36-jdk21-v4 steps: # 1. Récupération du code From afbefae111161e6c9b7e1dc923bde57265aaa316 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Sun, 11 Oct 2026 05:43:03 +0100 Subject: [PATCH 05/11] make test>/dev/null --- .github/workflows/docker-publish-backend.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish-backend.yml b/.github/workflows/docker-publish-backend.yml index 29a378f61..341ba5a05 100644 --- a/.github/workflows/docker-publish-backend.yml +++ b/.github/workflows/docker-publish-backend.yml @@ -32,7 +32,7 @@ jobs: - name: Workloads restore run: dotnet workload restore - name: Test - run: dotnet test --report-xunit --report-xunit-html --results-directory "test-reports" + run: make test >/dev/null # 4. Build et Push de l'image de production finale - name: Build and push production image uses: docker/build-push-action@v7 From c34941a4b94b54832e26cd70f0c66e58c93cb5f3 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Sun, 11 Oct 2026 05:59:59 +0100 Subject: [PATCH 06/11] no need for .env to test --- Makefile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Makefile b/Makefile index 1893a910e..04efba0be 100644 --- a/Makefile +++ b/Makefile @@ -5,8 +5,6 @@ DESTDIR=/tmp/yavsc APP_PATH=srv/www/yavsc APP_FULL_PATH=$(DESTDIR)/$(APP_PATH) -include .env - all: dotnet build --nologo From eb347e690056bbd76fda776fc609724d95d65867 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Sun, 11 Oct 2026 06:12:41 +0100 Subject: [PATCH 07/11] upload test resultes, in case of failure --- .github/workflows/docker-publish-backend.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-publish-backend.yml b/.github/workflows/docker-publish-backend.yml index 341ba5a05..2d84b767f 100644 --- a/.github/workflows/docker-publish-backend.yml +++ b/.github/workflows/docker-publish-backend.yml @@ -9,7 +9,6 @@ on: jobs: production-deploy: runs-on: ubuntu-26.04 - steps: # 1. Récupération du code - name: Check out the repo @@ -32,7 +31,17 @@ jobs: - name: Workloads restore run: dotnet workload restore - name: Test - run: make test >/dev/null + env: + TEST_FAILED: "" + run: make test || export TEST_FAILED=$? + - uses: actions/upload-artifact@v7 + with: + name: my-artifact + path: test-reports/**/* + - name: Fail if tests failed + if: ${{ env.TEST_FAILED != '' && env.TEST_FAILED != '0' }} + run: exit $TEST_FAILED + # 4. Build et Push de l'image de production finale - name: Build and push production image uses: docker/build-push-action@v7 From 875a020e0d1e5f172477bdaa1f6f881f8c878593 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Sun, 11 Oct 2026 06:27:13 +0100 Subject: [PATCH 08/11] simpler, better, faster, stronger --- Dockerfile.backend | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/Dockerfile.backend b/Dockerfile.backend index a4e9a54a9..46c9a982e 100644 --- a/Dockerfile.backend +++ b/Dockerfile.backend @@ -1,36 +1,12 @@ # Utilisation de l'image globale pour le build et l'exécution -FROM pazof/yavsc-build-env:debian12-dotnet10-android36-v1 AS build-env +FROM pazof/yavsc-build-env:debian13-dotnet10-android36-jdk21-v4 AS build-env WORKDIR /src - # 1. Copie de la solution -COPY *.sln ./ -COPY Directory.*.props ./ - -# 2. Copie de l'intégralité des fichiers de projets (.csproj) pour la restauration -COPY src/Yavsc.Org/*.csproj ./src/Yavsc.Org/ -COPY src/Yavsc.Abstract/*.csproj ./src/Yavsc.Abstract/ -COPY src/Yavsc.Server/*.csproj ./src/Yavsc.Server/ -COPY src/Yavsc.Api/*.csproj ./src/Yavsc.Api/ -COPY src/Yavsc.Blogs/*.csproj ./src/Yavsc.Blogs/ -COPY src/cli/*.csproj ./src/cli/ -COPY src/Yavsc.Org.Tests/*.csproj ./src/Yavsc.Org.Tests/ - -# Projets associés à PostIt -COPY src/PostIt/PostIt/*.csproj ./src/PostIt/PostIt/ -COPY src/PostIt/PostIt.Android/*.csproj ./src/PostIt/PostIt.Android/ -COPY src/PostIt/PostIt.Browser/*.csproj ./src/PostIt/PostIt.Browser/ -COPY src/PostIt/PostIt.Desktop/*.csproj ./src/PostIt/PostIt.Desktop/ - -# 4. Copie de l'intégralité du code source COPY . . - +RUN dotnet workload restore # 4. Restauration des dépendances pour tous les projets RUN dotnet restore - -# 5. Copie de la totalité du code source (filtrée par votre .dockerignore) -COPY . . - # 6. Compilation du serveur Web principal RUN dotnet build src/Yavsc.Org/Yavsc.Org.csproj -c Release --no-restore -clp:ErrorsOnly From da35ac0a83883c0891fe33fa8f683c3c33eb2883 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Sun, 11 Oct 2026 06:34:53 +0100 Subject: [PATCH 09/11] do not decide to attach dev tools from the compilation flag --- src/PostIt/PostIt/App.axaml.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/PostIt/PostIt/App.axaml.cs b/src/PostIt/PostIt/App.axaml.cs index fca8e0313..b0f1c30cd 100644 --- a/src/PostIt/PostIt/App.axaml.cs +++ b/src/PostIt/PostIt/App.axaml.cs @@ -44,10 +44,6 @@ public partial class App : Application, ILiveView, IVMPusherApp public override void Initialize() { AvaloniaXamlLoader.Load(this); - -#if DEBUG - this.AttachDeveloperTools(); -#endif } public override void OnFrameworkInitializationCompleted() From 27446192496077aa4416530f713bab9f6965c86b Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Sun, 11 Oct 2026 07:28:17 +0100 Subject: [PATCH 10/11] fix(postit): mount session banner in headless tests Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- CHANGELOG.md | 5 ++ .../PostIt.Tests/SessionStatusBannerTests.cs | 60 ++++++++----------- 2 files changed, 31 insertions(+), 34 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 946ee328f..3320ee74f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,11 @@ ### Fixed +* [PostIt.Tests] Les tests du bandeau de session utilisent le bandeau + réellement monté dans la fenêtre headless, au lieu d'un contrôle détaché. + Les fenêtres sont fermées après chaque test et les quatre boutons + de navigation sont vérifiés. + * [PostIt] Les liens Markdown des pièces jointes utilisent désormais le même filtre de nom que l'upload serveur, avant l'encodage URL. Le libellé conserve le nom original, notamment ses accents. diff --git a/src/PostIt/PostIt.Tests/SessionStatusBannerTests.cs b/src/PostIt/PostIt.Tests/SessionStatusBannerTests.cs index 3516e93d6..f53fffd9a 100644 --- a/src/PostIt/PostIt.Tests/SessionStatusBannerTests.cs +++ b/src/PostIt/PostIt.Tests/SessionStatusBannerTests.cs @@ -1,6 +1,5 @@ using Avalonia.Controls; using Avalonia.Headless.XUnit; -using Avalonia.Styling; using Avalonia.VisualTree; using PostIt.ViewModels; using PostIt.Views; @@ -23,41 +22,36 @@ namespace PostIt.Tests; /// new Window().Show() throws because the harness has not /// been initialised for that thread. /// -/// The session banner's DataContext is not wired in -/// these tests: App.OnFrameworkInitializationCompleted is -/// not called in a unit test, so we set the DataContext on the -/// banner directly. The production code path is exercised +/// These tests set the DataContext directly on the banner +/// mounted in the window. The production code path is exercised /// end-to-end by the manual launch, not here. /// -public class SessionStatusBannerTests +public class SessionStatusBannerTests : IDisposable { - [AvaloniaFact] - public void Banner_renders_three_buttons_in_the_visual_tree() - { - MainWindow window = new MainWindow(); - window.Show(); + private MainWindow? _window; - var buttons = window.GetVisualDescendants() + [AvaloniaFact] + public void Banner_renders_four_buttons_in_the_visual_tree() + { + SessionStatusBanner banner = CreateBanner(); + + var buttons = banner.GetVisualDescendants() .OfType