@@ -60,7 +60,7 @@ parameters:
6060 - X86ReleaseFabric :
6161 BuildConfiguration : Release
6262 BuildPlatform : x86
63- UseFabric : true
63+ UseFabric : true
6464
6565jobs :
6666 - ${{ each config in parameters.buildMatrix }} :
@@ -78,11 +78,14 @@ jobs:
7878
7979 # 5059 - Disable failing or intermittent tests (IntegrationTestHarness,WebSocket,Logging).
8080 # 10732 - WebSocketIntegrationTest::SendReceiveSsl fails on Windows Server 2022.
81+ # 12714 - Disable for first deployment of test website.
82+ # RNTesterIntegrationTests::WebSocket
83+ # RNTesterIntegrationTests::WebSocketBlob
8184 - name : Desktop.IntegrationTests.Filter
8285 value : >
83- (FullyQualifiedName!=RNTesterIntegrationTests::Blob)&
8486 (FullyQualifiedName!=RNTesterIntegrationTests::IntegrationTestHarness)&
85- (FullyQualifiedName!=WebSocketResourcePerformanceTest::ProcessThreadsPerResource)&
87+ (FullyQualifiedName!=RNTesterIntegrationTests::WebSocket)&
88+ (FullyQualifiedName!=RNTesterIntegrationTests::WebSocketBlob)&
8689 (FullyQualifiedName!=WebSocketIntegrationTest::SendReceiveSsl)&
8790 (FullyQualifiedName!=Microsoft::React::Test::HttpOriginPolicyIntegrationTest)
8891 # 6799 -
@@ -100,6 +103,31 @@ jobs:
100103 cancelTimeoutInMinutes : 5 # how much time to give 'run always even if cancelled tasks' before killing them
101104
102105 steps :
106+ # Set up IIS tests {
107+ - pwsh : |
108+ Install-WindowsFeature -Name Web-Server, Web-Scripting-Tools
109+ displayName: Install IIS
110+
111+ - pwsh : |
112+ Invoke-WebRequest `
113+ -Uri 'https://download.visualstudio.microsoft.com/download/pr/20598243-c38f-4538-b2aa-af33bc232f80/ea9b2ca232f59a6fdc84b7a31da88464/dotnet-hosting-8.0.3-win.exe' `
114+ -OutFile dotnet-hosting-8.0.3-win.exe
115+
116+ Write-Host 'Installing .NET hosting bundle'
117+ Start-Process -Wait -FilePath .\dotnet-hosting-8.0.3-win.exe -ArgumentList '/INSTALL', '/QUIET', '/NORESTART'
118+ Write-Host 'Installed .NET hosting bundle'
119+
120+ Invoke-WebRequest `
121+ -Uri 'https://download.visualstudio.microsoft.com/download/pr/f2ec926e-0d98-4a8b-8c70-722ccc2ca0e5/b59941b0c60f16421679baafdb7e9338/dotnet-sdk-7.0.407-win-x64.exe' `
122+ -OutFile dotnet-sdk-7.0.407-win-x64.exe
123+
124+ Write-Host 'Installing .NET 7 SDK'
125+ Start-Process -Wait -FilePath .\dotnet-sdk-7.0.407-win-x64.exe -ArgumentList '/INSTALL', '/QUIET', '/NORESTART'
126+ Write-Host 'Installed .NET 7 SDK'
127+ displayName: Install the .NET Core Hosting Bundle
128+
129+ # } Set up IIS tests
130+
103131 - template : ../templates/checkout-shallow.yml
104132
105133 - template : ../templates/prepare-js-env.yml
@@ -168,11 +196,89 @@ jobs:
168196 filePath : $(Build.SourcesDirectory)\vnext\Scripts\Tfs\Start-TestServers.ps1
169197 arguments : -SourcesDirectory $(Build.SourcesDirectory)\vnext -Preload -SleepSeconds 120
170198
199+ - task : DotNetCoreCLI@2
200+ displayName : Publish Test Website
201+ inputs :
202+ command : publish
203+ publishWebProjects : false
204+ zipAfterPublish : false
205+ projects : $(Build.SourcesDirectory)\vnext\TestWebsite\Microsoft.ReactNative.Test.Website.csproj
206+ arguments : --configuration ${{ matrix.BuildConfiguration }}
207+
208+ - pwsh : |
209+ # Create and make available to IIS
210+ $cert = New-SelfSignedCertificate `
211+ -Type SSLServerAuthentication `
212+ -KeyExportPolicy Exportable `
213+ -Subject 'CN=localhost' `
214+ -NotAfter ([DateTime]::Now).AddHours(2) `
215+ -CertStoreLocation Cert:\LocalMachine\My\
216+
217+ $certPath = "${env:TEMP}\localhost.pfx"
218+ $certPass = -join ('a'..'z' | Get-Random -Count 32) | ConvertTo-SecureString -AsPlainText -Force
219+ $certHash = $cert.Thumbprint
220+ Write-Host "##vso[task.setvariable variable=TestWebsiteCertificateThumbprint]$certHash"
221+
222+ # Export PFX
223+ $cert | Export-PfxCertificate -FilePath $certPath -Password $certPass
224+
225+ # Trust globally
226+ Import-PfxCertificate `
227+ -Exportable `
228+ -FilePath $certPath `
229+ -Password $certPass `
230+ -CertStoreLocation Cert:\LocalMachine\Root\
231+ displayName: Install SSL Certificate
232+
233+ - task : IISWebAppManagementOnMachineGroup@0
234+ displayName : Create Test Website
235+ inputs :
236+ EnableIIS : false
237+ IISDeploymentType : IISWebsite
238+ ActionIISWebsite : CreateOrUpdateWebsite
239+ SSLCertThumbPrint : $(TestWebsiteCertificateThumbprint)
240+ # IIS Website
241+ WebsiteName : RNW Test Website
242+ WebsitePhysicalPath : $(Build.SourcesDirectory)\vnext\target\${{ matrix.BuildPlatform }}\${{ matrix.BuildConfiguration }}\Microsoft.ReactNative.Test.Website\Publish
243+ WebsitePhysicalPathAuth : WebsiteUserPassThrough
244+ CreateOrUpdateAppPoolForWebsite : false
245+ ConfigureAuthenticationForWebsite : false
246+ # IIS Application pool
247+ AppPoolNameForWebsite : DefaultAppPool
248+ # IIS Bindings
249+ # See https://stackoverflow.com/questions/60089756
250+ AddBinding : true
251+ Bindings : |
252+ {
253+ bindings: [
254+ {
255+ "protocol": "http",
256+ "ipAddress": "*",
257+ "port": "5555",
258+ "sslThumbprint": "",
259+ "sniFlag": false
260+ },
261+ {
262+ "protocol": "https",
263+ "ipAddress": "*",
264+ "port": "5543",
265+ "sslThumbprint": "$(TestWebsiteCertificateThumbprint)",
266+ "sniFlag": false
267+ }
268+ ]
269+ }
270+
171271 - task : PowerShell@2
172- displayName : Check the metro bundle server
272+ displayName : Ensure servers readiness
173273 inputs :
174274 targetType : ' inline'
175- script : Invoke-WebRequest -UseBasicParsing -Uri "http://localhost:8081/IntegrationTests/IntegrationTestsApp.bundle?platform=windows&dev=true"
275+ script : |
276+ # Test website
277+ Invoke-WebRequest -Uri 'http://localhost:5555'
278+ Invoke-WebRequest -Uri 'https://localhost:5543'
279+
280+ # Bundler
281+ Invoke-WebRequest -UseBasicParsing -Uri "http://localhost:8081/IntegrationTests/IntegrationTestsApp.bundle?platform=windows&dev=true"
176282
177283 - task : VSTest@2
178284 displayName : Run Desktop Integration Tests
0 commit comments