Skip to content

Commit 0fd6575

Browse files
committed
Move snapshots to directory
1 parent a6da55f commit 0fd6575

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
4+
using System.Runtime.CompilerServices;
5+
using Aspire.TestUtilities;
6+
7+
namespace Aspire.Hosting.Azure.Tests;
8+
9+
sealed class TestModuleInitializer
10+
{
11+
[ModuleInitializer]
12+
internal static void Setup()
13+
{
14+
// Set the directory for all Verify calls in test projects
15+
var target = PlatformDetection.IsRunningOnHelix
16+
? Path.Combine(Environment.GetEnvironmentVariable("HELIX_CORRELATION_PAYLOAD")!, "Snapshots")
17+
: "Snapshots";
18+
19+
// If target contains an absolute path it will use it as is.
20+
// If it contains a relative path, it will be combined with the project directory.
21+
DerivePathInfo(
22+
(sourceFile, projectDirectory, type, method) => new(
23+
directory: Path.Combine(projectDirectory, target),
24+
typeName: type.Name,
25+
methodName: method.Name));
26+
}
27+
}

0 commit comments

Comments
 (0)