Skip to content

test(interop): update transport script for unified-testing#2190

Closed
rlve wants to merge 3 commits into
masterfrom
test-interop-3
Closed

test(interop): update transport script for unified-testing#2190
rlve wants to merge 3 commits into
masterfrom
test-interop-3

Conversation

@rlve

@rlve rlve commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Update Transport interop test script to be compatible with new Unified testing repo (see https://github.com/libp2p/unified-testing/blob/master/docs/write-a-transport-test-app.md).

Tested against a fork rlve/unified-testing#1 for now. Currently python-v0.x (ws) is failing against nim-v1.15.

╲ Collecting results...
 ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  → Results:
    → Total: 55
    ✓ Passed: 52
    ✗ Failed: 3
    - python-v0.x x nim-v1.15 (ws, noise, mplex)
    - nim-v1.15 x python-v0.x (ws, noise, yamux)
    - nim-v1.15 x python-v0.x (ws, noise, mplex)

  → Total time: 00:17:05

  ✗ 3 test(s) failed

Warning

Currently the new repo doesn't support using their actions on the implementation side, that's why run-transport-interop job has to be disabled and the required check turned off.

Affected Areas

  • Tests

@rlve rlve marked this pull request as ready for review March 25, 2026 12:35
@rlve rlve requested review from a team, Copilot, gmelodie, richard-ramos and vladopajic March 25, 2026 12:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the transport interoperability test app and CI workflow to align nim-libp2p’s transport interop with libp2p’s newer unified-testing conventions.

Changes:

  • Update interop/transport/main.nim to use unified-testing environment variables, namespaced Redis keys, and a new stdout result format.
  • Disable the legacy run-transport-interop GitHub Actions job (pending unified-testing support for implementation-side actions).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
interop/transport/main.nim Switches to unified-testing env var names, uses TEST_KEY for Redis key namespacing, and changes result output format.
.github/workflows/interop.yml Comments out the legacy transport interop job while leaving other interop jobs intact.

Comment on lines +18 to +20
isDialer = getEnv("IS_DIALER") == "true"
testKey = getEnv("TEST_KEY")
envIp = getEnv("LISTENER_IP", "0.0.0.0")

Copilot AI Mar 25, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TEST_KEY is used to namespace the Redis list key, but getEnv("TEST_KEY") defaults to an empty string when unset. If it’s missing, this app will read/write to the shared key _listener_multiaddr, which can cause cross-test interference when multiple transport tests run concurrently. Consider validating that TEST_KEY is non-empty at startup (and quitting with a clear error) before using it to build Redis keys.

Copilot uses AI. Check for mistakes.
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.69%. Comparing base (7019e35) to head (07cbabd).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2190      +/-   ##
==========================================
+ Coverage   72.64%   72.69%   +0.04%     
==========================================
  Files         155      155              
  Lines       19279    19279              
  Branches       19       19              
==========================================
+ Hits        14006    14015       +9     
+ Misses       5273     5264       -9     

see 6 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

uses: jlumbroso/free-disk-space@v1.3.1
with:
tool-cache: true
# run-transport-interop:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we are not going to need this why keep it cmmented?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't remove it as I'm not sure if it's not supported by design or not supported just yet. From what I saw it should be fairly easy to modify to run it here as well.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please consider always removing as much code as possible (unnecessary code). what you can do here to be more specific is:

# run-transport-interop:
#   currently this job is not implemented because of this and that. and it will be added later on after this and that

@vladopajic vladopajic Mar 25, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that is remove all comments of old implementation right away. it is dead code

@github-project-automation github-project-automation Bot moved this from new to In Progress in nim-libp2p Mar 25, 2026
Comment on lines -96 to +100
echo Json.encode(
ResultJson(
handshakePlusOneRTTMillis: float(totalDelay.milliseconds),
pingRTTMilllis: float(pingDelay.milliseconds),
)
)
echo "latency:"
echo " handshake_plus_one_rtt: " & $float(totalDelay.milliseconds)
echo " ping_rtt: " & $float(pingDelay.milliseconds)
echo " unit: ms"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what type of output it is now?
if it is json we should use json, if it yaml. we should marshal some object with yaml

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it requires yaml output to stdout

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because looking in the code it is not clear what is going on. would be bettert ot have some object that is marshaled to stdout

echo Yaml.marshal(result)

@rlve rlve marked this pull request as draft March 26, 2026 08:34
@rlve rlve closed this Mar 26, 2026
@github-project-automation github-project-automation Bot moved this from In Progress to done in nim-libp2p Mar 26, 2026
@rlve rlve deleted the test-interop-3 branch June 1, 2026 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants