Fix tests and disable scm environment variable injection (#148)
This commit is contained in:
parent
183f476492
commit
730a744dbb
|
|
@ -4,40 +4,40 @@
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Label="Package Versions">
|
<PropertyGroup Label="Package Versions">
|
||||||
<InternalAspNetCoreSdkPackageVersion>2.1.0-preview1-1010</InternalAspNetCoreSdkPackageVersion>
|
<InternalAspNetCoreSdkPackageVersion>2.1.0-preview1-1010</InternalAspNetCoreSdkPackageVersion>
|
||||||
<InternalAspNetCoreSiteExtensionSdkPackageVersion>2.1.0-preview2-15684</InternalAspNetCoreSiteExtensionSdkPackageVersion>
|
<InternalAspNetCoreSiteExtensionSdkPackageVersion>2.1.0-preview1-1015</InternalAspNetCoreSiteExtensionSdkPackageVersion>
|
||||||
<MicrosoftApplicationInsightsAspNetCorePackageVersion>2.1.1</MicrosoftApplicationInsightsAspNetCorePackageVersion>
|
<MicrosoftApplicationInsightsAspNetCorePackageVersion>2.1.1</MicrosoftApplicationInsightsAspNetCorePackageVersion>
|
||||||
<MicrosoftAspNetCoreAspNetCoreModulePackageVersion>2.1.0-preview1-28193</MicrosoftAspNetCoreAspNetCoreModulePackageVersion>
|
<MicrosoftAspNetCoreAspNetCoreModulePackageVersion>2.1.0-preview1-28274</MicrosoftAspNetCoreAspNetCoreModulePackageVersion>
|
||||||
<MicrosoftAspNetCoreAzureAppServicesHostingStartupPackageVersion>2.1.0-preview1-28193</MicrosoftAspNetCoreAzureAppServicesHostingStartupPackageVersion>
|
<MicrosoftAspNetCoreAzureAppServicesHostingStartupPackageVersion>2.1.0-preview1-28274</MicrosoftAspNetCoreAzureAppServicesHostingStartupPackageVersion>
|
||||||
<MicrosoftAspNetCoreAzureKeyVaultHostingStartupPackageVersion>2.1.0-preview1-28193</MicrosoftAspNetCoreAzureKeyVaultHostingStartupPackageVersion>
|
<MicrosoftAspNetCoreAzureKeyVaultHostingStartupPackageVersion>2.1.0-preview1-28274</MicrosoftAspNetCoreAzureKeyVaultHostingStartupPackageVersion>
|
||||||
<MicrosoftAspNetCoreDataProtectionAzureKeyVaultPackageVersion>2.1.0-preview1-28193</MicrosoftAspNetCoreDataProtectionAzureKeyVaultPackageVersion>
|
<MicrosoftAspNetCoreDataProtectionAzureKeyVaultPackageVersion>2.1.0-preview1-28274</MicrosoftAspNetCoreDataProtectionAzureKeyVaultPackageVersion>
|
||||||
<MicrosoftAspNetCoreHostingAbstractionsPackageVersion>2.1.0-preview1-28193</MicrosoftAspNetCoreHostingAbstractionsPackageVersion>
|
<MicrosoftAspNetCoreHostingAbstractionsPackageVersion>2.1.0-preview1-28274</MicrosoftAspNetCoreHostingAbstractionsPackageVersion>
|
||||||
<MicrosoftAspNetCoreHostingPackageVersion>2.1.0-preview1-28193</MicrosoftAspNetCoreHostingPackageVersion>
|
<MicrosoftAspNetCoreHostingPackageVersion>2.1.0-preview1-28274</MicrosoftAspNetCoreHostingPackageVersion>
|
||||||
<MicrosoftAspNetCoreMvcPackageVersion>2.1.0-preview1-28193</MicrosoftAspNetCoreMvcPackageVersion>
|
<MicrosoftAspNetCoreMvcPackageVersion>2.1.0-preview1-28274</MicrosoftAspNetCoreMvcPackageVersion>
|
||||||
<MicrosoftAspNetCoreRazorRuntimePackageVersion>2.1.0-preview1-28193</MicrosoftAspNetCoreRazorRuntimePackageVersion>
|
<MicrosoftAspNetCoreRazorRuntimePackageVersion>2.1.0-preview1-28274</MicrosoftAspNetCoreRazorRuntimePackageVersion>
|
||||||
<MicrosoftAspNetCoreServerIISIntegrationPackageVersion>2.1.0-preview1-28193</MicrosoftAspNetCoreServerIISIntegrationPackageVersion>
|
<MicrosoftAspNetCoreServerIISIntegrationPackageVersion>2.1.0-preview1-28274</MicrosoftAspNetCoreServerIISIntegrationPackageVersion>
|
||||||
<MicrosoftAspNetCoreServerIntegrationTestingPackageVersion>0.5.0-preview1-28193</MicrosoftAspNetCoreServerIntegrationTestingPackageVersion>
|
<MicrosoftAspNetCoreServerIntegrationTestingPackageVersion>0.5.0-preview1-28274</MicrosoftAspNetCoreServerIntegrationTestingPackageVersion>
|
||||||
<MicrosoftAspNetCoreServerKestrelPackageVersion>2.1.0-preview1-28193</MicrosoftAspNetCoreServerKestrelPackageVersion>
|
<MicrosoftAspNetCoreServerKestrelPackageVersion>2.1.0-preview1-28274</MicrosoftAspNetCoreServerKestrelPackageVersion>
|
||||||
<MicrosoftAspNetCoreTestHostPackageVersion>2.1.0-preview1-28193</MicrosoftAspNetCoreTestHostPackageVersion>
|
<MicrosoftAspNetCoreTestHostPackageVersion>2.1.0-preview1-28274</MicrosoftAspNetCoreTestHostPackageVersion>
|
||||||
<MicrosoftAzureManagementFluentPackageVersion>1.1.3</MicrosoftAzureManagementFluentPackageVersion>
|
<MicrosoftAzureManagementFluentPackageVersion>1.1.3</MicrosoftAzureManagementFluentPackageVersion>
|
||||||
<MicrosoftAzureServicesAppAuthenticationPackageVersion>1.1.0-preview</MicrosoftAzureServicesAppAuthenticationPackageVersion>
|
<MicrosoftAzureServicesAppAuthenticationPackageVersion>1.1.0-preview</MicrosoftAzureServicesAppAuthenticationPackageVersion>
|
||||||
<MicrosoftExtensionsConfigurationAzureKeyVaultPackageVersion>2.1.0-preview1-28193</MicrosoftExtensionsConfigurationAzureKeyVaultPackageVersion>
|
<MicrosoftExtensionsConfigurationAzureKeyVaultPackageVersion>2.1.0-preview1-28274</MicrosoftExtensionsConfigurationAzureKeyVaultPackageVersion>
|
||||||
<MicrosoftExtensionsConfigurationCommandLinePackageVersion>2.1.0-preview1-28193</MicrosoftExtensionsConfigurationCommandLinePackageVersion>
|
<MicrosoftExtensionsConfigurationCommandLinePackageVersion>2.1.0-preview1-28274</MicrosoftExtensionsConfigurationCommandLinePackageVersion>
|
||||||
<MicrosoftExtensionsConfigurationEnvironmentVariablesPackageVersion>2.1.0-preview1-28193</MicrosoftExtensionsConfigurationEnvironmentVariablesPackageVersion>
|
<MicrosoftExtensionsConfigurationEnvironmentVariablesPackageVersion>2.1.0-preview1-28274</MicrosoftExtensionsConfigurationEnvironmentVariablesPackageVersion>
|
||||||
<MicrosoftExtensionsConfigurationJsonPackageVersion>2.1.0-preview1-28193</MicrosoftExtensionsConfigurationJsonPackageVersion>
|
<MicrosoftExtensionsConfigurationJsonPackageVersion>2.1.0-preview1-28274</MicrosoftExtensionsConfigurationJsonPackageVersion>
|
||||||
<MicrosoftExtensionsDiagnosticAdapterPackageVersion>2.1.0-preview1-28193</MicrosoftExtensionsDiagnosticAdapterPackageVersion>
|
<MicrosoftExtensionsDiagnosticAdapterPackageVersion>2.1.0-preview1-28274</MicrosoftExtensionsDiagnosticAdapterPackageVersion>
|
||||||
<MicrosoftExtensionsLoggingAzureAppServicesPackageVersion>2.1.0-preview1-28193</MicrosoftExtensionsLoggingAzureAppServicesPackageVersion>
|
<MicrosoftExtensionsLoggingAzureAppServicesPackageVersion>2.1.0-preview1-28274</MicrosoftExtensionsLoggingAzureAppServicesPackageVersion>
|
||||||
<MicrosoftExtensionsLoggingConfigurationPackageVersion>2.1.0-preview1-28193</MicrosoftExtensionsLoggingConfigurationPackageVersion>
|
<MicrosoftExtensionsLoggingConfigurationPackageVersion>2.1.0-preview1-28274</MicrosoftExtensionsLoggingConfigurationPackageVersion>
|
||||||
<MicrosoftExtensionsLoggingConsolePackageVersion>2.1.0-preview1-28193</MicrosoftExtensionsLoggingConsolePackageVersion>
|
<MicrosoftExtensionsLoggingConsolePackageVersion>2.1.0-preview1-28274</MicrosoftExtensionsLoggingConsolePackageVersion>
|
||||||
<MicrosoftExtensionsLoggingPackageVersion>2.1.0-preview1-28193</MicrosoftExtensionsLoggingPackageVersion>
|
<MicrosoftExtensionsLoggingPackageVersion>2.1.0-preview1-28274</MicrosoftExtensionsLoggingPackageVersion>
|
||||||
<MicrosoftExtensionsLoggingTestingPackageVersion>2.1.0-preview1-28193</MicrosoftExtensionsLoggingTestingPackageVersion>
|
<MicrosoftExtensionsLoggingTestingPackageVersion>2.1.0-preview1-28274</MicrosoftExtensionsLoggingTestingPackageVersion>
|
||||||
<MicrosoftExtensionsProcessSourcesPackageVersion>2.1.0-preview1-28193</MicrosoftExtensionsProcessSourcesPackageVersion>
|
<MicrosoftExtensionsProcessSourcesPackageVersion>2.1.0-preview1-28274</MicrosoftExtensionsProcessSourcesPackageVersion>
|
||||||
<MicrosoftNETCoreApp20PackageVersion>2.0.0</MicrosoftNETCoreApp20PackageVersion>
|
<MicrosoftNETCoreApp20PackageVersion>2.0.0</MicrosoftNETCoreApp20PackageVersion>
|
||||||
<MicrosoftNETCoreApp21PackageVersion>2.1.0-preview1-26122-01</MicrosoftNETCoreApp21PackageVersion>
|
<MicrosoftNETCoreApp21PackageVersion>2.1.0-preview1-26208-06</MicrosoftNETCoreApp21PackageVersion>
|
||||||
<MicrosoftNETTestSdkPackageVersion>15.3.0</MicrosoftNETTestSdkPackageVersion>
|
<MicrosoftNETTestSdkPackageVersion>15.3.0</MicrosoftNETTestSdkPackageVersion>
|
||||||
<MicrosoftWebXdtPackageVersion>1.4.0</MicrosoftWebXdtPackageVersion>
|
<MicrosoftWebXdtPackageVersion>1.4.0</MicrosoftWebXdtPackageVersion>
|
||||||
<MoqPackageVersion>4.7.49</MoqPackageVersion>
|
<MoqPackageVersion>4.7.49</MoqPackageVersion>
|
||||||
<NewtonsoftJsonPackageVersion>10.0.1</NewtonsoftJsonPackageVersion>
|
<NewtonsoftJsonPackageVersion>10.0.1</NewtonsoftJsonPackageVersion>
|
||||||
<SystemReflectionMetadataPackageVersion>1.6.0-preview1-26119-06</SystemReflectionMetadataPackageVersion>
|
<SystemReflectionMetadataPackageVersion>1.6.0-preview1-26208-08</SystemReflectionMetadataPackageVersion>
|
||||||
<WindowsAzureStoragePackageVersion>8.1.4</WindowsAzureStoragePackageVersion>
|
<WindowsAzureStoragePackageVersion>8.1.4</WindowsAzureStoragePackageVersion>
|
||||||
<XunitPackageVersion>2.3.1</XunitPackageVersion>
|
<XunitPackageVersion>2.3.1</XunitPackageVersion>
|
||||||
<XunitRunnerVisualStudioPackageVersion>2.3.1</XunitRunnerVisualStudioPackageVersion>
|
<XunitRunnerVisualStudioPackageVersion>2.3.1</XunitRunnerVisualStudioPackageVersion>
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="applicationHost.xdt" />
|
<Content Include="applicationHost.xdt" />
|
||||||
|
<Content Include="scmApplicationHost.xdt" />
|
||||||
<Content Include="bin\$(Configuration)\$(TargetFramework)\Microsoft.Web.Xdt.Extensions.dll" PackagePath="content" />
|
<Content Include="bin\$(Configuration)\$(TargetFramework)\Microsoft.Web.Xdt.Extensions.dll" PackagePath="content" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
|
||||||
|
<!-- This file exists to prevent applicationHost.xdt from being applied to scm host that runs
|
||||||
|
other dotnet processes (dotnet build, csc etc. )-->
|
||||||
|
</configuration>
|
||||||
|
|
@ -11,6 +11,8 @@ namespace Microsoft.AspNetCore.AzureAppServices.SiteExtension
|
||||||
{
|
{
|
||||||
public class TransformTest
|
public class TransformTest
|
||||||
{
|
{
|
||||||
|
private static readonly string XdtExtensionPath = AppDomain.CurrentDomain.BaseDirectory;
|
||||||
|
|
||||||
[Theory]
|
[Theory]
|
||||||
[InlineData("config_empty.xml")]
|
[InlineData("config_empty.xml")]
|
||||||
[InlineData("config_existingline.xml")]
|
[InlineData("config_existingline.xml")]
|
||||||
|
|
@ -24,18 +26,25 @@ namespace Microsoft.AspNetCore.AzureAppServices.SiteExtension
|
||||||
|
|
||||||
Assert.NotNull(envNode);
|
Assert.NotNull(envNode);
|
||||||
|
|
||||||
Assert.Equal(2, envNode.ChildNodes.Count);
|
Assert.Equal(3, envNode.ChildNodes.Count);
|
||||||
|
|
||||||
var firstChild = envNode.FirstChild;
|
var depsElement = envNode.FirstChild;
|
||||||
Assert.Equal("add", firstChild.Name);
|
Assert.Equal("add", depsElement.Name);
|
||||||
Assert.Equal("DOTNET_ADDITIONAL_DEPS", firstChild.Attributes["name"].Value);
|
Assert.Equal("DOTNET_ADDITIONAL_DEPS", depsElement.Attributes["name"].Value);
|
||||||
Assert.Equal(@"%ProgramFiles%\dotnet\additionalDeps\Microsoft.AspNetCore.AzureAppServices.HostingStartup\",
|
Assert.Equal($@"{XdtExtensionPath}\additionalDeps\Microsoft.AspNetCore.AzureAppServices.HostingStartup\;" +
|
||||||
firstChild.Attributes["value"].Value);
|
$@"{XdtExtensionPath}\additionalDeps\Microsoft.AspNetCore.AzureKeyVault.HostingStartup\;" +
|
||||||
|
@"%ProgramFiles%\dotnet\additionalDeps\Microsoft.AspNetCore.AzureAppServices.HostingStartup\",
|
||||||
|
depsElement.Attributes["value"].Value);
|
||||||
|
|
||||||
var secondChild = firstChild.NextSibling;
|
var sharedStoreElement = depsElement.NextSibling;
|
||||||
Assert.Equal("add", secondChild.Name);
|
Assert.Equal("add", sharedStoreElement.Name);
|
||||||
Assert.Equal("ASPNETCORE_HOSTINGSTARTUPASSEMBLIES", secondChild.Attributes["name"].Value);
|
Assert.Equal("DOTNET_SHARED_STORE", sharedStoreElement.Attributes["name"].Value);
|
||||||
Assert.Equal("Microsoft.AspNetCore.AzureAppServices.HostingStartup", secondChild.Attributes["value"].Value);
|
Assert.Equal($@"{XdtExtensionPath}\store", sharedStoreElement.Attributes["value"].Value);
|
||||||
|
|
||||||
|
var startupAssembliesElement = sharedStoreElement.NextSibling;
|
||||||
|
Assert.Equal("add", startupAssembliesElement.Name);
|
||||||
|
Assert.Equal("ASPNETCORE_HOSTINGSTARTUPASSEMBLIES", startupAssembliesElement.Attributes["name"].Value);
|
||||||
|
Assert.Equal("Microsoft.AspNetCore.AzureAppServices.HostingStartup", startupAssembliesElement.Attributes["value"].Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
|
|
@ -48,18 +57,26 @@ namespace Microsoft.AspNetCore.AzureAppServices.SiteExtension
|
||||||
|
|
||||||
Assert.NotNull(envNode);
|
Assert.NotNull(envNode);
|
||||||
|
|
||||||
Assert.Equal(2, envNode.ChildNodes.Count);
|
Assert.Equal(3, envNode.ChildNodes.Count);
|
||||||
|
|
||||||
var firstChild = envNode.FirstChild;
|
var depsElement = envNode.FirstChild;
|
||||||
Assert.Equal("add", firstChild.Name);
|
Assert.Equal("add", depsElement.Name);
|
||||||
Assert.Equal("DOTNET_ADDITIONAL_DEPS", firstChild.Attributes["name"].Value);
|
Assert.Equal("DOTNET_ADDITIONAL_DEPS", depsElement.Attributes["name"].Value);
|
||||||
Assert.Equal(@"ExistingValue1;%ProgramFiles%\dotnet\additionalDeps\Microsoft.AspNetCore.AzureAppServices.HostingStartup\",
|
Assert.Equal(@"ExistingValue1;"+
|
||||||
firstChild.Attributes["value"].Value);
|
$@"{XdtExtensionPath}\additionalDeps\Microsoft.AspNetCore.AzureAppServices.HostingStartup\;" +
|
||||||
|
$@"{XdtExtensionPath}\additionalDeps\Microsoft.AspNetCore.AzureKeyVault.HostingStartup\;" +
|
||||||
|
@"%ProgramFiles%\dotnet\additionalDeps\Microsoft.AspNetCore.AzureAppServices.HostingStartup\",
|
||||||
|
depsElement.Attributes["value"].Value);
|
||||||
|
|
||||||
var secondChild = firstChild.NextSibling;
|
var sharedStoreElement = depsElement.NextSibling;
|
||||||
Assert.Equal("add", secondChild.Name);
|
Assert.Equal("add", sharedStoreElement.Name);
|
||||||
Assert.Equal("ASPNETCORE_HOSTINGSTARTUPASSEMBLIES", secondChild.Attributes["name"].Value);
|
Assert.Equal("DOTNET_SHARED_STORE", sharedStoreElement.Attributes["name"].Value);
|
||||||
Assert.Equal("ExistingValue2;Microsoft.AspNetCore.AzureAppServices.HostingStartup", secondChild.Attributes["value"].Value);
|
Assert.Equal($@"ExistingValue3;{XdtExtensionPath}\store", sharedStoreElement.Attributes["value"].Value);
|
||||||
|
|
||||||
|
var startupAssembliesElement = sharedStoreElement.NextSibling;
|
||||||
|
Assert.Equal("add", startupAssembliesElement.Name);
|
||||||
|
Assert.Equal("ASPNETCORE_HOSTINGSTARTUPASSEMBLIES", startupAssembliesElement.Attributes["name"].Value);
|
||||||
|
Assert.Equal("ExistingValue2;Microsoft.AspNetCore.AzureAppServices.HostingStartup", startupAssembliesElement.Attributes["value"].Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static XmlDocument LoadDocAndRunTransform(string docName)
|
private static XmlDocument LoadDocAndRunTransform(string docName)
|
||||||
|
|
@ -67,7 +84,7 @@ namespace Microsoft.AspNetCore.AzureAppServices.SiteExtension
|
||||||
// Microsoft.Web.Hosting.Transformers.ApplicationHost.SiteExtensionDefinition.Transform
|
// Microsoft.Web.Hosting.Transformers.ApplicationHost.SiteExtensionDefinition.Transform
|
||||||
// (See Microsoft.Web.Hosting, Version=7.1.0.0) replaces variables for you in Azure.
|
// (See Microsoft.Web.Hosting, Version=7.1.0.0) replaces variables for you in Azure.
|
||||||
var transformFile = File.ReadAllText("applicationHost.xdt");
|
var transformFile = File.ReadAllText("applicationHost.xdt");
|
||||||
transformFile = transformFile.Replace("%XDT_EXTENSIONPATH%", AppDomain.CurrentDomain.BaseDirectory);
|
transformFile = transformFile.Replace("%XDT_EXTENSIONPATH%", XdtExtensionPath);
|
||||||
var transform = new XmlTransformation(transformFile, isTransformAFile: false, logger: null);
|
var transform = new XmlTransformation(transformFile, isTransformAFile: false, logger: null);
|
||||||
var doc = new XmlDocument();
|
var doc = new XmlDocument();
|
||||||
doc.Load(docName);
|
doc.Load(docName);
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
<runtime>
|
<runtime>
|
||||||
<environmentVariables>
|
<environmentVariables>
|
||||||
<add name="DOTNET_ADDITIONAL_DEPS" value="" />
|
<add name="DOTNET_ADDITIONAL_DEPS" value="" />
|
||||||
|
<add name="DOTNET_SHARED_STORE" value="" />
|
||||||
<add name="ASPNETCORE_HOSTINGSTARTUPASSEMBLIES" value="" />
|
<add name="ASPNETCORE_HOSTINGSTARTUPASSEMBLIES" value="" />
|
||||||
</environmentVariables>
|
</environmentVariables>
|
||||||
</runtime>
|
</runtime>
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
<runtime>
|
<runtime>
|
||||||
<environmentVariables>
|
<environmentVariables>
|
||||||
<add name="DOTNET_ADDITIONAL_DEPS" />
|
<add name="DOTNET_ADDITIONAL_DEPS" />
|
||||||
|
<add name="DOTNET_SHARED_STORE" />
|
||||||
<add name="ASPNETCORE_HOSTINGSTARTUPASSEMBLIES" />
|
<add name="ASPNETCORE_HOSTINGSTARTUPASSEMBLIES" />
|
||||||
</environmentVariables>
|
</environmentVariables>
|
||||||
</runtime>
|
</runtime>
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
<runtime>
|
<runtime>
|
||||||
<environmentVariables>
|
<environmentVariables>
|
||||||
<add name="DOTNET_ADDITIONAL_DEPS" value="ExistingValue1" />
|
<add name="DOTNET_ADDITIONAL_DEPS" value="ExistingValue1" />
|
||||||
|
<add name="DOTNET_SHARED_STORE" value="ExistingValue3" />
|
||||||
<add name="ASPNETCORE_HOSTINGSTARTUPASSEMBLIES" value="ExistingValue2" />
|
<add name="ASPNETCORE_HOSTINGSTARTUPASSEMBLIES" value="ExistingValue2" />
|
||||||
</environmentVariables>
|
</environmentVariables>
|
||||||
</runtime>
|
</runtime>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue