Skip to content

Commit bbae864

Browse files
committed
updating folder structure from func.e2etests to func.e2e.tests
1 parent c382577 commit bbae864

38 files changed

+69
-122
lines changed

test/Cli/Func.E2ETests/Func.E2ETests.csproj renamed to test/Cli/Func.E2E.Tests/Azure.Functions.Cli.E2E.Tests.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<ItemGroup>
88
<PackageReference Include="FluentAssertions" />
99
<PackageReference Include="Moq" />
10+
<PackageReference Include="StyleCop.Analyzers" />
1011
<PackageReference Include="xunit" />
1112
<PackageReference Include="xunit.runner.visualstudio" />
1213
</ItemGroup>

test/Cli/Func.E2ETests/BaseE2ETests.cs renamed to test/Cli/Func.E2E.Tests/BaseE2ETests.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
// Copyright (c) .NET Foundation. All rights reserved.
2-
// Licensed under the MIT License. See License.txt in the project root for license information.
2+
// Licensed under the MIT License. See LICENSE in the project root for license information.
33

44
using System.Runtime.InteropServices;
55
using Func.TestFramework.Helpers;
66
using Xunit;
77
using Xunit.Abstractions;
88

9-
namespace Func.E2ETests.Commands.FuncStart
9+
namespace Azure.Functions.Cli.E2E.Tests
1010
{
1111
public abstract class BaseE2ETests(ITestOutputHelper log) : IAsyncLifetime
1212
{
13-
protected ITestOutputHelper Log { get; } = log;
13+
protected ITestOutputHelper? Log { get; } = log;
1414

1515
protected string? FuncPath { get; set; } = Environment.GetEnvironmentVariable(Constants.FuncPath);
1616

test/Cli/Func.E2ETests/Commands/FuncStart/AuthTests.cs renamed to test/Cli/Func.E2E.Tests/Commands/FuncStart/AuthTests.cs

+4-15
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,10 @@
88
using Xunit;
99
using Xunit.Abstractions;
1010

11-
namespace Func.E2ETests.Commands.FuncStart
11+
namespace Azure.Functions.Cli.E2E.Tests.Commands.FuncStart
1212
{
13-
public class AuthTests : BaseE2ETests
13+
public class AuthTests(ITestOutputHelper log) : BaseE2ETests(log)
1414
{
15-
public AuthTests(ITestOutputHelper log)
16-
: base(log)
17-
{
18-
}
19-
2015
[Theory]
2116
[InlineData("function", false, "Welcome to Azure Functions!")]
2217
[InlineData("function", true, "")]
@@ -28,8 +23,8 @@ public async Task Start_DotnetIsolated_Test_EnableAuthFeature(
2823
{
2924
int port = ProcessHelper.GetAvailablePort();
3025

31-
string methodName = "Start_DotnetIsolated_Test_EnableAuthFeature";
32-
string uniqueTestName = $"{methodName}_{authLevel}_{enableAuth}";
26+
var methodName = "Start_DotnetIsolated_Test_EnableAuthFeature";
27+
var uniqueTestName = $"{methodName}_{authLevel}_{enableAuth}";
3328

3429
// Call func init and func new
3530
await FuncInitWithRetryAsync(uniqueTestName, new[] { ".", "--worker-runtime", "dotnet-isolated" });
@@ -45,23 +40,17 @@ public async Task Start_DotnetIsolated_Test_EnableAuthFeature(
4540
// Build command arguments based on enableAuth parameter
4641
var commandArgs = new List<string> { "start", "--verbose", "--port", port.ToString() };
4742
if (enableAuth)
48-
{
4943
commandArgs.Add("--enableAuth");
50-
}
5144

5245
var result = funcStartCommand
5346
.WithWorkingDirectory(WorkingDirectory)
5447
.Execute(commandArgs.ToArray());
5548

5649
// Validate expected output content
5750
if (string.IsNullOrEmpty(expectedResult))
58-
{
5951
result.Should().HaveStdOutContaining("\"status\": \"401\"");
60-
}
6152
else
62-
{
6353
result.Should().HaveStdOutContaining("Selected out-of-process host.");
64-
}
6554
}
6655
}
6756
}

test/Cli/Func.E2ETests/Commands/FuncStart/InProcTests.cs renamed to test/Cli/Func.E2E.Tests/Commands/FuncStart/InProcTests.cs

+2-7
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,11 @@
99
using Xunit;
1010
using Xunit.Abstractions;
1111

12-
namespace Func.E2ETests.Commands.FuncStart
12+
namespace Azure.Functions.Cli.E2E.Tests.Commands.FuncStart
1313
{
1414
[Trait(TestTraits.Group, TestTraits.InProc)]
15-
public class InProcTests : BaseE2ETests
15+
public class InProcTests(ITestOutputHelper log) : BaseE2ETests(log)
1616
{
17-
public InProcTests(ITestOutputHelper log)
18-
: base(log)
19-
{
20-
}
21-
2217
[Fact]
2318
[Trait(TestTraits.Group, TestTraits.RequiresNestedInProcArtifacts)]
2419
public async Task Start_InProc_SuccessfulFunctionExecution()

test/Cli/Func.E2ETests/Commands/FuncStart/LogLevelTests.cs renamed to test/Cli/Func.E2E.Tests/Commands/FuncStart/LogLevelTests.cs

+3-8
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,17 @@
22
// Licensed under the MIT License. See License.txt in the project root for license information.
33

44
using FluentAssertions;
5-
using Func.E2ETests.Commands.FuncStart;
5+
using Azure.Functions.Cli.E2E.Tests.Commands.FuncStart;
66
using Func.TestFramework.Assertions;
77
using Func.TestFramework.Commands;
88
using Func.TestFramework.Helpers;
99
using Xunit;
1010
using Xunit.Abstractions;
1111

12-
namespace Func.E2ETests.Commands.FuncStart
12+
namespace Azure.Functions.Cli.E2E.Tests.Commands.FuncStart
1313
{
14-
public class LogLevelTests : BaseE2ETests
14+
public class LogLevelTests(ITestOutputHelper log) : BaseE2ETests(log)
1515
{
16-
public LogLevelTests(ITestOutputHelper log)
17-
: base(log)
18-
{
19-
}
20-
2116
[Fact]
2217
public async Task Start_LanguageWorker_LogLevelOverridenViaSettings_LogLevelSetToExpectedValue()
2318
{

test/Cli/Func.E2ETests/Commands/FuncStart/MissingConfigTests.cs renamed to test/Cli/Func.E2E.Tests/Commands/FuncStart/MissingConfigTests.cs

+14-26
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright (c) .NET Foundation. All rights reserved.
22
// Licensed under the MIT License. See License.txt in the project root for license information.
33

4+
using Azure.Functions.Cli.E2E.Tests;
45
using FluentAssertions;
56
using Func.E2ETests.Traits;
67
using Func.TestFramework.Assertions;
@@ -9,21 +10,16 @@
910
using Xunit;
1011
using Xunit.Abstractions;
1112

12-
namespace Func.E2ETests.Commands.FuncStart
13+
namespace Azure.Functions.Cli.E2E.Tests.Commands.FuncStart
1314
{
14-
public class MissingConfigTests : BaseE2ETests
15+
public class MissingConfigTests(ITestOutputHelper log) : BaseE2ETests(log)
1516
{
16-
public MissingConfigTests(ITestOutputHelper log)
17-
: base(log)
18-
{
19-
}
20-
2117
[Fact]
2218
[Trait(TestTraits.Group, TestTraits.RequiresNestedInProcArtifacts)]
2319
public async Task Start_InProc_InvalidHostJson_FailsWithExpectedError()
2420
{
2521
int port = ProcessHelper.GetAvailablePort();
26-
string testName = "Start_InProc_InvalidHostJson_FailsWithExpectedError";
22+
var testName = "Start_InProc_InvalidHostJson_FailsWithExpectedError";
2723

2824
// Initialize dotnet function app using retry helper
2925
await FuncInitWithRetryAsync(testName, new[] { ".", "--worker-runtime", "dotnet" });
@@ -32,8 +28,8 @@ public async Task Start_InProc_InvalidHostJson_FailsWithExpectedError()
3228
await FuncNewWithRetryAsync(testName, new[] { ".", "--template", "Httptrigger", "--name", "HttpTriggerCSharp" });
3329

3430
// Create invalid host.json
35-
string hostJsonPath = Path.Combine(WorkingDirectory, "host.json");
36-
string hostJsonContent = "{ \"version\": \"2.0\", \"extensionBundle\": { \"id\": \"Microsoft.Azure.Functions.ExtensionBundle\", \"version\": \"[2.*, 3.0.0)\" }}";
31+
var hostJsonPath = Path.Combine(WorkingDirectory, "host.json");
32+
var hostJsonContent = "{ \"version\": \"2.0\", \"extensionBundle\": { \"id\": \"Microsoft.Azure.Functions.ExtensionBundle\", \"version\": \"[2.*, 3.0.0)\" }}";
3733
File.WriteAllText(hostJsonPath, hostJsonContent);
3834

3935
// Call func start
@@ -50,7 +46,7 @@ public async Task Start_InProc_InvalidHostJson_FailsWithExpectedError()
5046
public async Task Start_InProc_MissingHostJson_FailsWithExpectedError()
5147
{
5248
int port = ProcessHelper.GetAvailablePort();
53-
string testName = "Start_InProc_MissingHostJson_FailsWithExpectedError";
49+
var testName = "Start_InProc_MissingHostJson_FailsWithExpectedError";
5450

5551
// Initialize dotnet function app using retry helper
5652
await FuncInitWithRetryAsync(testName, new[] { ".", "--worker-runtime", "dotnet" });
@@ -59,7 +55,7 @@ public async Task Start_InProc_MissingHostJson_FailsWithExpectedError()
5955
await FuncNewWithRetryAsync(testName, new[] { ".", "--template", "Httptrigger", "--name", "HttpTriggerCSharp" });
6056

6157
// Delete host.json
62-
string hostJsonPath = Path.Combine(WorkingDirectory, "host.json");
58+
var hostJsonPath = Path.Combine(WorkingDirectory, "host.json");
6359
File.Delete(hostJsonPath);
6460

6561
// Call func start
@@ -79,12 +75,10 @@ public async Task Start_MissingLocalSettingsJson_BehavesAsExpected(string langua
7975
{
8076
try
8177
{
82-
string methodName = "Start_MissingLocalSettingsJson_BehavesAsExpected";
83-
string logFileName = $"{methodName}_{language}_{runtimeParameter}";
78+
var methodName = "Start_MissingLocalSettingsJson_BehavesAsExpected";
79+
var logFileName = $"{methodName}_{language}_{runtimeParameter}";
8480
if (setRuntimeViaEnvironment)
85-
{
8681
Environment.SetEnvironmentVariable("FUNCTIONS_WORKER_RUNTIME", "dotnet-isolated");
87-
}
8882

8983
int port = ProcessHelper.GetAvailablePort();
9084

@@ -112,29 +106,23 @@ public async Task Start_MissingLocalSettingsJson_BehavesAsExpected(string langua
112106

113107
var startCommand = new List<string> { "--port", port.ToString(), "--verbose" };
114108
if (!string.IsNullOrEmpty(runtimeParameter))
115-
{
116109
startCommand.Add(runtimeParameter);
117-
}
118110

119111
var result = funcStartCommand
120112
.WithWorkingDirectory(WorkingDirectory)
121113
.Execute(startCommand.ToArray());
122114

123115
// Validate output contains expected function URL
124116
if (invokeFunction)
125-
{
126117
result.Should().HaveStdOutContaining("HttpTriggerFunc: [GET,POST] http://localhost:");
127-
}
128118

129119
result.Should().HaveStdOutContaining("Executed 'Functions.HttpTriggerFunc' (Succeeded");
130120
}
131121
finally
132122
{
133123
// Clean up environment variable
134124
if (setRuntimeViaEnvironment)
135-
{
136125
Environment.SetEnvironmentVariable("FUNCTIONS_WORKER_RUNTIME", null);
137-
}
138126
}
139127
}
140128

@@ -143,7 +131,7 @@ public async Task Start_LanguageWorker_InvalidFunctionJson_FailsWithExpectedErro
143131
{
144132
int port = ProcessHelper.GetAvailablePort();
145133
var functionName = "HttpTriggerJS";
146-
string testName = "Start_LanguageWorker_InvalidFunctionJson_FailsWithExpectedError";
134+
var testName = "Start_LanguageWorker_InvalidFunctionJson_FailsWithExpectedError";
147135

148136
// Initialize Node.js function app using retry helper
149137
await FuncInitWithRetryAsync(testName, new[] { ".", "--worker-runtime", "node", "-m", "v3" });
@@ -178,7 +166,7 @@ public async Task Start_LanguageWorker_InvalidFunctionJson_FailsWithExpectedErro
178166
public async Task Start_EmptyEnvVars_HandledAsExpected()
179167
{
180168
int port = ProcessHelper.GetAvailablePort();
181-
string testName = "Start_EmptyEnvVars_HandledAsExpected";
169+
var testName = "Start_EmptyEnvVars_HandledAsExpected";
182170

183171
// Initialize Node.js function app using retry helper
184172
await FuncInitWithRetryAsync(testName, new[] { ".", "--worker-runtime", "node", "-m", "v4" });
@@ -193,8 +181,8 @@ public async Task Start_EmptyEnvVars_HandledAsExpected()
193181
funcSettingsResult.Should().ExitWith(0);
194182

195183
// Modify settings file to have empty value
196-
string settingsPath = Path.Combine(WorkingDirectory, "local.settings.json");
197-
string settingsContent = File.ReadAllText(settingsPath);
184+
var settingsPath = Path.Combine(WorkingDirectory, "local.settings.json");
185+
var settingsContent = File.ReadAllText(settingsPath);
198186
settingsContent = settingsContent.Replace("EMPTY_VALUE", string.Empty);
199187
File.WriteAllText(settingsPath, settingsContent);
200188

test/Cli/Func.E2ETests/Commands/FuncStart/MultipleFunctionsTests.cs renamed to test/Cli/Func.E2E.Tests/Commands/FuncStart/MultipleFunctionsTests.cs

+4-8
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,15 @@
99
using Xunit.Abstractions;
1010
using Xunit;
1111

12-
namespace Func.E2ETests.Commands.FuncStart
12+
namespace Azure.Functions.Cli.E2E.Tests.Commands.FuncStart
1313
{
14-
public class MultipleFunctionsTests : BaseE2ETests
14+
public class MultipleFunctionsTests(ITestOutputHelper log) : BaseE2ETests(log)
1515
{
16-
public MultipleFunctionsTests(ITestOutputHelper log) : base(log)
17-
{
18-
}
19-
2016
[Fact]
2117
public async Task Start_FunctionsStartArgument_OnlySelectedFunctionsRun()
2218
{
2319
int port = ProcessHelper.GetAvailablePort();
24-
string testName = "Start_FunctionsStartArgument_OnlySelectedFunctionsRun";
20+
var testName = "Start_FunctionsStartArgument_OnlySelectedFunctionsRun";
2521

2622
// Initialize JavaScript function app using retry helper
2723
await FuncInitWithRetryAsync(testName, new[] { ".", "--worker-runtime", "javascript" });
@@ -63,4 +59,4 @@ public async Task Start_FunctionsStartArgument_OnlySelectedFunctionsRun()
6359
.Execute(new[] { "--functions", "http2", "http1", "--port", port.ToString() });
6460
}
6561
}
66-
}
62+
}

test/Cli/Func.E2ETests/Commands/FuncStart/TestsWithFixtures/DotnetInProc6Tests.cs renamed to test/Cli/Func.E2E.Tests/Commands/FuncStart/TestsWithFixtures/DotnetInProc6Tests.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
using Xunit;
1111
using Xunit.Abstractions;
1212

13-
namespace Func.E2ETests.Commands.FuncStart.TestsWithFixtures
13+
namespace Azure.Functions.Cli.E2E.Tests.Commands.FuncStart.TestsWithFixtures
1414
{
1515
[Collection("DotnetInProc6")]
1616
[Trait(TestTraits.Group, TestTraits.InProc)]
@@ -155,8 +155,8 @@ public void Start_InProc_InvalidHostJson_FailsWithExpectedError()
155155
CopyDirectoryHelpers.CopyDirectory(_fixture.WorkingDirectory, tempDir);
156156

157157
// Create invalid host.json
158-
string hostJsonPath = Path.Combine(tempDir, "host.json");
159-
string hostJsonContent = "{ \"version\": \"2.0\", \"extensionBundle\": { \"id\": \"Microsoft.Azure.Functions.ExtensionBundle\", \"version\": \"[2.*, 3.0.0)\" }}";
158+
var hostJsonPath = Path.Combine(tempDir, "host.json");
159+
var hostJsonContent = "{ \"version\": \"2.0\", \"extensionBundle\": { \"id\": \"Microsoft.Azure.Functions.ExtensionBundle\", \"version\": \"[2.*, 3.0.0)\" }}";
160160
File.WriteAllText(hostJsonPath, hostJsonContent);
161161

162162
// Call func start

test/Cli/Func.E2ETests/Commands/FuncStart/TestsWithFixtures/DotnetInProc8Tests.cs renamed to test/Cli/Func.E2E.Tests/Commands/FuncStart/TestsWithFixtures/DotnetInProc8Tests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
using Xunit;
1111
using Xunit.Abstractions;
1212

13-
namespace Func.E2ETests.Commands.FuncStart.TestsWithFixtures
13+
namespace Azure.Functions.Cli.E2E.Tests.Commands.FuncStart.TestsWithFixtures
1414
{
1515
[Collection("DotnetInProc8")]
1616
[Trait(TestTraits.Group, TestTraits.InProc)]

test/Cli/Func.E2ETests/Commands/FuncStart/TestsWithFixtures/DotnetIsolatedTests.cs renamed to test/Cli/Func.E2E.Tests/Commands/FuncStart/TestsWithFixtures/DotnetIsolatedTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
using Xunit;
1111
using Xunit.Abstractions;
1212

13-
namespace Func.E2ETests.Commands.FuncStart.TestsWithFixtures
13+
namespace Azure.Functions.Cli.E2E.Tests.Commands.FuncStart.TestsWithFixtures
1414
{
1515
public class DotnetIsolatedTests : IClassFixture<DotnetIsolatedFunctionAppFixture>
1616
{

test/Cli/Func.E2ETests/Commands/FuncStart/TestsWithFixtures/NodeV3Tests.cs renamed to test/Cli/Func.E2E.Tests/Commands/FuncStart/TestsWithFixtures/NodeV3Tests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
using Xunit;
1010
using Xunit.Abstractions;
1111

12-
namespace Func.E2ETests.Commands.FuncStart.TestsWithFixtures
12+
namespace Azure.Functions.Cli.E2E.Tests.Commands.FuncStart.TestsWithFixtures
1313
{
1414
[Collection("NodeV3")]
1515
public class NodeV3Tests : IClassFixture<NodeV3FunctionAppFixture>

test/Cli/Func.E2ETests/Commands/FuncStart/TestsWithFixtures/NodeV4Tests.cs renamed to test/Cli/Func.E2E.Tests/Commands/FuncStart/TestsWithFixtures/NodeV4Tests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
using Xunit;
1212
using Xunit.Abstractions;
1313

14-
namespace Func.E2ETests.Commands.FuncStart.TestsWithFixtures
14+
namespace Azure.Functions.Cli.E2E.Tests.Commands.FuncStart.TestsWithFixtures
1515
{
1616
[Collection("NodeV4")]
1717
public class NodeV4Tests : IClassFixture<NodeV4FunctionAppFixture>

test/Cli/Func.E2ETests/Commands/FuncStart/TestsWithFixtures/PowershellTests.cs renamed to test/Cli/Func.E2E.Tests/Commands/FuncStart/TestsWithFixtures/PowershellTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
using Xunit;
1010
using Xunit.Abstractions;
1111

12-
namespace Func.E2ETests.Commands.FuncStart.TestsWithFixtures
12+
namespace Azure.Functions.Cli.E2E.Tests.Commands.FuncStart.TestsWithFixtures
1313
{
1414
[Collection("Powershell")]
1515
public class PowershellTests : IClassFixture<PowershellFunctionAppFixture>

0 commit comments

Comments
 (0)