microsoft / react-native-windows

A framework for building native Windows apps with React.
https://microsoft.github.io/react-native-windows/
Other
16.39k stars 1.14k forks source link

Microsoft.googletest doesn't have INSTANTIATE_TEST_SUITE_P #9791

Open TatianaKapos opened 2 years ago

TatianaKapos commented 2 years ago

Problem Description

Latest integrations brought a commit that switches from INSTANTIATE_TEST_CASE_P to INSTANTIATE_TEST_SUITE_P in googletests. https://github.com/facebook/react-native/commit/12a32549f427c993637d41569c49baf5ab7113e8. This causes us to fork ReactCommon/jsi/jsi/test/testlib.cpp.

It looks like Meta switched to googletest version 1.10 while we're on https://github.com/Microsoft/TestAdapterForGoogleTest 1.8.1 (I don't think the latest version has INSTANTIATE_TEST_SUITE_P)

Errors: image

Steps To Reproduce

  1. Remove ReactCommon/jsi/jsi/test/testlib.cpp override
  2. Try and build Microsoft.ReactNative.sln

Expected Results

No response

CLI version

7.0.3

Environment

System:
    OS: Windows 10 10.0.22000
    CPU: (8) x64 Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz
    Memory: 42.05 GB / 63.85 GB
  Binaries:
    Node: 14.17.5 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.5 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 8.6.0 - C:\Program Files\nodejs\npm.CMD
    Watchman: Not Found
  SDKs:
    Android SDK: Not Found
    Windows SDK:
      AllowDevelopmentWithoutDevLicense: Enabled
      AllowAllTrustedApps: Enabled
      Versions: 10.0.17763.0, 10.0.18362.0, 10.0.19041.0, 10.0.22000.0
  IDEs:
    Android Studio: Not Found
    Visual Studio: 16.11.32228.343 (Visual Studio Enterprise 2019)
  Languages:
    Java: 1.8.0_302 - C:\Program Files\Eclipse Foundation\jdk-8.0.302.8-hotspot\bin\javac.EXE
  npmPackages:
    @react-native-community/cli: Not Found
    react: Not Found
    react-native: Not Found
    react-native-windows: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Target Platform Version

No response

Target Device(s)

Desktop

Visual Studio Version

Visual Studio 2019

Build Configuration

No response

Snack, code example, screenshot, or link to a repository

No response

chrisglein commented 2 years ago

It looks like Meta switched to googletest version 1.10 while we're on https://github.com/Microsoft/TestAdapterForGoogleTest 1.8.1 (I don't think the latest version has INSTANTIATE_TEST_SUITE_P)

I guess the next step is to see about getting that fork updated, although it doesn't look terribly active. We'll have to drum up some contacts. This should be the first line of investigation (as the repo should have a statement on level of support).

Or can we not use this, but that may be disruptive to how this is used to support our build infrastructure.

Or we can consume this not via nuget and find a vcpkg distribution of this as source or binaries.

In the meantime the workaround here is a fork in ReactCommon. We are not blocked, but we have a goal to minimize forks here to keep agility.

NickGerleman commented 2 years ago

I kind of like the idea of removing usage of the adapter. Using raw GoogleTest would be moving official tests from a VS plugin, to CLI tool. That move makes it easily runnable in more places, but removes tight integration of some tests with Visual Studio.

An idea for similar-ish DevX could be to add a locally runnable "yarn test:native", which runs both GTest, and "VSTest.console".

FYI @JunielKatarn, who was the resident "MSTest" person I worked with 😂.

NickGerleman commented 2 years ago

There seems to be an up to date VS code plugin for raw GTest. https://marketplace.visualstudio.com/items?itemName=DavidSchuldenfrei.gtest-adapter

jonthysell commented 2 years ago

I'm not sure if we're ever going to get new 1.10 binaries out of https://github.com/microsoft/TestAdapterForGoogleTest

mythrz commented 1 year ago

even the documentation is not explicit/clear about this