Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
126 commits
Select commit Hold shift + click to select a range
8e36f32
chore: remove publish conf from non-package projs
delatrie Jan 1, 2026
35ade37
chore: make packaging explicitly opt-in
delatrie Jan 1, 2026
76edc2e
chore limit signing to public & some test pkgs
delatrie Jan 1, 2026
12be032
feat: enable xmldocs for all packages
delatrie Jan 1, 2026
ccb92a9
chore: remove redundant csproj props
delatrie Jan 1, 2026
9296b52
test: sample generator project
delatrie Jan 1, 2026
fdade19
chore: introduce tests Directory.Build.props
delatrie Jan 1, 2026
1e0dd05
fixup! test: sample generator project
delatrie Jan 1, 2026
796efb9
chore: move TFM to Directory.Build.props for test projects
delatrie Jan 1, 2026
567f4b3
test: Allure.NUnit test project
delatrie Jan 1, 2026
df33037
chore: move TFM to Directory.Build.props for packages
delatrie Jan 2, 2026
045205b
chore: lift default TFM one level higher
delatrie Jan 2, 2026
824f313
test: make sample generator an MSBuild task
delatrie Jan 2, 2026
c82e505
chore: use [MSBuild]::Normalize* functions
delatrie Jan 2, 2026
9238b0a
chore: force packages set TFM explicitly
delatrie Jan 2, 2026
c685950
chore: make nuget repo input required
delatrie Jan 3, 2026
6bf3e88
test: support build sample solutions
delatrie Jan 3, 2026
5e0da94
test: support pre-testing entire sample solution
delatrie Jan 3, 2026
8cf8a9d
chore: clean nunit tests a bit
delatrie Jan 8, 2026
d96248f
chore: use Clean item to remove allure-results
delatrie Jan 8, 2026
4e31eb1
test: make label samples for attributes/facade
delatrie Jan 8, 2026
f08eb38
chore: externalize sample solution path
delatrie Jan 8, 2026
66e0366
test: group samples by prefix
delatrie Jan 8, 2026
c958a69
chore: separete sample run from build
delatrie Jan 8, 2026
181fbc2
chore: add sample cleanup targets
delatrie Jan 8, 2026
ef001b8
chore: mark test projects with IsTestProject
delatrie Jan 8, 2026
be4d0f2
chore: hide Allure.Build.Tasks outputs
delatrie Jan 8, 2026
9f639c5
chore: use correct configuration to build samples
delatrie Jan 8, 2026
3e65055
chore: remove redundant pre-test prop
delatrie Jan 8, 2026
cddb6f1
chore: create source generator project
delatrie Jan 8, 2026
3872adf
chore: separete common xelements from item-specific
delatrie Jan 8, 2026
6102684
chore: implement msbuild prop generator
delatrie Jan 8, 2026
c35ce22
test: set up generation of config from msbuild props
delatrie Jan 8, 2026
eea9aab
test: implement sample registry generator
delatrie Jan 8, 2026
8cd52b6
feat: allow set results-directory from env
delatrie Jan 8, 2026
f898d16
docs: describe AllureSample item
delatrie Jan 8, 2026
907d04b
test: sample runner generator skeleton
delatrie Jan 8, 2026
939e9ee
test: sample runner PoC
delatrie Jan 8, 2026
accc277
test(nunit): system test PoC
delatrie Jan 8, 2026
f5b2dab
test: refactor props and targets
delatrie Jan 9, 2026
a1e5003
test: untie test projects from build tasks dll
delatrie Jan 9, 2026
f6425b6
test: remove rootNamespace from msbuildprops source gen
delatrie Jan 9, 2026
a054e35
chore: fix Allure_SampleResultsDirectoryFormat ref
delatrie Jan 9, 2026
9fda4a5
test: move project path calculation from runner to source gen
delatrie Jan 9, 2026
0b7d4c3
chore: mark msbuild package ref as private
delatrie Jan 9, 2026
58e56b1
test: use roslyn to validate project suffix
delatrie Jan 9, 2026
b83adb3
chore: fix samples pre-build condition
delatrie Jan 9, 2026
c0d2e7c
test: refactor sample generator task
delatrie Jan 9, 2026
735ba25
test: remove unused input from sample task
delatrie Jan 9, 2026
b773c23
test: refactor lambdas in sample gen task
delatrie Jan 9, 2026
1312f68
refactor: simplify props generator
delatrie Jan 9, 2026
578a333
test: use ITaskItem2
delatrie Jan 9, 2026
7ab1c41
test: small fixes of sample xml generation
delatrie Jan 9, 2026
4a358ed
test: add assembly/timestamp to generated xmls
delatrie Jan 9, 2026
049b68c
refactor: use multiline literal in msbuild props generator
delatrie Jan 9, 2026
bbc97a2
test: fix sample dir handling by registry generator
delatrie Jan 9, 2026
3549145
refactor: move generated identifiers to constants
delatrie Jan 9, 2026
22fc495
chore: format test props/targets
delatrie Jan 12, 2026
c8f6088
test: dont remove sample solution dir on clean
delatrie Jan 12, 2026
c70f0a2
test: put run samples target under condition
delatrie Jan 12, 2026
7f190c1
test: allow rebuild samples without building tests
delatrie Jan 12, 2026
a9872b3
test: move sample runner to a separate project
delatrie Jan 12, 2026
e64f627
test: ignore mbuild props that are not valid ids
delatrie Jan 12, 2026
65f9616
test(nunit): use common runner instead of adhoc one
delatrie Jan 12, 2026
3ad35aa
test(nunit): delete ad-hoc runner
delatrie Jan 12, 2026
0320554
test: slightly fix bad suffix warning
delatrie Jan 12, 2026
c9882f4
test: make sample run input easier to create
delatrie Jan 12, 2026
e9598e6
test: order sample run input props alphabetically
delatrie Jan 12, 2026
916f725
test: allow providing explicit allure-results dir
delatrie Jan 12, 2026
614334b
test: fix file/directory guards
delatrie Jan 12, 2026
3ffbafd
test: stop process when cancelled
delatrie Jan 12, 2026
9aa0a0a
test: support sample run timeout
delatrie Jan 12, 2026
a74975a
test: disable aspectinjector for allure.testing
delatrie Jan 12, 2026
9d0f67a
test: support incremental build of samples
delatrie Jan 13, 2026
f6d249f
test: fix missing slnx fle
delatrie Jan 15, 2026
86c1cac
test: improve sample cleaning
delatrie Jan 15, 2026
5893e8b
test: fix solution-wide build/clean
delatrie Jan 15, 2026
d641ca5
test: don't propagate platform to child msbuild
delatrie Jan 15, 2026
3f93685
test: ignore failed samples
delatrie Jan 15, 2026
48deb12
test: guard against running msbuild on non-existing solution
delatrie Jan 15, 2026
99c07ce
test: make Allure.Testing a non-test project
delatrie Jan 15, 2026
81e758a
test: allow running all sample targets on whole solution
delatrie Jan 16, 2026
10da594
test: fix default allure-results path
delatrie Jan 16, 2026
cd67bb4
test: expose allure results directly by runner
delatrie Jan 16, 2026
b534acb
test: implement assertion-only mode
delatrie Jan 16, 2026
bc83737
test: fix target not exists
delatrie Jan 17, 2026
93b960e
test: support testing against nuget packages
delatrie Jan 19, 2026
8b8a2d3
test: create local package repo on build
delatrie Jan 19, 2026
11d1815
test: use local package cache for samples
delatrie Jan 19, 2026
2f6d6f5
chore: using local package cache for solution
delatrie Jan 19, 2026
35692ac
chore: fix styling of msbuild prop defenitions
delatrie Jan 19, 2026
298bc9f
test: fix assertion-only mode
delatrie Jan 19, 2026
6ce1eaa
docs: fix some doc comments
delatrie Jan 19, 2026
7f63c09
test: split nunit label tests into 4
delatrie Jan 19, 2026
65aabc4
test(nunit): disable parallel by default
delatrie Jan 19, 2026
a5b8be6
test(nunit): enable parallel in assertion-only mode
delatrie Jan 19, 2026
39d2c84
chore: remove redundant code
delatrie Jan 19, 2026
f05f7d5
test(nunit): rename label test file
delatrie Jan 19, 2026
98056be
test(nunit): make label tests parameterized
delatrie Jan 19, 2026
02a9643
test: print onyly extra nev vars on error
delatrie Jan 19, 2026
c5023db
test: fix stderr printing
delatrie Jan 19, 2026
75ae7e6
test(nunit): add custom label from teardown test
delatrie Jan 19, 2026
7d9e5e5
test: make sample registry entry a record struct
delatrie Jan 19, 2026
1398f8a
chore: allow running Allure_GenerateTestSamples directly
delatrie Jan 19, 2026
6c77e29
test: add error message if no allure results exist
delatrie Jan 19, 2026
cbbb317
test(nunit): add more label and parameter tests
delatrie Jan 19, 2026
75347d6
test(nunit): run nunit integration tests in ci
delatrie Jan 19, 2026
de9e4a4
test: disable aspect injector in samples by default
delatrie Jan 19, 2026
5e407a1
test(nunit): remove internal keyword from classes
delatrie Jan 19, 2026
b49f8be
test: support sample project specific properties
delatrie Jan 19, 2026
264587e
test(nunit): add step attribute test
delatrie Jan 19, 2026
b3e9819
chore: remove redundant build message
delatrie Jan 19, 2026
d514f6e
chore: fix build in ci
delatrie Jan 19, 2026
af58bc5
chore: fix test run in ci
delatrie Jan 19, 2026
2f246b6
chore: set explicit --no-restore in test ci
delatrie Jan 20, 2026
da00125
test(nunit): test packed NuGet packages in ci
delatrie Jan 20, 2026
90b7391
chore: fix run test samples step in test ci
delatrie Jan 20, 2026
fbbd0b4
test: rename assertion-only mode to pre-run flow
delatrie Jan 20, 2026
f69360f
test: allow one-command pre-run flow
delatrie Jan 20, 2026
0b0f44a
test(nunit): fix sample namespaces
delatrie Jan 20, 2026
3fcfa7a
test: enable parallel run of tests targeted nuget packages
delatrie Jan 20, 2026
7514597
test: limit parallel tests to CPU number
delatrie Jan 21, 2026
69d97d6
test: set resultsDir via config
delatrie Jan 21, 2026
bf9c7f5
test: increase timeout and make it configurable
delatrie Jan 21, 2026
2389af6
Revert "feat: allow set results-directory from env"
delatrie Jan 21, 2026
a1dc32a
chore: remove long comment about AllureSample
delatrie Jan 23, 2026
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
30 changes: 29 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,48 @@ jobs:
run: |
dotnet restore ${{ env.SOLUTION_PATH }}

- name: 'Build project using dotnet'
- name: 'Build solution using dotnet'
run: |
dotnet build ${{ env.SOLUTION_PATH }}\
--no-restore\
--configuration ${{ env.BUILD_CONFIGURATION }}\
-p:Allure_TestTargetVersion=SNAPSHOT\
-p:Allure_PreRunTestingFlow=true

- name: Create NuGet packages
run: |
dotnet pack ${{ env.SOLUTION_PATH }}\
--no-restore\
--no-build\
--configuration ${{ env.BUILD_CONFIGURATION }}

- name: Build test samples
run: |
dotnet msbuild ${{ env.SOLUTION_PATH }}\
-t:Allure_BuildTestSamples\
-p:Allure_SampleConfiguration=${{ env.BUILD_CONFIGURATION }}

- name: 'Run test samples'
run: |
dotnet msbuild ${{ env.SOLUTION_PATH }}\
-t:Allure_RunTestSamples\
-p:Allure_SampleConfiguration=${{ env.BUILD_CONFIGURATION }}

- name: 'Run tests'
run: |
dotnet test ./tests/Allure.Net.Commons.Tests\
--no-restore\
--no-build\
--configuration ${{ env.BUILD_CONFIGURATION }}
dotnet run --project ./tests/Allure.NUnit.Tests\
--no-restore\
--no-build\
--configuration ${{ env.BUILD_CONFIGURATION }}
dotnet test ./tests/Allure.SpecFlow.Tests\
--no-restore\
--no-build\
--configuration ${{ env.BUILD_CONFIGURATION }}
dotnet test ./tests/Allure.Reqnroll.Tests\
--no-restore\
--no-build\
--configuration ${{ env.BUILD_CONFIGURATION }}
14 changes: 11 additions & 3 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,25 @@
<RepositoryType>git</RepositoryType>
</PropertyGroup>

<!-- Common packaging properties -->
<PropertyGroup>
<IsPackable>false</IsPackable>
<WarnOnPackingNonPackableProject>true</WarnOnPackingNonPackableProject>
</PropertyGroup>

<!-- Common build properties -->
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>12</LangVersion>
<CheckEolTargetFramework>false</CheckEolTargetFramework>
<UseArtifactsOutput>true</UseArtifactsOutput>
<ArtifactsPath>$([System.IO.Path]::Combine($(MSBuildThisFileDirectory), 'artifacts'))</ArtifactsPath>
<ArtifactsPath>$([MSBuild]::NormalizeDirectory('$(MSBuildThisFileDirectory)', 'artifacts'))</ArtifactsPath>
</PropertyGroup>

<!-- Signing properties -->
<PropertyGroup>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>$([System.IO.Path]::Combine($(MSBuildThisFileDirectory), 'build', 'identity.snk'))</AssemblyOriginatorKeyFile>
<!-- Signing is opt-in -->
<SignAssembly>false</SignAssembly>
<AssemblyOriginatorKeyFile>$([MSBuild]::NormalizePath('$(MSBuildThisFileDirectory)', 'build', 'identity.snk'))</AssemblyOriginatorKeyFile>
</PropertyGroup>
</Project>
6 changes: 6 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,10 @@
<_InjectionNeeded>true</_InjectionNeeded>
</PropertyGroup>
</Target>

<Target Name="Allure_GenerateTestSamples" />
<Target Name="Allure_BuildTestSamples" />
<Target Name="Allure_RunTestSamples" />
<Target Name="Allure_CleanTestSamples" />
<Target Name="Allure_DeleteTestSamples" />
</Project>
19 changes: 12 additions & 7 deletions allure-csharp.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,21 @@
<Folder Name="/build/">
<File Path="build/findvstool.ps1" />
<File Path="build/TransformReadmeForNuget.cs" />
<Project Path="build/Allure.Build.SourceGenerators/Allure.Build.SourceGenerators.csproj">
<Build Solution="Publish|*" Project="false" />
</Project>
<Project Path="build/Allure.Build.Tasks/Allure.Build.Tasks.csproj">
<Build Solution="Publish|*" Project="false" />
</Project>
</Folder>
<Folder Name="/build/AspectInjector/win-x64/">
<File Path="build/AspectInjector/win-x64/AspectInjector.exe" />
</Folder>
<Folder Name="/examples/">
<Project Path="examples/Allure.NUnit.Examples/Allure.NUnit.Examples.csproj">
<BuildType Solution="Publish|*" Project="Debug" />
<Build Solution="Publish|*" Project="false" />
</Project>
<Project Path="examples/Allure.Xunit.Examples/Allure.Xunit.Examples.csproj">
<BuildType Solution="Publish|*" Project="Debug" />
<Build Solution="Publish|*" Project="false" />
</Project>
</Folder>
Expand Down Expand Up @@ -62,23 +66,24 @@
</Folder>
<Folder Name="/tests/">
<Project Path="tests/Allure.Net.Commons.Tests/Allure.Net.Commons.Tests.csproj">
<BuildType Solution="Publish|*" Project="Debug" />
<Build Solution="Publish|*" Project="false" />
</Project>
<Project Path="tests/Allure.NUnit.Tests/Allure.NUnit.Tests.csproj">
<Build Solution="Publish|*" Project="false" />
</Project>
<Project Path="tests/Allure.Reqnroll.Tests/Allure.Reqnroll.Tests.csproj">
<BuildType Solution="Publish|*" Project="Release" />
<Build Solution="Publish|*" Project="false" />
</Project>
<Project Path="tests/Allure.SpecFlow.Tests.Samples/Allure.SpecFlow.Tests.Samples.csproj">
<BuildType Solution="Publish|*" Project="Debug" />
<Build Solution="Publish|*" Project="false" />
</Project>
<Project Path="tests/Allure.SpecFlow.Tests/Allure.SpecFlow.Tests.csproj">
<BuildType Solution="Publish|*" Project="Debug" />
<Build Solution="Publish|*" Project="false" />
</Project>
<Project Path="tests/Allure.Reqnroll.Tests.Samples/Allure.Reqnroll.Tests.Samples.csproj">
<BuildType Solution="Publish|*" Project="Release" />
<Build Solution="Publish|*" Project="false" />
</Project>
<Project Path="tests/Allure.Testing/Allure.Testing.csproj">
<Build Solution="Publish|*" Project="false" />
</Project>
</Folder>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<IsRoslynComponent>true</IsRoslynComponent>
<IncludeBuildOutput>false</IncludeBuildOutput>
<Nullable>enable</Nullable>
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="5.0.0" PrivateAssets="all" />
</ItemGroup>

</Project>
108 changes: 108 additions & 0 deletions build/Allure.Build.SourceGenerators/AllureMsbuildPropsGenerator.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
using System.Text;
using System.Threading;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.Diagnostics;

namespace Allure.Build.SourceGenerators;

using AllureBuildPropertiesData = ImmutableArray<(string, string)>;

[Generator]
public class AllureMsbuildPropsGenerator : IIncrementalGenerator
{
public void Initialize(IncrementalGeneratorInitializationContext context)
{
var allureMsbuildProps = SetupMsbuildPropsArrayStream(context);

context.RegisterSourceOutput(allureMsbuildProps, GenerateAllureBuildProperties);
}

static IncrementalValueProvider<AllureBuildPropertiesData> SetupMsbuildPropsArrayStream(
IncrementalGeneratorInitializationContext context
) =>
context
.AnalyzerConfigOptionsProvider
.SelectMany(GetExportedAllureProperties)
.Collect();

static IEnumerable<string> GetAllurePropertyNames(AnalyzerConfigOptions options) =>
options.TryGetValue(Constants.EDITOR_PROP_PROPERTY_NAMES, out var value)
? value.Split(':')
: [];

static IEnumerable<(string, string)> GetExportedAllureProperties(
AnalyzerConfigOptionsProvider provider,
CancellationToken _
)
{
var options = provider.GlobalOptions;
foreach (var propertyName in GetAllurePropertyNames(options))
{
var edConfPropertyName = $"build_property.{propertyName}";
if (options.TryGetValue(edConfPropertyName, out var propertyValue))
{
yield return (propertyName, propertyValue);
}
}
}

static void GenerateAllureBuildProperties(
SourceProductionContext productionContext,
AllureBuildPropertiesData data
)
{
var sourceCode = GetAllureBuildPropertiesSourceCode(data);
productionContext.AddSource(Constants.MSBUILD_PROPS_FILENAME, sourceCode);
}

static string GetAllureBuildPropertiesSourceCode(AllureBuildPropertiesData data)
{
var sb = new StringBuilder();
sb.AppendLine($"namespace {Constants.NAMESPACE_NAME};");
sb.AppendLine();
sb.AppendLine($"internal static class {Constants.MSBUILD_PROPS_CLASSNAME}");
sb.AppendLine("{");
AppendClassProperties(sb, data);
sb.AppendLine("}");

return sb.ToString();
}

static void AppendClassProperties(StringBuilder sb, AllureBuildPropertiesData data)
{
if (data.Length > 0)
{
AppendOneClassProperty(sb, data[0]);
}

foreach (var rest in data.Skip(1))
{
sb.AppendLine();
AppendOneClassProperty(sb, rest);
}
}

static void AppendOneClassProperty(StringBuilder sb, (string, string) data)
{
var (key, value) = data;
if (!SyntaxFacts.IsValidIdentifier(key))
{
return;
}

var valueCodeLiteral = SymbolDisplay.FormatLiteral(value, true);

sb.Append(
$$"""
public static string {{ key }} { get; }
= global::System.Environment.GetEnvironmentVariable($"{{ key }}")
?? {{ valueCodeLiteral }};

"""
);
}
}
Loading
Loading