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

test: Add Electron Transport Interop Ping Test #3036

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ jobs:
- uses: libp2p/test-plans/.github/actions/run-transport-interop-test@master
with:
test-filter: js-libp2p-head
extra-versions: ${{ github.workspace }}/interop/node-version.json ${{ github.workspace }}/interop/chromium-version.json ${{ github.workspace }}/interop/firefox-version.json ${{ github.workspace }}/interop/webkit-version.json
extra-versions: ${{ github.workspace }}/interop/node-version.json ${{ github.workspace }}/interop/chromium-version.json ${{ github.workspace }}/interop/firefox-version.json ${{ github.workspace }}/interop/webkit-version.json ${{ github.workspace }}/interop/electron-version.json
s3-cache-bucket: ${{ vars.S3_LIBP2P_BUILD_CACHE_BUCKET_NAME }}
s3-access-key-id: ${{ vars.S3_LIBP2P_BUILD_CACHE_AWS_ACCESS_KEY_ID }}
s3-secret-access-key: ${{ secrets.S3_LIBP2P_BUILD_CACHE_AWS_SECRET_ACCESS_KEY }}
Expand Down
6 changes: 6 additions & 0 deletions interop/ElectronDockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ARG BASE_IMAGE=node-js-libp2p-head
FROM ${BASE_IMAGE}

WORKDIR /app/interop

ENTRYPOINT npm test -- -t electron-main
7 changes: 6 additions & 1 deletion interop/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
image_name := js-libp2p-head

all: image.json firefox-image.json chromium-image.json webkit-image.json
all: image.json firefox-image.json chromium-image.json webkit-image.json electron-image.json

image.json:
cd .. && docker build -f interop/Dockerfile -t node-${image_name} .
Expand All @@ -22,6 +22,11 @@ webkit-image.json: image.json
docker image inspect webkit-${image_name} -f "{{.Id}}" | \
xargs -I {} echo "{\"imageID\": \"{}\"}" > $@

electron-image.json: image.json
cd .. && docker build -f interop/ElectronDockerfile --build-arg=BASE_IMAGE=node-${image_name} -t electron-${image_name} .
docker image inspect electron-${image_name} -f "{{.Id}}" | \
xargs -I {} echo "{\"imageID\": \"{}\"}" > $@

.PHONY: clean

clean:
Expand Down
8 changes: 8 additions & 0 deletions interop/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ $ npm i @libp2p/multidim-interop
- [Build js-libp2p](#build-js-libp2p)
- [node.js](#nodejs)
- [Browsers](#browsers)
- [Electron](#electron)
- [Build another libp2p implementation](#build-another-libp2p-implementation)
- [Running Redis](#running-redis)
- [Start libp2p](#start-libp2p)
Expand Down Expand Up @@ -50,6 +51,13 @@ $ npm run build
$ docker build . -f ./interop/BrowserDockerfile -t js-libp2p-browsers
```

#### Electron

```console
$ npm run build
$ docker build . -f ./interop/ElectronDockerfile -t js-libp2p-electron
```

### Build another libp2p implementation

1. Clone the test-plans repo somewhere
Expand Down
16 changes: 16 additions & 0 deletions interop/electron-version.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"id": "electron-js-libp2p-head",
"containerImageID": "electron-js-libp2p-head",
"transports": [
"tcp",
"ws",
{
"name": "wss",
"onlyDial": true
},
"webrtc",
"webrtc-direct"
],
"secureChannels": ["noise"],
"muxers": ["yamux", "mplex"]
}
Loading