Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added kotlin-libp2p to test-plans #264

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Interoperabilty and end to end test-plans for libp2p
# Interoperability and end to end test-plans for libp2p

[![Interop Dashboard](https://github.com/libp2p/test-plans/workflows/libp2p%20multidimensional%20interop%20test/badge.svg?branch=master)](https://github.com/libp2p/test-plans/actions/runs/5856749805/attempts/1#summary-15877151662)

Expand Down
7 changes: 5 additions & 2 deletions multidim-interop/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ RUST_SUBDIRS := $(wildcard impl/rust/*/.)
NIM_SUBDIRS := $(wildcard impl/nim/*/.)
ZIG_SUBDIRS := $(wildcard impl/zig/*/.)
JAVA_SUBDIRS := $(wildcard impl/java/*/.)
KOTLIN_SUBDIRS := $(wildcard impl/kotlin/*/.)

all: $(GO_SUBDIRS) $(JS_SUBDIRS) $(RUST_SUBDIRS) $(NIM_SUBDIRS) $(ZIG_SUBDIRS) $(JAVA_SUBDIRS)
all: $(GO_SUBDIRS) $(JS_SUBDIRS) $(RUST_SUBDIRS) $(NIM_SUBDIRS) $(ZIG_SUBDIRS) $(JAVA_SUBDIRS) $(KOTLIN_SUBDIRS)
$(JS_SUBDIRS):
$(MAKE) -C $@
$(GO_SUBDIRS):
Expand All @@ -18,5 +19,7 @@ $(ZIG_SUBDIRS):
$(MAKE) -C $@
$(JAVA_SUBDIRS):
$(MAKE) -C $@
$(KOTLIN_SUBDIRS):
$(MAKE) -C $@

.PHONY: $(GO_SUBDIRS) $(JS_SUBDIRS) $(RUST_SUBDIRS) $(NIM_SUBDIRS) $(ZIG_SUBDIRS) $(JAVA_SUBDIRS) all
.PHONY: $(GO_SUBDIRS) $(JS_SUBDIRS) $(RUST_SUBDIRS) $(NIM_SUBDIRS) $(ZIG_SUBDIRS) $(JAVA_SUBDIRS) ${KOTLIN_SUBDIRS} all
4 changes: 4 additions & 0 deletions multidim-interop/impl/kotlin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
kotlin-libp2p-*.zip
kotlin-libp2p-*
kotlin-libp2p-*/*
image.json
20 changes: 20 additions & 0 deletions multidim-interop/impl/kotlin/v0.2/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
image_name := kotlin-v0.1.0
erwin-kok marked this conversation as resolved.
Show resolved Hide resolved
commitSha := 10eb5f4109a3fa789b38553079aa0736dfa58201
Copy link
Contributor

Choose a reason for hiding this comment

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

Optional:

If you want to specify a branch instead of a commit sha, you can follow the pattern of creating a version.lock from here: https://github.com/libp2p/test-plans/pull/252/files#diff-ec9982cd1fe2ff166978a9f012d8c250aa7b2181d814eedd05dc2af191d02f89R20.

It creates a lock file that locks the expected sha256 of the contents of a branch.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for this suggestion, I added this mechanism as well.

Btw @MarcoPolo , two remarks:

  • If you put a '-' in front of a command in Makefile, it ignores when it fails. So, I do:
    -rm image.json
    -rm kotlin-libp2p-.zip
    -rm -rf kotlin-libp2p-

    If "image.json" is not present, it still continues removing the other files.
    This is different then in the Go Makefile. Just a suggestion (I can add it there as well if wanted)

  • In generator.ts the "redis_addr" was missing. Many/all implementations defaults on the address being "redis:6379". So, that works. In my implementation, the default was "localhost:6379" (to test locally), therefore it was not working in the GitHub build. Or do I miss something?

Copy link
Contributor

Choose a reason for hiding this comment

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

  1. Good to know. I didn’t know that. Thanks.
  2. The default is defined here: https://github.com/libp2p/test-plans/blob/master/multidim-interop/README.md. By default it should be redis:6379. In retrospect using local host may have been nicer, although I’m not sure it’s worth the effort to change and back port.

Copy link
Author

Choose a reason for hiding this comment

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

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for triggering the build @MarcoPolo !
Almost... I see that rust-v0.52 --> kotlin-v.0.2 doesn't work yet
So, I have something to work on... :-)

Copy link
Member

Choose a reason for hiding this comment

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

If you put a '-' in front of a command in Makefile, it ignores when it fails. So, I do:

Today I learned. Thanks!


all: image.json

image.json: kotlin-libp2p-${commitSha}
cd kotlin-libp2p-${commitSha} && IMAGE_NAME=${image_name} ../../../../dockerBuildWrapper.sh -f test-plans/Dockerfile .
docker image inspect ${image_name} -f "{{.Id}}" | \
xargs -I {} echo "{\"imageID\": \"{}\"}" > $@

kotlin-libp2p-${commitSha}:
wget -O kotlin-libp2p-${commitSha}.zip "https://github.com/erwin-kok/kotlin-libp2p/archive/${commitSha}.zip"
unzip -o kotlin-libp2p-${commitSha}.zip

.PHONY: clean all

clean:
rm image.json
rm kotlin-libp2p-*.zip
rm -rf kotlin-libp2p-*
6 changes: 6 additions & 0 deletions multidim-interop/versions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,10 @@ export const versions: Array<Version> = [
secureChannels: ["tls", "noise"],
muxers: ["mplex", "yamux"],
},
{
id: "kotlin-v0.2",
transports: ["tcp"],
secureChannels: ["noise"],
muxers: ["mplex"],
},
].map((v: Version) => (typeof v.containerImageID === "undefined" ? ({ ...v, containerImageID: canonicalImageIDLookup }) : v))