This repository was archived by the owner on Aug 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This extracts glue code that simplifies running interop against unreleased code of go-ipfs and js-ipfs packages from lerna monorepo. Makes it easier to demonstrate green CI and/or test end-to-end locally before submitting a PR.
- Loading branch information
Showing
4 changed files
with
94 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This script sets up the Rube Goldberg machine for testing against custom | ||
# revision of go-ipfs and js-ipfs (the latter being tricky due to lerna monorepo) | ||
# | ||
# It assumes IPFS_GO_EXEC or IPFS_JS_EXEC to be in env. | ||
# One can trigger this locally by exporting the same path as we do on CI. | ||
# For example, to run pubsub tests against go-ipfs and js-ipfs revision defined | ||
# in ./scripts/custom-runtime.sh one can: | ||
# | ||
# export IPFS_GO_EXEC=/tmp/go-ipfs/cmd/ipfs/ipfs | ||
# export IPFS_JS_EXEC=/tmp/js-ipfs/packages/ipfs/src/cli.js | ||
# export IPFS_JS_MODULE=/tmp/js-ipfs/packages/ipfs/dist/cjs/src/index.js | ||
# export IPFS_JS_HTTP_MODULE=/tmp/js-ipfs/packages/ipfs-http-client/dist/cjs/src/index.js | ||
# ./scripts/custom-runtime.sh | ||
# node bin/ipfs-interop.js -- -t node --grep "pubsub" | ||
|
||
set -eo pipefail | ||
|
||
WORKDIR=$(pwd) | ||
|
||
if [ "$IPFS_GO_EXEC" == /tmp/go-ipfs/cmd/ipfs/ipfs ]; then | ||
if [ ! -d /tmp/go-ipfs ]; then | ||
cd /tmp | ||
git clone https://github.com/ipfs/go-ipfs.git | ||
cd go-ipfs | ||
# set implementation to specific commit | ||
git checkout CHANGEME_GO | ||
make build | ||
fi | ||
fi | ||
|
||
if [ "$IPFS_JS_EXEC" == /tmp/js-ipfs/packages/ipfs/src/cli.js ]; then | ||
if [ ! -d /tmp/js-ipfs ]; then | ||
cd /tmp | ||
git clone https://github.com/ipfs/js-ipfs.git | ||
cd js-ipfs | ||
# set implementation to specific commit | ||
git checkout CHANGEME_JS | ||
npm install | ||
npm run build | ||
npm run link | ||
fi | ||
fi | ||
|
||
cd $WORKDIR | ||
|
||
|
||
# print overrides | ||
env | grep IPFS_ |