Skip to content

Commit d94765a

Browse files
committed
Splitting EndToEnd tests out into their own project
1 parent b413e7f commit d94765a

File tree

298 files changed

+1946
-1060
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

298 files changed

+1946
-1060
lines changed

WebJobs.Script.proj

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,19 +154,28 @@
154154
<Target Name="TestBuild" DependsOnTargets="CheckSkipStrongNames;Build">
155155
<ItemGroup>
156156
<UnitTestProjects Include="test\WebJobs.Script.Tests\WebJobs.Script.Tests.csproj"/>
157+
<IntegrationTestProjects Include="test\WebJobs.Script.Tests.Integration\WebJobs.Script.Tests.Integration.csproj"/>
157158
</ItemGroup>
158159

159160
<MSBuild Projects="@(UnitTestProjects)"
160-
161161
Properties="$(SetConfiguration); $(SetPlatform)"
162162
BuildInParallel="$(BuildInParallel)">
163163
<Output TaskParameter="TargetOutputs" ItemName="UnitTestAssemblies"/>
164164
</MSBuild>
165+
<MSBuild Projects="@(IntegrationTestProjects)"
166+
Properties="$(SetConfiguration); $(SetPlatform)"
167+
BuildInParallel="$(BuildInParallel)">
168+
<Output TaskParameter="TargetOutputs" ItemName="IntegrationTestAssemblies"/>
169+
</MSBuild>
165170
</Target>
166171

167172
<Target Name="UnitTest" DependsOnTargets="TestBuild">
168173
<xunit Assemblies="@(UnitTestAssemblies)" ExcludeTraits="$(ExcludedTestTraits)" />
169174
</Target>
175+
176+
<Target Name="IntegrationTest" DependsOnTargets="TestBuild">
177+
<xunit Assemblies="@(IntegrationTestAssemblies)" ExcludeTraits="$(ExcludedTestTraits)" />
178+
</Target>
170179

171180
<PropertyGroup Condition=" '$(APPVEYOR_API_URL)' != '' ">
172181
<AppveyorModules>mocha-appveyor-reporter</AppveyorModules>
@@ -180,7 +189,7 @@
180189

181190
<Target Name="MochaTest" DependsOnTargets="TestBuild" AfterTargets="UnitTest">
182191
<Exec Command="npm i mocha chai $(AppveyorModules)" />
183-
<Exec Command=".\node_modules\.bin\mocha .\test\WebJobs.Script.Tests\TestScripts\Node\*.tests.js $(AppveyorReporter) --config=$(BuildConfiguration)" />
192+
<Exec Command=".\node_modules\.bin\mocha .\test\WebJobs.Script.Tests.Integration\TestScripts\Node\*.tests.js $(AppveyorReporter) --config=$(BuildConfiguration)" />
184193
</Target>
185194

186195
<Target Name="Clean" DependsOnTargets="GetBinplace">

WebJobs.Script.sln

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,16 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WebHook-Generic-CSharp-Dyna
410410
sample\WebHook-Generic-CSharp-Dynamic\run.csx = sample\WebHook-Generic-CSharp-Dynamic\run.csx
411411
EndProjectSection
412412
EndProject
413+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebJobs.Script.Tests.Integration", "test\WebJobs.Script.Tests.Integration\WebJobs.Script.Tests.Integration.csproj", "{35A2025D-F68A-4B57-83A2-ED4EB9C3894D}"
414+
EndProject
415+
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "WebJobs.Script.Tests.Shared", "test\WebJobs.Script.Tests.Shared\WebJobs.Script.Tests.Shared.shproj", "{35C9CCB7-D8B6-4161-BB0D-BCFA7C6DCFFB}"
416+
EndProject
413417
Global
418+
GlobalSection(SharedMSBuildProjectFiles) = preSolution
419+
test\WebJobs.Script.Tests.Shared\WebJobs.Script.Tests.Shared.projitems*{35a2025d-f68a-4b57-83a2-ed4eb9c3894d}*SharedItemsImports = 4
420+
test\WebJobs.Script.Tests.Shared\WebJobs.Script.Tests.Shared.projitems*{35c9ccb7-d8b6-4161-bb0d-bcfa7c6dcffb}*SharedItemsImports = 13
421+
test\WebJobs.Script.Tests.Shared\WebJobs.Script.Tests.Shared.projitems*{38c609d3-b126-43b0-b9d8-6d62faee2abc}*SharedItemsImports = 4
422+
EndGlobalSection
414423
GlobalSection(SolutionConfigurationPlatforms) = preSolution
415424
Debug|Any CPU = Debug|Any CPU
416425
Release|Any CPU = Release|Any CPU
@@ -440,6 +449,10 @@ Global
440449
{479B0873-CBDC-4AE9-85BA-DD6CF2DCA29D}.Debug|Any CPU.Build.0 = Debug|Any CPU
441450
{479B0873-CBDC-4AE9-85BA-DD6CF2DCA29D}.Release|Any CPU.ActiveCfg = Release|Any CPU
442451
{479B0873-CBDC-4AE9-85BA-DD6CF2DCA29D}.Release|Any CPU.Build.0 = Release|Any CPU
452+
{35A2025D-F68A-4B57-83A2-ED4EB9C3894D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
453+
{35A2025D-F68A-4B57-83A2-ED4EB9C3894D}.Debug|Any CPU.Build.0 = Debug|Any CPU
454+
{35A2025D-F68A-4B57-83A2-ED4EB9C3894D}.Release|Any CPU.ActiveCfg = Release|Any CPU
455+
{35A2025D-F68A-4B57-83A2-ED4EB9C3894D}.Release|Any CPU.Build.0 = Release|Any CPU
443456
EndGlobalSection
444457
GlobalSection(SolutionProperties) = preSolution
445458
HideSolutionNode = FALSE
@@ -514,5 +527,7 @@ Global
514527
{EF36E33B-646C-4EF4-B0E2-517E14F6DC38} = {FF9C0818-30D3-437A-A62D-7A61CA44F459}
515528
{98DBDE0D-364C-4865-9A4A-B17410D771F6} = {FF9C0818-30D3-437A-A62D-7A61CA44F459}
516529
{2F6EF597-6586-4F59-BBB6-BA7146FEFD27} = {FF9C0818-30D3-437A-A62D-7A61CA44F459}
530+
{35A2025D-F68A-4B57-83A2-ED4EB9C3894D} = {FD93A1ED-5AC4-4F9B-9087-E1C24320F36E}
531+
{35C9CCB7-D8B6-4161-BB0D-BCFA7C6DCFFB} = {FD93A1ED-5AC4-4F9B-9087-E1C24320F36E}
517532
EndGlobalSection
518533
EndGlobal

src/WebJobs.Script.Extensibility/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@
1313
// The following GUID is for the ID of the typelib if this project is exposed to COM
1414
[assembly: Guid("479b0873-cbdc-4ae9-85ba-dd6cf2dca29d")]
1515

16-
[assembly: InternalsVisibleTo("Microsoft.Azure.WebJobs.Script.Tests")]
16+
[assembly: InternalsVisibleTo("Microsoft.Azure.WebJobs.Script.Tests")]
17+
[assembly: InternalsVisibleTo("Microsoft.Azure.WebJobs.Script.Tests.Integration")]

src/WebJobs.Script.WebHost/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@
1919
[assembly: Guid("63c9b2f4-f122-4acc-968f-9b8f0880a72f")]
2020

2121
[assembly: InternalsVisibleTo("Microsoft.Azure.WebJobs.Script.Tests")]
22+
[assembly: InternalsVisibleTo("Microsoft.Azure.WebJobs.Script.Tests.Integration")]
2223
[assembly: NeutralResourcesLanguage("en-US")]

src/WebJobs.Script/Config/ScriptSettingsManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public class ScriptSettingsManager
1111
private static ScriptSettingsManager _instance = new ScriptSettingsManager();
1212
private readonly ConcurrentDictionary<string, string> _settingsCache = new ConcurrentDictionary<string, string>();
1313

14-
protected ScriptSettingsManager()
14+
internal ScriptSettingsManager()
1515
{
1616
}
1717

src/WebJobs.Script/Extensions/FileUtility.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
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 System;
5-
using System.Collections.Generic;
64
using System.IO;
7-
using System.Linq;
8-
using System.Text;
95
using System.Threading.Tasks;
106

117
namespace Microsoft.Azure.WebJobs.Script
128
{
139
public static class FileUtility
1410
{
11+
public static void EnsureDirectoryExists(string path)
12+
{
13+
if (!Directory.Exists(path))
14+
{
15+
Directory.CreateDirectory(path);
16+
}
17+
}
18+
1519
public static Task DeleteDirectoryAsync(string path, bool recursive)
1620
{
1721
return Task.Run(() =>

src/WebJobs.Script/Host/ScriptHost.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ internal void AddFunctionError(string functionName, string error, bool isFunctio
187187
protected virtual void Initialize()
188188
{
189189
string hostLogPath = Path.Combine(ScriptConfig.RootLogPath, "Host");
190+
FileUtility.EnsureDirectoryExists(hostLogPath);
190191
string debugSentinelFileName = Path.Combine(hostLogPath, ScriptConstants.DebugSentinelFileName);
191192
this.LastDebugNotify = File.GetLastWriteTime(debugSentinelFileName);
192193

src/WebJobs.Script/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@
1919
// The following GUID is for the ID of the typelib if this project is exposed to COM
2020
[assembly: Guid("1dc670cd-f42f-4d8f-97bd-0e1aa8221094")]
2121

22-
[assembly: InternalsVisibleTo("Microsoft.Azure.WebJobs.Script.Tests")]
22+
[assembly: InternalsVisibleTo("Microsoft.Azure.WebJobs.Script.Tests")]
23+
[assembly: InternalsVisibleTo("Microsoft.Azure.WebJobs.Script.Tests.Integration")]

test/WebJobs.Script.Tests/ApiHub/ApiHubTestHelper.cs renamed to test/WebJobs.Script.Tests.Integration/ApiHub/ApiHubTestHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
using Microsoft.Azure.WebJobs.Script.Config;
1111
using Xunit;
1212

13-
namespace Microsoft.Azure.WebJobs.Script.Tests.ApiHub
13+
namespace Microsoft.Azure.WebJobs.Script.Tests
1414
{
1515
public static class ApiHubTestHelper
1616
{

test/WebJobs.Script.Tests/ApiHub/FakeTabularConnectorAdapter.cs renamed to test/WebJobs.Script.Tests.Integration/ApiHub/FakeTabularConnectorAdapter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
using Microsoft.Azure.ApiHub.Table.Internal;
1010
using Newtonsoft.Json.Linq;
1111

12-
namespace Microsoft.Azure.WebJobs.Script.Tests.ApiHub
12+
namespace Microsoft.Azure.WebJobs.Script.Tests
1313
{
1414
internal class FakeTabularConnectorAdapter : ITabularConnectorAdapter
1515
{

0 commit comments

Comments
 (0)