Heimdall Gitea / Detect CI scope (push) Successful in 5s
Heimdall Gitea / Build and tests (push) Successful in 24m51s
Heimdall Gitea / Build and scan server image (push) Successful in 10m53s
Heimdall Gitea / Build and scan agent image (push) Successful in 10m33s
Heimdall Gitea / Build and scan NVIDIA Agent image (push) Successful in 14m22s
Heimdall Gitea / Publish Docker Hub latest tags (push) Successful in 2m3s
Heimdall Gitea / Publish signed main release (push) Failing after 44m2s
Heimdall Gitea / CI policy (push) Failing after 2s
Refs #293 ## Résumé Chaque push de merge sur `main`, y compris documentation seule, passe les validations puis publie automatiquement une release signée par commit. Les notes listent les PR fusionnées. La release reste inaccessible à `latest` jusqu’à la fin de l’upload; les jobs retardés pour un commit dépassé publient une prérelease pour ne pas rétrograder `latest`. La version Central est affichée dans le menu latéral. Aucun tag Git manuel ne déclenche le workflow. Gitea requiert un identifiant de tag pour l’objet Release; `ci-<SHA complet>` est créé automatiquement par l’API après les validations. ## Validation observée - Restore verrouillé du projet Web.Tests réussi. - `NavigationTests.MainLayout_AfficheVersionDuServeur` : 1/1 passé. - Simulation offline : release complète publiée après upload, 10 assets, signature P-256, checksums, digests CPU/GPU et six pushes simulés; aucun Gitea/Docker Hub réel contacté. - Compose source : `/healthz` sain et `/api/version` retournant `0.0.0-local`; ressources et tag exact retirés et vérifiés absents. - `bash -n`, `py_compile`, parsing YAML et `git diff --check` réussis. Le premier merge réel, la publication Gitea/Docker Hub et la lecture de `/releases/latest` depuis Central déployé restent à valider; l’issue #293 reste ouverte. Skill : `skills/release-automation/SKILL.md`. Reviewed-on: #312 Co-authored-by: Arnaud Dartois <admin@tordais.cc>
102 lines
3.4 KiB
C#
102 lines
3.4 KiB
C#
using Bunit;
|
|
using Bunit.TestDoubles;
|
|
using Heimdall.Web.Components.Layout;
|
|
using Heimdall.Web.Services;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Shouldly;
|
|
|
|
namespace Heimdall.Web.Tests.Components.Pages;
|
|
|
|
public class NavigationTests : PageTestBase
|
|
{
|
|
[Fact]
|
|
public void MainLayout_AfficheVersionDuServeur()
|
|
{
|
|
Handler.OnGet("api/version", new { version = "0.0.0-ci.abcdef123456" });
|
|
Services.GetRequiredService<BunitNavigationManager>()
|
|
.NavigateTo("http://localhost/dashboard");
|
|
|
|
var cut = Render<MainLayout>();
|
|
|
|
cut.WaitForAssertion(() => cut.Find("[data-testid='server-version']")
|
|
.TextContent.ShouldContain("0.0.0-ci.abcdef123456"));
|
|
}
|
|
|
|
[Fact]
|
|
public void MainLayout_Admin_VoitSousMenuGestionUtilisateurs()
|
|
{
|
|
LoginAs();
|
|
Services.GetRequiredService<BunitNavigationManager>()
|
|
.NavigateTo("http://localhost/dashboard");
|
|
|
|
var cut = Render<MainLayout>();
|
|
|
|
cut.Markup.ShouldContain("Gestion des utilisateurs");
|
|
// Sur /dashboard, le groupe est replié (aria-expanded=false).
|
|
var group = cut.FindAll(".mud-nav-group").FirstOrDefault(b => b.TextContent.Contains("Gestion des utilisateurs"));
|
|
group.ShouldNotBeNull();
|
|
group!.OuterHtml.ShouldContain("aria-expanded=\"false\"");
|
|
}
|
|
|
|
[Fact]
|
|
public void MainLayout_SurPageUtilisateurs_DeplieLeSousMenu()
|
|
{
|
|
LoginAs();
|
|
Services.GetRequiredService<BunitNavigationManager>()
|
|
.NavigateTo("http://localhost/users");
|
|
|
|
var cut = Render<MainLayout>();
|
|
|
|
// Sur /users, le sous-menu est déplié (aria-expanded=true).
|
|
cut.Markup.ShouldContain("Gestion des utilisateurs");
|
|
var group = cut.FindAll(".mud-nav-group").FirstOrDefault(b => b.TextContent.Contains("Gestion des utilisateurs"));
|
|
group.ShouldNotBeNull();
|
|
group!.OuterHtml.ShouldContain("aria-expanded=\"true\"");
|
|
cut.Markup.ShouldContain("href=\"/users\"");
|
|
cut.Markup.ShouldContain("href=\"/admin/groups\"");
|
|
cut.Markup.ShouldContain("href=\"/admin/roles\"");
|
|
cut.Markup.ShouldContain("href=\"/admin/claims\"");
|
|
}
|
|
|
|
[Fact]
|
|
public void MainLayout_Viewer_NeVoitPasLeSousMenuAdmin()
|
|
{
|
|
LoginAs("Viewer");
|
|
Services.GetRequiredService<BunitNavigationManager>()
|
|
.NavigateTo("http://localhost/dashboard");
|
|
|
|
var cut = Render<MainLayout>();
|
|
|
|
cut.Markup.ShouldNotContain("Gestion des utilisateurs");
|
|
cut.Markup.ShouldNotContain("href=\"/users\"");
|
|
cut.Markup.ShouldNotContain("href=\"/admin/agents\"");
|
|
}
|
|
|
|
[Fact]
|
|
public void MainLayout_AfficheLienPersonnes()
|
|
{
|
|
LoginAs();
|
|
Services.GetRequiredService<BunitNavigationManager>()
|
|
.NavigateTo("http://localhost/dashboard");
|
|
|
|
var cut = Render<MainLayout>();
|
|
|
|
cut.Markup.ShouldContain("href=\"/persons\"");
|
|
cut.Markup.ShouldContain("Personnes");
|
|
}
|
|
|
|
[Fact]
|
|
public void MainLayout_SurPagePersonnes_LienActif()
|
|
{
|
|
LoginAs();
|
|
Services.GetRequiredService<BunitNavigationManager>()
|
|
.NavigateTo("http://localhost/persons");
|
|
|
|
var cut = Render<MainLayout>();
|
|
|
|
var link = cut.FindAll(".mud-nav-link").FirstOrDefault(b => b.TextContent.Contains("Personnes"));
|
|
link.ShouldNotBeNull();
|
|
link!.OuterHtml.ShouldContain("active");
|
|
}
|
|
}
|