Skip to content

Add CDP-JSI integration tests#43027

Closed
motiz88 wants to merge 1 commit into
facebook:mainfrom
motiz88:export-D53756996
Closed

Add CDP-JSI integration tests#43027
motiz88 wants to merge 1 commit into
facebook:mainfrom
motiz88:export-D53756996

Conversation

@motiz88

@motiz88 motiz88 commented Feb 14, 2024

Copy link
Copy Markdown
Contributor

Summary:
Changelog: [Internal]

Adds a test suite for the integration between the modern RN CDP backend and Hermes (plus potentially other JS engines), mocking out the rest of RN.

For simplicity, everything is single-threaded and "async" work is actually done through a queued immediate executor ( = run immediately and finish all queued sub-tasks before returning).

The main limitation of the simpler threading model is that we can't cover breakpoints etc - since pausing during JS execution would prevent the test from making progress. Such functionality is better suited for a full RN+CDP integration test (using RN's own thread management) as well as for each engine's unit tests.

Types of tests in this diff

  • TEST_F(JsiIntegrationHermesTest, ...) - tests specific to the Hermes integration.
  • TYPED_TEST(JsiIntegrationPortableTest, ...) - tests that should pass on all engines.
    • These use gtest's typed tests feature.
    • This is a good fit for testing CDP features that have no strict dependency on Hermes (like the upcoming Runtime.addBinding support). Long term, aspirationally, all tests should be in this category, covering a consistent baseline of CDP features needed for debugging with any supported engine.
    • The first "non-Hermes" engine we test against (GenericEngineAdapter) is actually Hermes in disguise, minus any Hermes-specific CDP handling. We could conceivably add more engines here, as long as we have the ability to build them (and their JSI bindings) as part of building the tests.

Differential Revision: D53756996

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 14, 2024
@facebook-github-bot

Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D53756996

Summary:
Changelog: [Internal]

Adds a test suite for the integration between the modern RN CDP backend and Hermes (plus potentially other JS engines), mocking out the rest of RN.

For simplicity, everything is single-threaded and "async" work is actually done through a queued immediate executor ( = run immediately and finish all queued sub-tasks before returning).

The main limitation of the simpler threading model is that we can't cover breakpoints etc - since pausing during JS execution would prevent the test from making progress. Such functionality is better suited for a full RN+CDP integration test (using RN's own thread management) as well as for each engine's unit tests.

## Types of tests in this diff

* `TEST_F(JsiIntegrationHermesTest, ...)` - tests specific to the Hermes integration.
* `TYPED_TEST(JsiIntegrationPortableTest, ...)` - tests that should pass on all engines.
  * These use gtest's [typed tests](https://google.github.io/googletest/advanced.html#typed-tests) feature.
  * This is a good fit for testing CDP features that have no strict dependency on Hermes (like the upcoming `Runtime.addBinding` support). **Long term**, aspirationally, all tests should be in this category, covering a consistent baseline of CDP features needed for debugging with any supported engine.
  * The first "non-Hermes" engine we test against (`GenericEngineAdapter`) is actually Hermes in disguise, minus any Hermes-specific CDP handling. We could conceivably add more engines here, as long as we have the ability to build them (and their JSI bindings) as part of building the tests.

bypass-github-export-checks

Reviewed By: huntie

Differential Revision: D53756996
@facebook-github-bot

Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D53756996

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Feb 14, 2024
@facebook-github-bot

Copy link
Copy Markdown
Contributor

This pull request has been merged in 7b00a92.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants