Skip to content

Commit 0b84bb4

Browse files
authored
Added all tests and sequential test execution. (#1626)
1 parent 40fa2ab commit 0b84bb4

10 files changed

+916
-5
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[assembly: CollectionBehavior(DisableTestParallelization = true)]

Tests/IntegrationTests/IntegrationTests.Worker/CSharp/CSharpCodeTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
using OJS.Workers.Common.Models;
44

5-
public class CSharpCodeTests : BaseStrategyTest<CSharpCodeSubmissionFactory, CSharpCodeParameters>, IClassFixture<RabbitMqAndWorkerFixture>
5+
[Collection(nameof(WorkerTestsCollection))]
6+
public class CSharpCodeTests : BaseStrategyTest<CSharpCodeSubmissionFactory, CSharpCodeParameters>
67
{
78
public CSharpCodeTests(RabbitMqAndWorkerFixture fixture)
89
: base(fixture, new CSharpCodeSubmissionFactory()) { }

Tests/IntegrationTests/IntegrationTests.Worker/RabbitMqAndWorkerFixture.cs

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,9 +239,26 @@ await this.publisherChannel.BasicPublishAsync(
239239

240240
public async Task DisposeAsync()
241241
{
242-
await this.publisherChannel.CloseAsync();
243-
await this.rabbitMqConnection.CloseAsync();
244-
await this.workerContainer.StopAsync();
245-
await this.rabbitMqContainer.StopAsync();
242+
try
243+
{
244+
await this.publisherChannel.CloseAsync();
245+
this.publisherChannel.Dispose();
246+
247+
await this.consumerChannel.CloseAsync();
248+
this.consumerChannel.Dispose();
249+
250+
await this.rabbitMqConnection.CloseAsync();
251+
this.rabbitMqConnection.Dispose();
252+
253+
await this.workerContainer.StopAsync();
254+
await this.workerContainer.DisposeAsync();
255+
256+
await this.rabbitMqContainer.StopAsync();
257+
await this.rabbitMqContainer.DisposeAsync();
258+
}
259+
catch (Exception ex)
260+
{
261+
Console.WriteLine($"Error during cleanup: {ex.Message}");
262+
}
246263
}
247264
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
namespace IntegrationTests.Worker.TypeScript.TypeScriptCodeMochaUnitsTestsNodeJs20;
2+
3+
public record TypeScriptCodeMochaUnitsTestsNodeJs20Parameters(string Code);

Tests/IntegrationTests/IntegrationTests.Worker/TypeScript/TypeScriptCodeMochaUnitsTestsNodeJs20/TypeScriptCodeMochaUnitsTestsNodeJs20SubmissionFactory.cs

Lines changed: 343 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)