Skip to content

Use Path.GetTempPath to ensure IO happens Windows/Linux temp folder #7346

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

using System;
using System.IO;
using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
using NServiceBus;
using NServiceBus.Outbox;
using NServiceBus.Sagas;
using NUnit.Framework;
using Persistence;

public partial class PersistenceTestsConfiguration
Expand All @@ -32,7 +34,7 @@ public Task Configure(CancellationToken cancellationToken = default)
SagaIdGenerator = new LearningSagaIdGenerator();

var sagaManifests = new SagaManifestCollection(SagaMetadataCollection,
Path.Combine(AppDomain.CurrentDomain.BaseDirectory, ".sagas"),
Path.Combine(Path.GetTempPath(), ".sagas", TestContext.CurrentContext.Test.ID),
name => DeterministicGuid.Create(name).ToString());

SagaStorage = new LearningSagaPersister(sagaManifests);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
using System;
using System.IO;
using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
using NServiceBus;
using NServiceBus.Transport;
using NServiceBus.TransportTests;
using NUnit.Framework;

class ConfigureLearningTransportInfrastructure : IConfigureTransportInfrastructure
{
public TransportDefinition CreateTransportDefinition()
{
storageDir = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, ".transporttests");
storageDir = Path.Combine(Path.GetTempPath(), ".transporttests", TestContext.CurrentContext.Test.ID);

return new LearningTransport
{
StorageDirectory = storageDir,
Expand Down