Skip to content

Conversation

@asmit27rai
Copy link

@asmit27rai asmit27rai commented Dec 12, 2025

No description provided.

@asmit27rai
Copy link
Author

@acul71 @sumanjeet0012 Please have a look

@acul71
Copy link
Contributor

acul71 commented Dec 13, 2025

@acul71 @sumanjeet0012 Please have a look

Comment for PR #756: WebRTC Interop Added

Hi @asmit27rai! Thanks for contributing WebRTC interop tests! However, I wanted to point out that the test-plans repository has been refactored to use a unified architecture, and the approach in this PR doesn't align with the current design.

The Refactored Architecture

The test-plans repo no longer contains implementation code for multiple languages. Instead:

  1. Implementations are defined in YAML (transport/impls.yaml) pointing to GitHub repos
  2. Test code lives in implementation repos (e.g., rust-libp2p/interop-tests/, go-libp2p/test-plans/)
  3. The test framework automatically:
    • Builds Docker images from implementation repos
    • Generates test matrices from impls.yaml
    • Runs interop tests using pure bash orchestration

Current WebRTC Support

WebRTC is already partially integrated into the transport test framework:

  • webrtc-direct is already listed for Rust and Go implementations in transport/impls.yaml
  • webrtc is listed for browser implementations (Chromium, Firefox, WebKit)
  • The framework already supports WebRTC as a standalone transport (no secure channel/muxer needed)

See:

What Should Be Done Instead

To properly add WebRTC interop tests:

1. Add WebRTC to transport/impls.yaml

For implementations that support WebRTC, add it to their transports list:

- id: python-v0.4
  source:
    type: github
    repo: libp2p/py-libp2p
    commit: <commit-sha>
    dockerfile: interop/transport/Dockerfile
  transports: [tcp, ws, wss, quic-v1, webrtc-direct]  # Add webrtc-direct here
  secureChannels: [noise]
  muxers: [mplex, yamux]

2. Ensure Implementation Repos Have WebRTC Test Code

Each implementation repo (rust-libp2p, go-libp2p, py-libp2p, js-libp2p) should have interop test code that:

  • Reads environment variables: TRANSPORT, IS_DIALER, REDIS_ADDR, SECURE_CHANNEL, MUXER
  • Uses Redis for coordination (listener publishes multiaddr, dialer retrieves it)
  • Follows the transport test pattern (see transport/CONTRIBUTING.md)

3. The Framework Generates Tests Automatically

Once WebRTC is in impls.yaml, the test framework will automatically:

  • Generate all WebRTC test combinations (dialer × listener × transport)
  • Build Docker images from implementation repos
  • Run tests in parallel
  • Generate results dashboards

Example: How JavaScript WebRTC Tests Work

The JavaScript implementations already have WebRTC support in transport/impls/js/:

  • They handle webrtc and webrtc-direct transport types
  • They use the standard environment variable pattern
  • They're integrated into the unified framework

Next Steps

  1. Close this PR (the standalone webrtc/ directory approach doesn't fit the architecture)
  2. Add WebRTC to transport/impls.yaml for implementations that support it
  3. Ensure each implementation repo has WebRTC interop test code following the transport test pattern
  4. Submit a new PR that only modifies transport/impls.yaml (and possibly implementation repos if needed)

Resources

The key insight is: the test-plans repo orchestrates tests, but doesn't contain implementation code. Each implementation repo contains its own interop test code, and the framework coordinates everything.

Let me know if you have questions about the architecture or need help integrating WebRTC into the existing framework!

@asmit27rai
Copy link
Author

@luca I added as you suggested.
FYI, the webrt-interop tests are implemented in the upstream PR : libp2p/py-libp2p@8f006a0

Should i change the structure of test in that repo too ??

@acul71
Copy link
Contributor

acul71 commented Dec 13, 2025

@luca I added as you suggested. FYI, the webrt-interop tests are implemented in the upstream PR : libp2p/py-libp2p@8f006a0

Should i change the structure of test in that repo too ??

Take a look at this directory: https://github.com/libp2p/py-libp2p/tree/main/interop/transport
This is where the files are taken from for actually build the docker python image and contains also the ping_test.py
You should modify ping_test.py to handle the new Webrtc protocol.
About the commitSha you should change it in impls.yaml and should be one commit that contains all to make the test pass (along with the previous ones) . If you need more than one commit, either you wait for only one, or you "hack" the build process to handle it
Are there any related PR that needs to be merged ?
ping me if you need help

@asmit27rai
Copy link
Author

@luca I added as you suggested. FYI, the webrt-interop tests are implemented in the upstream PR : libp2p/py-libp2p@8f006a0
Should i change the structure of test in that repo too ??

Take a look at this directory: https://github.com/libp2p/py-libp2p/tree/main/interop/transport This is where the files are taken from for actually build the docker python image and contains also the ping_test.py You should modify ping_test.py to handle the new Webrtc protocol. About the commitSha you should change it in impls.yaml and should be one commit that contains all to make the test pass (along with the previous ones) . If you need more than one commit, either you wait for only one, or you "hack" the build process to handle it Are there any related PR that needs to be merged ? ping me if you need help

@acul71
Thanks.
I will change and raise a PR for this in py-libp2p once the PR : libp2p/py-libp2p#780 .

@seetadev
Copy link
Collaborator

@asmit27rai , @acul71 and @sumanjeet0012 : Please resolve the CI/CD issue for webrtc interop tests.

Looking forward to re-running the CI/CD pipeline once the issue is resolved. Updated the branch.

@sumanjeet0012
Copy link
Contributor

@asmit27rai
I reviewed the CI/CD logs and observed that only the WebRTC interop test has failed. The results are as follows:

Results:
→ Total: 8
✓ Passed: 7
✗ Failed: 1

python-v0.4 x python-v0.4 (webrtc-direct)

WebRTC support in py-libp2p is still under active development, which is the reason for the failing test. Once the WebRTC-related PR is merged, we will re-run the CI/CD pipeline to verify whether WebRTC interop is functioning correctly.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants