-
Notifications
You must be signed in to change notification settings - Fork 75
Closed
Labels
area/buildersArea: BuildersArea: Builders
Description
Description
Testground supports js test written for node, through the docker:node builder (legacy) and docker:generic.
We want to use Testgroung to test interoperability between different implementations of libp2p.
A critical need is to test browser-related features such as libp2p/specs#412
What defines this endeavour to be complete?
- Create an
example-browserplan with anhelloworldandfailuretests (see steps below), - Create a more complex test case that does a ping between a browser instance and a node instance, using composition files.
- Finally, the team should be able to reuse the code to implement the browser ping test in https://github.com/libp2p/test-plans
Plan
Step 1: Run an helloworld test
(merged in #1474)
- 1.1 Succes Test: create a testground PR with a
plans/example-browsertest- Likely will use the code from @GlenDC's playwright demo
- It starts the node process, using docker generic, and we call
yarn run testground - We won't use a server, we'll just start the browser, log an HelloWorld, then record a success
- 1.2 Failure test: create another case where we fail on purpose
- throw an error on the test.
- 1.3 Turn into integration tests
- add a new test in
./integration_tests/(feel free to update this ticket with questions)
- add a new test in
Step 2: Run the helloworld test from WITHIN the browser runtime
- Use the js-sdk from within the browser to record message, metrics, etc.
- We should end up with a "wrapper" that loads the browser and pass in the environment. Then the test lives in the browser.
- This "should" work, testground-sync service was rewritten a while ago to support connecting from a browser.
⚠️ we'll need to forward the environment variables for the testground SDK to work⚠️ we might have issues with loading the js-sdk in the browser (missing dist package, etc)
Work threads:
- sdk-js PR: first baby steps towards native browser support for the JS sdk of testground sdk-js#25
- testground PR: examples: add node & cross-browser example #1502
Step 3: Create a composition with node + js
- The high level goal is to create a ping-pong test between a node and a browser node.
Follow-up and other tasks
Discussion and notes raised during the talk about this feature:
- It would make sense to provide a typescript version of the js-sdk
- Think about:
- Porting tests from https://github.com/little-bear-labs/js-libp2p-webrtc/tree/ckousik/interop-test into the
libp2p/test-plansrepository, - implementing the interop tests in node
- implementing the interop tests in browser
- Porting tests from https://github.com/little-bear-labs/js-libp2p-webrtc/tree/ckousik/interop-test into the
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area/buildersArea: BuildersArea: Builders
Type
Projects
Status
✅ Done
Status
Done