Skip to content

Commit 7af5e5d

Browse files
Move all quarantined tests to the aspnetcore-quarantined-tests pipeline (#22445)
1 parent b5e3786 commit 7af5e5d

File tree

3 files changed

+118
-47
lines changed

3 files changed

+118
-47
lines changed

.azure/pipelines/ci.yml

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -503,16 +503,6 @@ stages:
503503
beforeBuild:
504504
- powershell: "& ./src/Servers/IIS/tools/UpdateIISExpressCertificate.ps1; & ./src/Servers/IIS/tools/update_schema.ps1"
505505
displayName: Setup IISExpress test certificates and schema
506-
afterBuild:
507-
- powershell: "& ./build.ps1 -CI -nobl -NoBuild -Test /p:RunQuarantinedTests=true"
508-
displayName: Run Quarantined Tests
509-
continueOnError: true
510-
- task: PublishTestResults@2
511-
displayName: Publish Quarantined Test Results
512-
inputs:
513-
testResultsFormat: 'xUnit'
514-
testResultsFiles: '*.xml'
515-
searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)/Quarantined'
516506
artifacts:
517507
- name: Windows_Test_Dumps
518508
path: artifacts/dumps/
@@ -566,20 +556,6 @@ stages:
566556
beforeBuild:
567557
- bash: "./eng/scripts/install-nginx-mac.sh"
568558
displayName: Installing Nginx
569-
afterBuild:
570-
- bash: ./build.sh --ci --nobl --pack --no-build --no-restore --no-build-deps
571-
displayName: Pack Packages (for Template tests)
572-
- bash: ./src/ProjectTemplates/build.sh --ci --nobl --pack --no-restore --no-build-deps
573-
displayName: Pack Templates (for Template tests)
574-
- bash: ./build.sh --no-build --ci --nobl --test -p:RunQuarantinedTests=true
575-
displayName: Run Quarantined Tests
576-
continueOnError: true
577-
- task: PublishTestResults@2
578-
displayName: Publish Quarantined Test Results
579-
inputs:
580-
testResultsFormat: 'xUnit'
581-
testResultsFiles: '*.xml'
582-
searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)/Quarantined'
583559
artifacts:
584560
- name: MacOS_Test_Logs
585561
path: artifacts/log/
@@ -604,20 +580,6 @@ stages:
604580
displayName: Installing Nginx
605581
- bash: "echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p"
606582
displayName: Increase inotify limit
607-
afterBuild:
608-
- bash: ./build.sh --ci --nobl --pack --no-build --no-restore --no-build-deps
609-
displayName: Pack Packages (for Template tests)
610-
- bash: ./src/ProjectTemplates/build.sh --ci --nobl --pack --no-restore --no-build-deps
611-
displayName: Pack Templates (for Template tests)
612-
- bash: ./build.sh --no-build --ci --nobl --test -p:RunQuarantinedTests=true
613-
displayName: Run Quarantined Tests
614-
continueOnError: true
615-
- task: PublishTestResults@2
616-
displayName: Publish Quarantined Test Results
617-
inputs:
618-
testResultsFormat: 'xUnit'
619-
testResultsFiles: '*.xml'
620-
searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)/Quarantined'
621583
artifacts:
622584
- name: Linux_Test_Logs
623585
path: artifacts/log/

.azure/pipelines/quarantined-tests.yml

Lines changed: 101 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ variables:
2525
jobs:
2626
- template: jobs/default-build.yml
2727
parameters:
28-
jobName: Helix_quarantine_x64
29-
jobDisplayName: 'Tests: Helix Quarantine x64'
28+
jobName: Helix_quarantined_x64
29+
jobDisplayName: 'Tests: Helix'
3030
agentOs: Windows
31-
timeoutInMinutes: 240
31+
timeoutInMinutes: 180
3232
steps:
3333
# Build the shared framework
3434
- script: ./build.cmd -ci -nobl -all -pack -arch x64 /p:ASPNETCORE_TEST_LOG_DIR=artifacts/log
@@ -46,3 +46,101 @@ jobs:
4646
- name: Helix_logs
4747
path: artifacts/log/
4848
publishOnError: true
49+
50+
- template: jobs/default-build.yml
51+
parameters:
52+
jobName: Windows_Quarantined_x64
53+
jobDisplayName: 'Tests: Windows x64'
54+
agentOs: Windows
55+
timeoutInMinutes: 180
56+
isTestingJob: true
57+
steps:
58+
- powershell: "& ./build.ps1 -CI -nobl -all -pack -NoBuildJava"
59+
displayName: Build
60+
# The templates part can be removed when the Blazor Templates run on Helix
61+
- script: ./src/ProjectTemplates/build.cmd -ci -nobl -pack -NoRestore -NoBuilddeps "/p:RunTemplateTests=true"
62+
displayName: Pack Templates
63+
- script: ./build.cmd -ci -nobl -test -NoRestore -NoBuild -NoBuilddeps "/p:RunTemplateTests=true /p:RunQuarantinedTests=true /p:SkipHelixReadyTests=true"
64+
displayName: Run Quarantined Tests
65+
condition: always()
66+
- task: PublishTestResults@2
67+
displayName: Publish Quarantined Test Results
68+
inputs:
69+
testResultsFormat: 'xUnit'
70+
testResultsFiles: '*.xml'
71+
searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)/Quarantined'
72+
condition: always()
73+
artifacts:
74+
- name: Windows_Quarantined_Test_Logs
75+
path: artifacts/log/
76+
publishOnError: true
77+
includeForks: true
78+
- name: Windows_Quarantined_Test_Results
79+
path: artifacts/TestResults/
80+
publishOnError: true
81+
includeForks: true
82+
83+
- template: jobs/default-build.yml
84+
parameters:
85+
jobName: MacOS_Quarantined_Test
86+
jobDisplayName: "Tests: macOS 10.14"
87+
agentOs: macOS
88+
timeoutInMinutes: 180
89+
isTestingJob: true
90+
steps:
91+
- bash: ./build.sh --all --pack --ci --nobl --no-build-java
92+
displayName: Build
93+
# The templates part can be removed when the Blazor Templates run on Helix
94+
- bash: ./src/ProjectTemplates/build.sh --ci --nobl --pack --no-restore --no-build-deps
95+
displayName: Pack Templates (for Template tests)
96+
- bash: ./build.sh --no-build --ci --nobl --test -p:RunTemplateTests=true -p:RunQuarantinedTests=true -p:SkipHelixReadyTests=true
97+
displayName: Run Quarantined Tests
98+
- task: PublishTestResults@2
99+
displayName: Publish Quarantined Test Results
100+
inputs:
101+
testResultsFormat: 'xUnit'
102+
testResultsFiles: '*.xml'
103+
searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)/Quarantined'
104+
condition: always()
105+
artifacts:
106+
- name: MacOS_Quarantined_Test_Logs
107+
path: artifacts/log/
108+
publishOnError: true
109+
includeForks: true
110+
- name: MacOS_Quarantined_Test_Results
111+
path: artifacts/TestResults/
112+
publishOnError: true
113+
includeForks: true
114+
115+
- template: jobs/default-build.yml
116+
parameters:
117+
jobName: Linux_Quarantined_Test
118+
jobDisplayName: "Tests: Ubuntu 16.04 x64"
119+
agentOs: Linux
120+
timeoutInMinutes: 180
121+
isTestingJob: true
122+
useHostedUbuntu: false
123+
steps:
124+
- bash: ./build.sh --all --pack --ci --nobl --no-build-java
125+
displayName: Build
126+
# The templates part can be removed when the Blazor Templates run on Helix
127+
- bash: ./src/ProjectTemplates/build.sh --ci --nobl --pack --no-restore --no-build-deps
128+
displayName: Pack Templates (for Template tests)
129+
- bash: ./build.sh --no-build --ci --nobl --test -p:RunTemplateTests=true -p:RunQuarantinedTests=true -p:SkipHelixReadyTests=true
130+
displayName: Run Quarantined Tests
131+
- task: PublishTestResults@2
132+
displayName: Publish Quarantined Test Results
133+
inputs:
134+
testResultsFormat: 'xUnit'
135+
testResultsFiles: '*.xml'
136+
searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)/Quarantined'
137+
condition: always()
138+
artifacts:
139+
- name: Linux_Quarantined_Test_Logs
140+
path: artifacts/log/
141+
publishOnError: true
142+
includeForks: true
143+
- name: Linux_Quarantined_Test_Results
144+
path: artifacts/TestResults/
145+
publishOnError: true
146+
includeForks: true

src/ProjectTemplates/BlazorTemplates.Tests/BlazorWasmTemplateTest.cs

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -250,10 +250,21 @@ private void ValidateAppWorksOffline(Project project, string listeningUri, bool
250250
TestBasicNavigation(project.ProjectName, skipFetchData: skipFetchData);
251251
}
252252

253-
[Theory]
254-
[InlineData(true)]
255-
[InlineData(false)]
256-
public async Task BlazorWasmHostedTemplate_IndividualAuth_Works(bool useLocalDb)
253+
[ConditionalFact]
254+
// LocalDB doesn't work on non Windows platforms
255+
[OSSkipCondition(OperatingSystems.Linux | OperatingSystems.MacOSX)]
256+
public Task BlazorWasmHostedTemplate_IndividualAuth_Works_WithLocalDB()
257+
{
258+
return BlazorWasmHostedTemplate_IndividualAuth_Works(true);
259+
}
260+
261+
[Fact]
262+
public Task BlazorWasmHostedTemplate_IndividualAuth_Works_WithOutLocalDB()
263+
{
264+
return BlazorWasmHostedTemplate_IndividualAuth_Works(false);
265+
}
266+
267+
private async Task BlazorWasmHostedTemplate_IndividualAuth_Works(bool useLocalDb)
257268
{
258269
var project = await ProjectFactory.GetOrCreateProject("blazorhostedindividual" + (useLocalDb ? "uld" : ""), Output);
259270

@@ -268,11 +279,11 @@ public async Task BlazorWasmHostedTemplate_IndividualAuth_Works(bool useLocalDb)
268279
Assert.Contains(".db", serverProjectFileContents);
269280
}
270281

271-
var appSettings = ReadFile(serverProject.TemplateOutputDir, "appSettings.json");
282+
var appSettings = ReadFile(serverProject.TemplateOutputDir, "appsettings.json");
272283
var element = JsonSerializer.Deserialize<JsonElement>(appSettings);
273284
var clientsProperty = element.GetProperty("IdentityServer").EnumerateObject().Single().Value.EnumerateObject().Single();
274285
var replacedSection = element.GetRawText().Replace(clientsProperty.Name, serverProject.ProjectName.Replace(".Server", ".Client"));
275-
var appSettingsPath = Path.Combine(serverProject.TemplateOutputDir, "appSettings.json");
286+
var appSettingsPath = Path.Combine(serverProject.TemplateOutputDir, "appsettings.json");
276287
File.WriteAllText(appSettingsPath, replacedSection);
277288

278289
var publishResult = await serverProject.RunDotNetPublishAsync();

0 commit comments

Comments
 (0)