Skip to content

Commit

Permalink
Remove storage from Allure.Net.Commons
Browse files Browse the repository at this point in the history
  • Loading branch information
delatrie committed Mar 28, 2024
1 parent 7e89b86 commit 0a561ad
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 43 deletions.
7 changes: 0 additions & 7 deletions Allure.Net.Commons/AllureLifecycle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System.Threading;
using Allure.Net.Commons.Configuration;
using Allure.Net.Commons.Functions;
using Allure.Net.Commons.Storage;
using Allure.Net.Commons.TestPlan;
using Allure.Net.Commons.Writer;
using Newtonsoft.Json.Linq;
Expand Down Expand Up @@ -39,7 +38,6 @@ public class AllureLifecycle
public IReadOnlyDictionary<Type, ITypeFormatter> TypeFormatters =>
new ReadOnlyDictionary<Type, ITypeFormatter>(typeFormatters);

readonly AllureStorage storage;
readonly AsyncLocal<AllureContext> context = new();

readonly Lazy<AllureTestPlan> lazyTestPlan;
Expand Down Expand Up @@ -102,7 +100,6 @@ Func<AllureTestPlan> testPlanFactory
JsonConfiguration = config.ToString();
AllureConfiguration = AllureConfiguration.ReadFromJObject(config);
writer = writerFactory(AllureConfiguration);
storage = new AllureStorage();
lazyTestPlan = new(testPlanFactory);
}

Expand Down Expand Up @@ -216,7 +213,6 @@ TestResultContainer container
)
{
container.start = DateTimeOffset.Now.ToUnixTimeMilliseconds();
this.storage.Put(container.uuid, container);
this.UpdateContext(c => c.WithContainer(container));
return this;
}
Expand Down Expand Up @@ -267,7 +263,6 @@ public virtual AllureLifecycle StopTestContainer()
public virtual AllureLifecycle WriteTestContainer()
{
var container = this.Context.CurrentContainer;
this.storage.Remove<TestResultContainer>(container.uuid);
this.UpdateContext(c => c.WithNoLastContainer());
this.writer.Write(container);
return this;
Expand Down Expand Up @@ -393,7 +388,6 @@ public virtual AllureLifecycle ScheduleTestCase(TestResult testResult)
container.children.Add(uuid);
}
}
this.storage.Put(uuid, testResult);
this.UpdateContext(c => c.WithTestContext(testResult));
return this;
}
Expand Down Expand Up @@ -485,7 +479,6 @@ public virtual AllureLifecycle WriteTestCase()
{
uuid = testResult.uuid;
}
this.storage.Remove<TestResult>(uuid);
this.UpdateContext(c => c.WithNoTestContext());
this.writer.Write(testResult);
return this;
Expand Down
27 changes: 0 additions & 27 deletions Allure.Net.Commons/Storage/AllureStorage.cs

This file was deleted.

8 changes: 0 additions & 8 deletions Allure.Net.Commons/Storage/ITestResultAccessor.cs

This file was deleted.

7 changes: 6 additions & 1 deletion Allure.XUnit/AllureXunitHelper.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using Allure.Net.Commons;
using Allure.Net.Commons.Functions;
using Allure.Net.Commons.Storage;
using Allure.Xunit.Attributes;
using Allure.XUnit;
using Allure.XUnit.Attributes;
Expand All @@ -19,6 +18,12 @@ namespace Allure.Xunit
{
public static class AllureXunitHelper
{
internal interface ITestResultAccessor
{
TestResultContainer TestResultContainer { get; set; }
TestResult TestResult { get; set; }
}

internal static List<Type> ExceptionTypes = new()
{
typeof(XunitException)
Expand Down

0 comments on commit 0a561ad

Please sign in to comment.