Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.
Merged
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
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ jobs:
"e2e_ganache",
"e2e_mosaic",
"e2e_browsers",
"e2e_gnosis_dex"
]
env:
TEST: ${{ matrix.testCmd }}
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"test:e2e:truffle": "./scripts/e2e.truffle.sh",
"test:e2e:mosaic": "./scripts/e2e.mosaic.sh",
"test:e2e:ganache:core": "./scripts/e2e.ganache.core.sh",
"test:e2e:gnosis:dex": "./scripts/e2e.gnosis.dex.sh",
"ci": "./scripts/ci.sh",
"cov:clean": "rm -rf .nyc_output; rm -rf coverage",
"cov:merge_reports": "nyc report --reporter=lcov --reporter=html"
Expand Down
7 changes: 6 additions & 1 deletion scripts/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ elif [ "$TEST" = "unit_and_e2e_clients" ]; then
npm run test:e2e:geth:insta
npm run test:e2e:geth:auto
npm run test:unit
npm run cov:merge_reports
npm run cov:merge_reports

elif [ "$TEST" = "e2e_browsers" ]; then

Expand Down Expand Up @@ -54,4 +54,9 @@ elif [ "$TEST" = "e2e_ganache" ]; then
npm run test:e2e:publish
npm run test:e2e:ganache:core

elif [ "$TEST" = "e2e_gnosis_dex" ]; then

npm run test:e2e:publish
npm run test:e2e:gnosis:dex

fi
57 changes: 57 additions & 0 deletions scripts/e2e.gnosis.dex.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# -------------------------------------------------------------------------------------------
# Run gnosis/dex-react using a candidate branch of web3 which has been published to a
# proxy npm registry in `e2e.npm.publish.sh`
#
# The test's purpose is to verify web3 latest state runs successfully on an actively
# developed production project which uses.
# + react
# + webpack production build
# + typescript compilation
# + ~200 jest tests
# --------------------------------------------------------------------------------------------

# Exit immediately on error
set -o errexit

# To mimic `npm install web3` correctly, this test does not install Web3's dev deps.
# However, we need the npm package `semver` to coerce yarn resolutions correctly.
# It must be installed as a dev dep or Node complains. We also need web3's package.json
# to resolve the current version + patch increment. So some file renaming is necessary here...
cp package.json original.package.json
rm package.json
rm package-lock.json
npm init --yes
npm install --save-dev semver

# Install mosaic and set yarn resolutions to virtually published patch version
git clone https://github.com/gnosis/dex-react.git
scripts/js/resolutions.js dex-react
cd dex-react

# Install via registry and verify
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo "Installing updated web3 via virtual registry "
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"

yarn --registry http://localhost:4873

yarn list web3
yarn list web3-utils
yarn list web3-core
yarn list web3-core-promievent

cat ./package.json

# Build
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo "Running gnosis/dex-react: build "
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"

npm run build

# Test
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo "Running gnosis/dex-react: test "
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"

npm test
46 changes: 0 additions & 46 deletions scripts/e2e.truffle.sh

This file was deleted.

67 changes: 45 additions & 22 deletions scripts/js/resolutions.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,28 +28,51 @@ const targetPackage = require(targetPackagePath);
// in e2e.npm.publish.sh)
const version = semver.inc(web3Package.version, 'minor');

targetPackage.resolutions = {
"@nomiclabs/**/web3": `${version}`,
"@nomiclabs/**/web3-bzz": `${version}`,
"@nomiclabs/**/web3-core-helpers": `${version}`,
"@nomiclabs/**/web3-core-method": `${version}`,
"@nomiclabs/**/web3-core-promievent": `${version}`,
"@nomiclabs/**/web3-core-requestmanager": `${version}`,
"@nomiclabs/**/web3-core-subscriptions": `${version}`,
"@nomiclabs/**/web3-core": `${version}`,
"@nomiclabs/**/web3-eth-abi": `${version}`,
"@nomiclabs/**/web3-eth-accounts": `${version}`,
"@nomiclabs/**/web3-eth-contract": `${version}`,
"@nomiclabs/**/web3-eth-ens": `${version}`,
"@nomiclabs/**/web3-eth-iban": `${version}`,
"@nomiclabs/**/web3-eth-personal": `${version}`,
"@nomiclabs/**/web3-eth": `${version}`,
"@nomiclabs/**/web3-net": `${version}`,
"@nomiclabs/**/web3-providers-http": `${version}`,
"@nomiclabs/**/web3-providers-ipc": `${version}`,
"@nomiclabs/**/web3-providers-ws": `${version}`,
"@nomiclabs/**/web3-shh": `${version}`,
"@nomiclabs/**/web3-utils": `${version}`
const web3Modules = [
"web3",
"web3-bzz",
"web3-core-helpers",
"web3-core-method",
"web3-core-promievent",
"web3-core-requestmanager",
"web3-core-subscriptions",
"web3-core",
"web3-eth-abi",
"web3-eth-accounts",
"web3-eth-contract",
"web3-eth-ens",
"web3-eth-iban",
"web3-eth-personal",
"web3-eth",
"web3-net",
"web3-providers-http",
"web3-providers-ipc",
"web3-providers-ws",
"web3-shh",
"web3-utils"
];


targetPackage.resolutions = {};

// Coerce every version of web3 in the sub-dependency tree to
// the virtually published version
for ( const mod of web3Modules ){
targetPackage.resolutions[`*/**/${mod}`] = version;
}

// Remove any outer-level web3 modules so yarn flat-packs a single
// set of web3 modules at the outerlevel
if (targetPackage.devDependencies){
for ( const mod of web3Modules ){
delete targetPackage.devDependencies[mod];
}
}

if (targetPackage.dependencies){
for ( const mod of web3Modules ){
delete targetPackage.dependencies[mod];
}
}

console.log(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
Expand Down