Skip to content

Commit

Permalink
Re-enable most Desktop integration tests (#14147)
Browse files Browse the repository at this point in the history
* Update Test Website JSON dependencies to .NET 8

* Use V8 for Desktop int. tests

* Clean up WebSocket test

* Re-enable int. tests excluded in [143f1ad29].

See #13685
During the upgrade to RN 0.76, RNTester integration tests began failing.

The root cause has been tracked to such tests using Chakra (deprecated)
as the JS engine.

* Change files

* Remove filter comment

* Remove Chakra references
  • Loading branch information
JunielKatarn authored Dec 4, 2024
1 parent d7b4b48 commit 2d6e2d5
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 34 deletions.
14 changes: 1 addition & 13 deletions .ado/jobs/desktop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,24 +91,12 @@ jobs:
#12714 - Disable for first deployment of test website.
# RNTesterIntegrationTests::WebSocket
# RNTesterIntegrationTests::WebSocketBlob
##13897 - Reneable RNTesterIntegrationTests
# RNTesterIntegrationTests::Dummy
# RNTesterIntegrationTests::Fetch
# RNTesterIntegrationTests::XHRSample
# RNTesterIntegrationTests::Blob
# RNTesterIntegrationTests::Logging
- name: Desktop.IntegrationTests.Filter
value: >
(FullyQualifiedName!=RNTesterIntegrationTests::IntegrationTestHarness)&
(FullyQualifiedName!=RNTesterIntegrationTests::WebSocket)&
(FullyQualifiedName!=RNTesterIntegrationTests::WebSocketBlob)&
(FullyQualifiedName!=WebSocketIntegrationTest::SendReceiveSsl)&
(FullyQualifiedName!=Microsoft::React::Test::HttpOriginPolicyIntegrationTest)&
(FullyQualifiedName!=RNTesterIntegrationTests::Dummy)&
(FullyQualifiedName!=RNTesterIntegrationTests::Fetch)&
(FullyQualifiedName!=RNTesterIntegrationTests::XHRSample)&
(FullyQualifiedName!=RNTesterIntegrationTests::Blob)&
(FullyQualifiedName!=RNTesterIntegrationTests::Logging)
(FullyQualifiedName!=WebSocketIntegrationTest::SendReceiveSsl)
#6799 -
# HostFunctionTest - Crashes under JSI/V8
# HostObjectProtoTest - Crashes under JSI/V8
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "Re-enable most Desktop integration tests",
"packageName": "react-native-windows",
"email": "[email protected]",
"dependentChangeType": "patch"
}
5 changes: 1 addition & 4 deletions vnext/Desktop.IntegrationTests/DesktopTestRunner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

#include <Threading/MessageQueueThreadFactory.h>
#include <cxxreact/Instance.h>
#include "ChakraRuntimeHolder.h"
#include "DesktopTestInstance.h"
#include "Modules/TestDevSettingsModule.h"
#include "Modules/TestImageLoaderModule.h"
Expand Down Expand Up @@ -70,9 +69,7 @@ shared_ptr<ITestInstance> TestRunner::GetInstance(

// Update settings.
devSettings->platformName = "windows";

// Set to JSIEngineOverride::Chakra when testing the Chakra.dll JSI runtime.
devSettings->jsiEngineOverride = JSIEngineOverride::Chakra;
devSettings->jsiEngineOverride = JSIEngineOverride::V8;

auto instanceWrapper = CreateReactInstance(
std::make_shared<facebook::react::Instance>(),
Expand Down
8 changes: 0 additions & 8 deletions vnext/Desktop.IntegrationTests/RNTesterIntegrationTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include <CppUnitTest.h>

#include <CppRuntimeOptions.h>
#include <Test/WebSocketServer.h>
#include "TestRunner.h"

using namespace Microsoft::React::Test;
Expand Down Expand Up @@ -176,14 +175,7 @@ TEST_CLASS (RNTesterIntegrationTests) {
BEGIN_TEST_METHOD_ATTRIBUTE(WebSocket)
END_TEST_METHOD_ATTRIBUTE()
TEST_METHOD(WebSocket) {
// Should behave the same as IntegrationTests/websocket_integration_test_server.js
auto server = std::make_shared<WebSocketServer>(5555, false /*useTLS*/);
server->SetMessageFactory([](string &&message) -> string { return message + "_response"; });
server->Start();

TestComponent("WebSocketTest");

server->Stop();
}

BEGIN_TEST_METHOD_ATTRIBUTE(AccessibilityManager)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
<UseWinUI3 Condition="'$(UseWinUI3)' == ''">true</UseWinUI3>
<!-- Desktop can use WinUI3 in Old Arch so disable the check. -->
<ForcePaperUseWinUI3 Condition="'$(UseWinUI3)'=='true'">true</ForcePaperUseWinUI3>
<UseV8>true</UseV8>
<V8AppPlatform>win32</V8AppPlatform>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="$(ReactNativeWindowsDir)PropertySheets\React.Cpp.props" />
Expand Down Expand Up @@ -148,9 +150,10 @@
<PackageReference Include="ReactWindows.OpenSSL.StdCall.Static" Version="1.0.2-p.5" />
<!-- TODO: Remove!!! -->
<PackageReference Include="Microsoft.Windows.CppWinRT" Version="$(CppWinRTVersion)" PrivateAssets="all" />
<!-- We're transitively pulling in Microsoft.WindowsAppSDK, and it depends on Microsoft.Web.WebView2, which
<!-- We're transitively pulling in Microsoft.WindowsAppSDK, and it depends on Microsoft.Web.WebView2, which
doesn't get pulled in the same way, so we need to add it explicitly. -->
<PackageReference Include="Microsoft.Web.WebView2" Version="$(WebView2PackageVersion)" Condition="'$(UseWinUI3)'=='true'" />
<PackageReference Include="$(V8PackageName)" Version="$(V8Version)" Condition="'$(UseV8)' == 'true'" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<Target Name="Test">
Expand Down
15 changes: 8 additions & 7 deletions vnext/Desktop.IntegrationTests/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
"resolved": "2.0.230706.1",
"contentHash": "l0D7oCw/5X+xIKHqZTi62TtV+1qeSz7KVluNFdrJ9hXsst4ghvqQ/Yhura7JqRdZWBXAuDS0G0KwALptdoxweQ=="
},
"ReactNative.V8Jsi.Windows": {
"type": "Direct",
"requested": "[0.71.8, )",
"resolved": "0.71.8",
"contentHash": "ksHjshj05AMAQ/v7Wet5Dwcwn9Up2BTOIrTv1yEW7+D23FQX0yILW5Zw0bmlWtV8MEtdY611z+06U3Xvu2ygSA=="
},
"ReactWindows.OpenSSL.StdCall.Static": {
"type": "Direct",
"requested": "[1.0.2-p.5, )",
Expand Down Expand Up @@ -64,11 +70,6 @@
"Microsoft.Windows.SDK.BuildTools": "10.0.22621.756"
}
},
"ReactNative.V8Jsi.Windows": {
"type": "Transitive",
"resolved": "0.71.8",
"contentHash": "ksHjshj05AMAQ/v7Wet5Dwcwn9Up2BTOIrTv1yEW7+D23FQX0yILW5Zw0bmlWtV8MEtdY611z+06U3Xvu2ygSA=="
},
"common": {
"type": "Project",
"dependencies": {
Expand All @@ -81,8 +82,8 @@
"folly": {
"type": "Project",
"dependencies": {
"boost": "[1.83.0, )",
"fmt": "[1.0.0, )"
"Fmt": "[1.0.0, )",
"boost": "[1.83.0, )"
}
},
"follywin32": {
Expand Down
2 changes: 1 addition & 1 deletion vnext/TestWebSite/packages.lock.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"version": 1,
"dependencies": {
"net7.0": {}
"net8.0": {}
}
}

0 comments on commit 2d6e2d5

Please sign in to comment.