Skip to content

EPIC: implement Javascript & Browser support in Testground #1386

@KatarinaKeti

Description

@KatarinaKeti

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-browser plan with an helloworld and failure tests (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-browser test
    • 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)

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:

Step 3: Create a composition with node + js

Follow-up and other tasks

Discussion and notes raised during the talk about this feature:

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

✅ Done

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions