Skip to content

Commit 46460f0

Browse files
authored
Revert "[Helix] Reenable some Templates tests 2.0 (#19383)" (#19519)
This reverts commit 5e2a772.
1 parent b1a45eb commit 46460f0

File tree

9 files changed

+26
-62
lines changed

9 files changed

+26
-62
lines changed

eng/helix/content/runtests.cmd

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ set $runtimeVersion=%3
99
set $helixQueue=%4
1010
set $arch=%5
1111
set $quarantined=%6
12-
set $efVersion=%7
1312

1413
set DOTNET_HOME=%HELIX_CORRELATION_PAYLOAD%\sdk
1514
set DOTNET_ROOT=%DOTNET_HOME%\%$arch%
@@ -25,23 +24,13 @@ powershell.exe -NoProfile -ExecutionPolicy unrestricted -Command "[Net.ServicePo
2524
if EXIST ".\Microsoft.AspNetCore.App" (
2625
echo "Found Microsoft.AspNetCore.App, copying to %DOTNET_ROOT%\shared\Microsoft.AspNetCore.App\%runtimeVersion%"
2726
xcopy /i /y ".\Microsoft.AspNetCore.App" %DOTNET_ROOT%\shared\Microsoft.AspNetCore.App\%runtimeVersion%\
28-
29-
echo "Adding current directory to nuget sources: %HELIX_WORKITEM_ROOT%"
30-
dotnet nuget add source %HELIX_WORKITEM_ROOT%
31-
dotnet nuget add source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json
32-
dotnet nuget list source
33-
dotnet tool install dotnet-ef --global --version %$efVersion%
34-
35-
set PATH=%PATH%;%DOTNET_CLI_HOME%\.dotnet\tools
3627
)
3728

3829
echo "Current Directory: %HELIX_WORKITEM_ROOT%"
3930
set HELIX=%$helixQueue%
4031
set HELIX_DIR=%HELIX_WORKITEM_ROOT%
4132
set NUGET_FALLBACK_PACKAGES=%HELIX_DIR%
4233
set NUGET_RESTORE=%HELIX_DIR%\nugetRestore
43-
set DotNetEfFullPath=%HELIX_DIR%\nugetRestore\dotnet-ef\%$efVersion%\tools\netcoreapp3.1\any\dotnet-ef.exe
44-
echo "Set DotNetEfFullPath: %DotNetEfFullPath%"
4534
echo "Setting HELIX_DIR: %HELIX_DIR%"
4635
echo Creating nuget restore directory: %NUGET_RESTORE%
4736
mkdir %NUGET_RESTORE%

eng/helix/content/runtests.sh

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ dotnet_runtime_version="$3"
66
helix_queue_name="$4"
77
target_arch="$5"
88
quarantined="$6"
9-
efVersion="$7"
109

1110
RESET="\033[0m"
1211
RED="\033[0;31m"
@@ -34,8 +33,6 @@ export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
3433
export helix="$helix_queue_name"
3534
export HELIX_DIR="$DIR"
3635
export NUGET_FALLBACK_PACKAGES="$DIR"
37-
export DotNetEfFullPath=$DIR\nugetRestore\dotnet-ef\$efVersion\tools\netcoreapp3.1\any\dotnet-ef.dll
38-
echo "Set DotNetEfFullPath: $DotNetEfFullPath"
3936
export NUGET_RESTORE="$DIR/nugetRestore"
4037
echo "Creating nugetRestore directory: $NUGET_RESTORE"
4138
mkdir $NUGET_RESTORE
@@ -98,17 +95,6 @@ if [ -d "Microsoft.AspNetCore.App" ]
9895
then
9996
echo "Found Microsoft.AspNetCore.App directory, copying to $DOTNET_ROOT/shared/Microsoft.AspNetCore.App/$dotnet_runtime_version."
10097
cp -r Microsoft.AspNetCore.App $DOTNET_ROOT/shared/Microsoft.AspNetCore.App/$dotnet_runtime_version
101-
102-
echo "Adding current directory to nuget sources: $DIR"
103-
dotnet nuget add source $DIR
104-
dotnet nuget add source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json
105-
dotnet nuget list source
106-
107-
dotnet tool install dotnet-ef --global --version $efVersion
108-
109-
# Ensure tools are on on PATH
110-
export PATH="$PATH:$DOTNET_CLI_HOME/.dotnet/tools"
111-
11298
fi
11399

114100
if [ -e /proc/self/coredump_filter ]; then

eng/targets/Helix.targets

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ Usage: dotnet msbuild /t:Helix src/MyTestProject.csproj
120120
<TestAssembly>$(TargetFileName)</TestAssembly>
121121
<PreCommands>@(HelixPreCommand)</PreCommands>
122122
<PostCommands>@(HelixPostCommand)</PostCommands>
123-
<Command Condition="$(IsWindowsHelixQueue)">call runtests.cmd $(TargetFileName) $(NETCoreSdkVersion) $(MicrosoftNETCoreAppRuntimeVersion) $(_HelixFriendlyNameTargetQueue) $(TargetArchitecture) $(RunQuarantinedTests) $(DotnetEfPackageVersion)</Command>
124-
<Command Condition="!$(IsWindowsHelixQueue)">./runtests.sh $(TargetFileName) $(NETCoreSdkVersion) $(MicrosoftNETCoreAppRuntimeVersion) $(_HelixFriendlyNameTargetQueue) $(TargetArchitecture) $(RunQuarantinedTests) $(DotnetEfPackageVersion)</Command>
123+
<Command Condition="$(IsWindowsHelixQueue)">call runtests.cmd $(TargetFileName) $(NETCoreSdkVersion) $(MicrosoftNETCoreAppRuntimeVersion) $(_HelixFriendlyNameTargetQueue) $(TargetArchitecture) $(RunQuarantinedTests)</Command>
124+
<Command Condition="!$(IsWindowsHelixQueue)">./runtests.sh $(TargetFileName) $(NETCoreSdkVersion) $(MicrosoftNETCoreAppRuntimeVersion) $(_HelixFriendlyNameTargetQueue) $(TargetArchitecture) $(RunQuarantinedTests)</Command>
125125
<Command Condition="$(HelixCommand) != ''">$(HelixCommand)</Command>
126126
<Timeout>$(HelixTimeout)</Timeout>
127127
</HelixWorkItem>

src/ProjectTemplates/test/Helpers/Project.cs

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
using System.IO;
88
using System.Linq;
99
using System.Reflection;
10-
using System.Runtime.InteropServices;
1110
using System.Threading;
1211
using System.Threading.Tasks;
1312
using Microsoft.Extensions.CommandLineUtils;
@@ -29,11 +28,12 @@ public class Project
2928
? GetAssemblyMetadata("ArtifactsLogDir")
3029
: Path.Combine(Environment.GetEnvironmentVariable("HELIX_DIR"), "logs");
3130

32-
public static string DotNetEfFullPath => (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("DotNetEfFullPath")))
31+
// FIGURE OUT EF PATH
32+
public static string DotNetEfFullPath => (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("helix")))
3333
? typeof(ProjectFactoryFixture).Assembly.GetCustomAttributes<AssemblyMetadataAttribute>()
3434
.First(attribute => attribute.Key == "DotNetEfFullPath")
3535
.Value
36-
: Environment.GetEnvironmentVariable("DotNetEfFullPath");
36+
: Path.Combine("NuGetPackageRoot", "dotnet-ef/$(DotnetEfPackageVersion)/tools/netcoreapp3.1/any/dotnet-ef.dll");
3737

3838
public SemaphoreSlim DotNetNewLock { get; set; }
3939
public SemaphoreSlim NodeLock { get; set; }
@@ -306,24 +306,14 @@ private async Task<ProcessEx> RestoreAsync(ITestOutputHelper output, string work
306306

307307
internal async Task<ProcessEx> RunDotNetEfCreateMigrationAsync(string migrationName)
308308
{
309-
var args = $"--verbose --no-build migrations add {migrationName}";
310-
309+
var args = $"\"{DotNetEfFullPath}\" --verbose --no-build migrations add {migrationName}";
310+
311311
// Only run one instance of 'dotnet new' at once, as a workaround for
312312
// https://github.com/aspnet/templating/issues/63
313313
await DotNetNewLock.WaitAsync();
314314
try
315315
{
316-
var command = DotNetMuxer.MuxerPathOrDefault();
317-
if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("DotNetEfFullPath")))
318-
{
319-
args = $"\"{DotNetEfFullPath}\" " + args;
320-
}
321-
else
322-
{
323-
command = "dotnet-ef";
324-
}
325-
326-
var result = ProcessEx.Run(Output, TemplateOutputDir, command, args);
316+
var result = ProcessEx.Run(Output, TemplateOutputDir, DotNetMuxer.MuxerPathOrDefault(), args);
327317
await result.Exited;
328318
return result;
329319
}
@@ -335,24 +325,14 @@ internal async Task<ProcessEx> RunDotNetEfCreateMigrationAsync(string migrationN
335325

336326
internal async Task<ProcessEx> RunDotNetEfUpdateDatabaseAsync()
337327
{
338-
var args = "--verbose --no-build database update";
328+
var args = $"\"{DotNetEfFullPath}\" --verbose --no-build database update";
339329

340330
// Only run one instance of 'dotnet new' at once, as a workaround for
341331
// https://github.com/aspnet/templating/issues/63
342332
await DotNetNewLock.WaitAsync();
343333
try
344334
{
345-
var command = DotNetMuxer.MuxerPathOrDefault();
346-
if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable("DotNetEfFullPath")))
347-
{
348-
args = $"\"{DotNetEfFullPath}\" " + args;
349-
}
350-
else
351-
{
352-
command = "dotnet-ef";
353-
}
354-
355-
var result = ProcessEx.Run(Output, TemplateOutputDir, command, args);
335+
var result = ProcessEx.Run(Output, TemplateOutputDir, DotNetMuxer.MuxerPathOrDefault(), args);
356336
await result.Exited;
357337
return result;
358338
}

src/ProjectTemplates/test/IdentityUIPackageTest.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System.IO;
66
using System.Net;
77
using System.Threading.Tasks;
8+
using Microsoft.AspNetCore.Testing;
89
using Templates.Test.Helpers;
910
using Xunit;
1011
using Xunit.Abstractions;
@@ -117,8 +118,9 @@ public static TheoryData<IDictionary<string, string>, string, string[]> MSBuildI
117118
"Identity/lib/jquery-validation-unobtrusive/LICENSE.txt",
118119
};
119120

120-
[Theory]
121+
[ConditionalTheory]
121122
[MemberData(nameof(MSBuildIdentityUIPackageOptions))]
123+
[SkipOnHelix("ef restore no worky")]
122124
public async Task IdentityUIPackage_WorksWithDifferentOptions(IDictionary<string, string> packageOptions, string versionValidator, string[] expectedFiles)
123125
{
124126
Project = await ProjectFactory.GetOrCreateProject("identityuipackage" + string.Concat(packageOptions.Values), Output);

src/ProjectTemplates/test/MvcTemplateTest.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,10 @@ private async Task MvcTemplateCore(string languageOverride)
104104
}
105105
}
106106

107-
[Theory]
107+
[ConditionalTheory]
108108
[InlineData(true)]
109109
[InlineData(false)]
110+
[SkipOnHelix("ef restore no worky")]
110111
public async Task MvcTemplate_IndividualAuth(bool useLocalDB)
111112
{
112113
Project = await ProjectFactory.GetOrCreateProject("mvcindividual" + (useLocalDB ? "uld" : ""), Output);
@@ -221,7 +222,8 @@ public async Task MvcTemplate_IndividualAuth(bool useLocalDB)
221222
}
222223
}
223224

224-
[Fact]
225+
[ConditionalFact]
226+
[SkipOnHelix("razor compilation restore no worky")]
225227
public async Task MvcTemplate_RazorRuntimeCompilation_BuildsAndPublishes()
226228
{
227229
Project = await ProjectFactory.GetOrCreateProject("mvc_rc", Output);

src/ProjectTemplates/test/RazorClassLibraryTemplateTest.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using Templates.Test.Helpers;
66
using Xunit;
77
using Xunit.Abstractions;
8+
using Microsoft.AspNetCore.Testing;
89

910
namespace Templates.Test
1011
{
@@ -40,7 +41,8 @@ public async Task RazorClassLibraryTemplate_WithViews_Async()
4041
Assert.True(0 == buildResult.ExitCode, ErrorMessages.GetFailedProcessMessage("build", Project, buildResult));
4142
}
4243

43-
[Fact]
44+
[ConditionalFact]
45+
[SkipOnHelix("restore no worky")]
4446
public async Task RazorClassLibraryTemplateAsync()
4547
{
4648
Project = await ProjectFactory.GetOrCreateProject("razorclasslib", Output);

src/ProjectTemplates/test/RazorPagesTemplateTest.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,10 @@ public async Task RazorPagesTemplate_NoAuth()
9494
}
9595
}
9696

97-
[Theory]
97+
[ConditionalTheory]
9898
[InlineData(false)]
9999
[InlineData(true)]
100+
[SkipOnHelix("ef restore no worky")]
100101
public async Task RazorPagesTemplate_IndividualAuth(bool useLocalDB)
101102
{
102103
Project = await ProjectFactory.GetOrCreateProject("razorpagesindividual" + (useLocalDB ? "uld" : ""), Output);
@@ -211,7 +212,8 @@ public async Task RazorPagesTemplate_IndividualAuth(bool useLocalDB)
211212
}
212213
}
213214

214-
[Fact]
215+
[ConditionalFact]
216+
[SkipOnHelix("runtime compliation restore no worky")]
215217
public async Task RazorPagesTemplate_RazorRuntimeCompilation_BuildsAndPublishes()
216218
{
217219
Project = await ProjectFactory.GetOrCreateProject("razorpages_rc", Output);

src/ProjectTemplates/test/WorkerTemplateTest.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ public WorkerTemplateTest(ProjectFactoryFixture projectFactory, ITestOutputHelpe
2121
public ProjectFactoryFixture ProjectFactory { get; }
2222
public ITestOutputHelper Output { get; }
2323

24-
[Fact]
24+
[ConditionalFact]
25+
[SkipOnHelix("restore no worky")]
2526
public async Task WorkerTemplateAsync()
2627
{
2728
Project = await ProjectFactory.GetOrCreateProject("worker", Output);

0 commit comments

Comments
 (0)