Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 109 additions & 0 deletions src/FlowForge.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "shared", "shared", "{10000000-0000-0000-0000-000000000001}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FlowForge.Shared", "shared\FlowForge.Shared\FlowForge.Shared.csproj", "{F3A4B5C6-D7E8-9012-CDEF-123456789013}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "backend", "backend", "{10000000-0000-0000-0000-000000000002}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FlowForge.Backend.Api", "backend\src\FlowForge.Backend.Api\FlowForge.Backend.Api.csproj", "{A1B2C3D4-E5F6-7890-ABCD-EF1234567890}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FlowForge.Backend.Application", "backend\src\FlowForge.Backend.Application\FlowForge.Backend.Application.csproj", "{D1E2F3A4-B5C6-7890-ABCD-EF1234567891}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FlowForge.Backend.Infrastructure", "backend\src\FlowForge.Backend.Infrastructure\FlowForge.Backend.Infrastructure.csproj", "{E2F3A4B5-C6D7-8901-BCDE-F12345678902}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build-server", "build-server", "{10000000-0000-0000-0000-000000000003}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FlowForge.BuildServer", "build-server\src\FlowForge.BuildServer\FlowForge.BuildServer.csproj", "{B2C3D4E5-F6A7-8901-BCDE-F12345678901}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "monitor-server", "monitor-server", "{10000000-0000-0000-0000-000000000004}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FlowForge.MonitorServer", "monitor-server\src\FlowForge.MonitorServer\FlowForge.MonitorServer.csproj", "{C3D4E5F6-A7B8-9012-CDEF-123456789012}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{10000000-0000-0000-0000-000000000005}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FlowForge.Shared.Tests", "..\test\FlowForge.Shared.Tests\FlowForge.Shared.Tests.csproj", "{20000000-0000-0000-0000-000000000001}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FlowForge.Backend.Api.Tests", "..\test\FlowForge.Backend.Api.Tests\FlowForge.Backend.Api.Tests.csproj", "{20000000-0000-0000-0000-000000000002}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FlowForge.Backend.Application.Tests", "..\test\FlowForge.Backend.Application.Tests\FlowForge.Backend.Application.Tests.csproj", "{20000000-0000-0000-0000-000000000003}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FlowForge.Backend.Infrastructure.Tests", "..\test\FlowForge.Backend.Infrastructure.Tests\FlowForge.Backend.Infrastructure.Tests.csproj", "{20000000-0000-0000-0000-000000000004}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FlowForge.BuildServer.Tests", "..\test\FlowForge.BuildServer.Tests\FlowForge.BuildServer.Tests.csproj", "{20000000-0000-0000-0000-000000000005}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FlowForge.MonitorServer.Tests", "..\test\FlowForge.MonitorServer.Tests\FlowForge.MonitorServer.Tests.csproj", "{20000000-0000-0000-0000-000000000006}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F3A4B5C6-D7E8-9012-CDEF-123456789013}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F3A4B5C6-D7E8-9012-CDEF-123456789013}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F3A4B5C6-D7E8-9012-CDEF-123456789013}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F3A4B5C6-D7E8-9012-CDEF-123456789013}.Release|Any CPU.Build.0 = Release|Any CPU
{A1B2C3D4-E5F6-7890-ABCD-EF1234567890}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A1B2C3D4-E5F6-7890-ABCD-EF1234567890}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A1B2C3D4-E5F6-7890-ABCD-EF1234567890}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A1B2C3D4-E5F6-7890-ABCD-EF1234567890}.Release|Any CPU.Build.0 = Release|Any CPU
{D1E2F3A4-B5C6-7890-ABCD-EF1234567891}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D1E2F3A4-B5C6-7890-ABCD-EF1234567891}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D1E2F3A4-B5C6-7890-ABCD-EF1234567891}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D1E2F3A4-B5C6-7890-ABCD-EF1234567891}.Release|Any CPU.Build.0 = Release|Any CPU
{E2F3A4B5-C6D7-8901-BCDE-F12345678902}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E2F3A4B5-C6D7-8901-BCDE-F12345678902}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E2F3A4B5-C6D7-8901-BCDE-F12345678902}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E2F3A4B5-C6D7-8901-BCDE-F12345678902}.Release|Any CPU.Build.0 = Release|Any CPU
{B2C3D4E5-F6A7-8901-BCDE-F12345678901}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B2C3D4E5-F6A7-8901-BCDE-F12345678901}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B2C3D4E5-F6A7-8901-BCDE-F12345678901}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B2C3D4E5-F6A7-8901-BCDE-F12345678901}.Release|Any CPU.Build.0 = Release|Any CPU
{C3D4E5F6-A7B8-9012-CDEF-123456789012}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C3D4E5F6-A7B8-9012-CDEF-123456789012}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C3D4E5F6-A7B8-9012-CDEF-123456789012}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C3D4E5F6-A7B8-9012-CDEF-123456789012}.Release|Any CPU.Build.0 = Release|Any CPU
{20000000-0000-0000-0000-000000000001}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{20000000-0000-0000-0000-000000000001}.Debug|Any CPU.Build.0 = Debug|Any CPU
{20000000-0000-0000-0000-000000000001}.Release|Any CPU.ActiveCfg = Release|Any CPU
{20000000-0000-0000-0000-000000000001}.Release|Any CPU.Build.0 = Release|Any CPU
{20000000-0000-0000-0000-000000000002}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{20000000-0000-0000-0000-000000000002}.Debug|Any CPU.Build.0 = Debug|Any CPU
{20000000-0000-0000-0000-000000000002}.Release|Any CPU.ActiveCfg = Release|Any CPU
{20000000-0000-0000-0000-000000000002}.Release|Any CPU.Build.0 = Release|Any CPU
{20000000-0000-0000-0000-000000000003}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{20000000-0000-0000-0000-000000000003}.Debug|Any CPU.Build.0 = Debug|Any CPU
{20000000-0000-0000-0000-000000000003}.Release|Any CPU.ActiveCfg = Release|Any CPU
{20000000-0000-0000-0000-000000000003}.Release|Any CPU.Build.0 = Release|Any CPU
{20000000-0000-0000-0000-000000000004}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{20000000-0000-0000-0000-000000000004}.Debug|Any CPU.Build.0 = Debug|Any CPU
{20000000-0000-0000-0000-000000000004}.Release|Any CPU.ActiveCfg = Release|Any CPU
{20000000-0000-0000-0000-000000000004}.Release|Any CPU.Build.0 = Release|Any CPU
{20000000-0000-0000-0000-000000000005}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{20000000-0000-0000-0000-000000000005}.Debug|Any CPU.Build.0 = Debug|Any CPU
{20000000-0000-0000-0000-000000000005}.Release|Any CPU.ActiveCfg = Release|Any CPU
{20000000-0000-0000-0000-000000000005}.Release|Any CPU.Build.0 = Release|Any CPU
{20000000-0000-0000-0000-000000000006}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{20000000-0000-0000-0000-000000000006}.Debug|Any CPU.Build.0 = Debug|Any CPU
{20000000-0000-0000-0000-000000000006}.Release|Any CPU.ActiveCfg = Release|Any CPU
{20000000-0000-0000-0000-000000000006}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{F3A4B5C6-D7E8-9012-CDEF-123456789013} = {10000000-0000-0000-0000-000000000001}
{A1B2C3D4-E5F6-7890-ABCD-EF1234567890} = {10000000-0000-0000-0000-000000000002}
{D1E2F3A4-B5C6-7890-ABCD-EF1234567891} = {10000000-0000-0000-0000-000000000002}
{E2F3A4B5-C6D7-8901-BCDE-F12345678902} = {10000000-0000-0000-0000-000000000002}
{B2C3D4E5-F6A7-8901-BCDE-F12345678901} = {10000000-0000-0000-0000-000000000003}
{C3D4E5F6-A7B8-9012-CDEF-123456789012} = {10000000-0000-0000-0000-000000000004}
{20000000-0000-0000-0000-000000000001} = {10000000-0000-0000-0000-000000000005}
{20000000-0000-0000-0000-000000000002} = {10000000-0000-0000-0000-000000000005}
{20000000-0000-0000-0000-000000000003} = {10000000-0000-0000-0000-000000000005}
{20000000-0000-0000-0000-000000000004} = {10000000-0000-0000-0000-000000000005}
{20000000-0000-0000-0000-000000000005} = {10000000-0000-0000-0000-000000000005}
{20000000-0000-0000-0000-000000000006} = {10000000-0000-0000-0000-000000000005}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>FlowForge.BuildServer</RootNamespace>
<OutputType>Exe</OutputType>
<PlatformTarget>x86</PlatformTarget>
<!-- TODO: Set PlatformTarget to x86 when COM references (EnvDTE, TCatSysManagerLib) are added -->
<!-- <PlatformTarget>x86</PlatformTarget> -->
</PropertyGroup>

<ItemGroup>
Expand Down
Empty file removed test/.gitkeep
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.*" />
<PackageReference Include="xunit" Version="2.*" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.*">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="NSubstitute" Version="5.*" />
<PackageReference Include="FluentAssertions" Version="7.*" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.*" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\backend\src\FlowForge.Backend.Api\FlowForge.Backend.Api.csproj" />
</ItemGroup>

</Project>
22 changes: 22 additions & 0 deletions test/FlowForge.Backend.Api.Tests/HealthControllerTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright (c) 2026 Qubernetic (Biró, Csaba Attila)
// SPDX-License-Identifier: AGPL-3.0-or-later

using FluentAssertions;
using FlowForge.Backend.Api.Controllers;
using Microsoft.AspNetCore.Mvc;
using Xunit;

namespace FlowForge.Backend.Api.Tests;

public class HealthControllerTests
{
[Fact]
public void Get_ShouldReturnOk()
{
var controller = new HealthController();

var result = controller.Get();

result.Should().BeOfType<OkObjectResult>();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright (c) 2026 Qubernetic (Biró, Csaba Attila)
// SPDX-License-Identifier: AGPL-3.0-or-later

using FluentAssertions;
using FlowForge.Backend.Application.Validation;
using FlowForge.Shared.Models.Flow;
using Xunit;

namespace FlowForge.Backend.Application.Tests;

public class FlowDocumentValidatorTests
{
[Fact]
public void Validate_EmptyDocument_ShouldReturnNoErrors()
{
var validator = new FlowDocumentValidator();
var doc = new FlowDocument();

var errors = validator.Validate(doc);

errors.Should().BeEmpty();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.*" />
<PackageReference Include="xunit" Version="2.*" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.*">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="NSubstitute" Version="5.*" />
<PackageReference Include="FluentAssertions" Version="7.*" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\backend\src\FlowForge.Backend.Application\FlowForge.Backend.Application.csproj" />
</ItemGroup>

</Project>
25 changes: 25 additions & 0 deletions test/FlowForge.Backend.Infrastructure.Tests/AppDbContextTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Copyright (c) 2026 Qubernetic (Biró, Csaba Attila)
// SPDX-License-Identifier: AGPL-3.0-or-later

using FluentAssertions;
using FlowForge.Backend.Infrastructure.Persistence;
using Microsoft.EntityFrameworkCore;
using Xunit;

namespace FlowForge.Backend.Infrastructure.Tests;

public class AppDbContextTests
{
[Fact]
public void AppDbContext_ShouldCreateSuccessfully()
{
var options = new DbContextOptionsBuilder<AppDbContext>()
.UseInMemoryDatabase(databaseName: "TestDb")
.Options;

using var context = new AppDbContext(options);

context.Should().NotBeNull();
context.Projects.Should().NotBeNull();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.*" />
<PackageReference Include="xunit" Version="2.*" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.*">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="NSubstitute" Version="5.*" />
<PackageReference Include="FluentAssertions" Version="7.*" />
<PackageReference Include="Testcontainers.PostgreSql" Version="4.*" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="9.0.*" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\backend\src\FlowForge.Backend.Infrastructure\FlowForge.Backend.Infrastructure.csproj" />
</ItemGroup>

</Project>
50 changes: 50 additions & 0 deletions test/FlowForge.BuildServer.Tests/BuildPipelineTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// Copyright (c) 2026 Qubernetic (Biró, Csaba Attila)
// SPDX-License-Identifier: AGPL-3.0-or-later

using FluentAssertions;
using FlowForge.BuildServer.Pipeline;
using FlowForge.Shared.Models.Build;
using Microsoft.Extensions.Logging.Abstractions;
using NSubstitute;
using NSubstitute.ExceptionExtensions;
using Xunit;

namespace FlowForge.BuildServer.Tests;

public class BuildPipelineTests
{
[Fact]
public async Task ExecuteAsync_WithNoSteps_ShouldReturnTrue()
{
var pipeline = new BuildPipeline([], NullLogger<BuildPipeline>.Instance);
var context = new BuildContext
{
Job = new BuildJobDto { Id = Guid.NewGuid() }
};

var result = await pipeline.ExecuteAsync(context, CancellationToken.None);

result.Should().BeTrue();
context.Errors.Should().BeEmpty();
}

[Fact]
public async Task ExecuteAsync_WithFailingStep_ShouldReturnFalse()
{
var failingStep = Substitute.For<IBuildStep>();
failingStep.Name.Returns("FailStep");
failingStep.ExecuteAsync(Arg.Any<BuildContext>(), Arg.Any<CancellationToken>())
.ThrowsAsync(new InvalidOperationException("test error"));

var pipeline = new BuildPipeline([failingStep], NullLogger<BuildPipeline>.Instance);
var context = new BuildContext
{
Job = new BuildJobDto { Id = Guid.NewGuid() }
};

var result = await pipeline.ExecuteAsync(context, CancellationToken.None);

result.Should().BeFalse();
context.Errors.Should().ContainSingle().Which.Should().Contain("test error");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.*" />
<PackageReference Include="xunit" Version="2.*" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.*">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="NSubstitute" Version="5.*" />
<PackageReference Include="FluentAssertions" Version="7.*" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\build-server\src\FlowForge.BuildServer\FlowForge.BuildServer.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.*" />
<PackageReference Include="xunit" Version="2.*" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.*">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="NSubstitute" Version="5.*" />
<PackageReference Include="FluentAssertions" Version="7.*" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\monitor-server\src\FlowForge.MonitorServer\FlowForge.MonitorServer.csproj" />
</ItemGroup>

</Project>
Loading