Skip to content

Commit

Permalink
unit tests update (#7221)
Browse files Browse the repository at this point in the history
* timeout update

* fixed lockfile deps

* timout in setup.js

* continue v18 if err on v20

* node 20.17.0

* update nodev

* specific ver
  • Loading branch information
jdevcs committed Aug 28, 2024
1 parent f351e00 commit 9b32205
Show file tree
Hide file tree
Showing 17 changed files with 15 additions and 18 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
build:
strategy:
matrix:
node: [18, 20]
node: ['18', '20.17.0']
name: Build CJS
runs-on: ubuntu-latest
steps:
Expand All @@ -23,7 +23,7 @@ jobs:
with:
node-version: ${{ matrix.node }}
cache: yarn
- run: yarn install --ignore-scripts
- run: yarn install --ignore-scripts --frozen-lockfile
- run: npx ts-node scripts/init.ts
- run: yarn build:cjs
- uses: actions/cache/save@v4
Expand Down Expand Up @@ -165,7 +165,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [18, 20]
node: ['18', '20.17.0']
steps:
- uses: actions/setup-node@v4
with:
Expand All @@ -176,6 +176,7 @@ jobs:
path: ./
key: web3-${{ matrix.node }}-${{github.sha}}
- run: yarn test:unit
continue-on-error: ${{ matrix.node == '20.17.0' }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
Expand Down
1 change: 1 addition & 0 deletions packages/web3-core/test/config/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,5 @@ module.exports = {
* This can be done programmatically using jest.resetModules().
*/
resetModules: true,
testTimeout: 600000,
};
1 change: 1 addition & 0 deletions packages/web3-eth-abi/test/config/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,5 @@ module.exports = {
* This can be done programmatically using jest.resetModules().
*/
resetModules: true,
testTimeout: 600000,
};
1 change: 1 addition & 0 deletions packages/web3-eth-contract/test/config/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,5 @@ module.exports = {
* This can be done programmatically using jest.resetModules().
*/
resetModules: true,
testTimeout: 600000,
};
3 changes: 0 additions & 3 deletions packages/web3-eth-ens/test/integration/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,3 @@ along with web3.js. If not, see <http://www.gnu.org/licenses/>.
// eslint-disable-next-line @typescript-eslint/no-require-imports
require('../config/setup');

const jestTimeout = 30000;

jest.setTimeout(jestTimeout);
1 change: 1 addition & 0 deletions packages/web3-eth-personal/test/config/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,5 @@ module.exports = {
* This can be done programmatically using jest.resetModules().
*/
resetModules: true,
testTimeout: 600000,
};
3 changes: 0 additions & 3 deletions packages/web3-eth/test/e2e/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,3 @@ along with web3.js. If not, see <http://www.gnu.org/licenses/>.
// eslint-disable-next-line @typescript-eslint/no-require-imports
require('../config/setup');

const jestTimeout = 30000; // Sometimes `in3` takes long time because of its decentralized nature.

jest.setTimeout(jestTimeout);
1 change: 1 addition & 0 deletions packages/web3-net/test/config/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,5 @@ module.exports = {
* This can be done programmatically using jest.resetModules().
*/
resetModules: true,
testTimeout: 600000,
};
1 change: 1 addition & 0 deletions packages/web3-providers-ipc/test/config/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,5 @@ module.exports = {
resetModules: true,

resetMocks: true,
testTimeout: 600000,
};
1 change: 1 addition & 0 deletions packages/web3-types/test/config/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,5 @@ module.exports = {
* This can be done programmatically using jest.resetModules().
*/
resetModules: true,
testTimeout: 600000,
};
1 change: 1 addition & 0 deletions packages/web3-utils/test/config/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,5 @@ module.exports = {
* This can be done programmatically using jest.resetModules().
*/
resetModules: true,
testTimeout: 600000,
};
1 change: 1 addition & 0 deletions packages/web3-validator/test/config/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,5 @@ module.exports = {
* This can be done programmatically using jest.resetModules().
*/
resetModules: true,
testTimeout: 600000,
};
1 change: 1 addition & 0 deletions packages/web3/test/config/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,5 @@ module.exports = {
* This can be done programmatically using jest.resetModules().
*/
resetModules: true,
testTimeout: 600000,
};
3 changes: 0 additions & 3 deletions packages/web3/test/e2e/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,3 @@ along with web3.js. If not, see <http://www.gnu.org/licenses/>.
// eslint-disable-next-line @typescript-eslint/no-require-imports
require('../config/setup');

const jestTimeout = 30000; // Sometimes `in3` takes long time because of its decentralized nature.

jest.setTimeout(jestTimeout);
3 changes: 0 additions & 3 deletions packages/web3/test/integration/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,3 @@ along with web3.js. If not, see <http://www.gnu.org/licenses/>.
// eslint-disable-next-line @typescript-eslint/no-require-imports
require('../config/setup');

const jestTimeout = 30000; // Sometimes `in3` takes long time because of its decentralized nature.

jest.setTimeout(jestTimeout);
3 changes: 0 additions & 3 deletions packages/web3/test/stress/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,3 @@ along with web3.js. If not, see <http://www.gnu.org/licenses/>.
// eslint-disable-next-line @typescript-eslint/no-require-imports
require('../config/setup');

const jestTimeout = 300000;

jest.setTimeout(jestTimeout);
1 change: 1 addition & 0 deletions templates/jest.config.js.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,5 @@ module.exports = {
* This can be done programmatically using jest.resetModules().
*/
resetModules: true,
testTimeout: 600000,
};

1 comment on commit 9b32205

@github-actions
Copy link

Choose a reason for hiding this comment

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

Benchmark

Benchmark suite Current: 9b32205 Previous: f351e00 Ratio
processingTx 23392 ops/sec (±7.52%) 23021 ops/sec (±8.06%) 0.98
processingContractDeploy 40479 ops/sec (±6.69%) 39443 ops/sec (±6.86%) 0.97
processingContractMethodSend 16317 ops/sec (±6.87%) 16703 ops/sec (±6.80%) 1.02
processingContractMethodCall 27614 ops/sec (±8.40%) 27867 ops/sec (±6.76%) 1.01
abiEncode 46686 ops/sec (±6.17%) 44933 ops/sec (±6.90%) 0.96
abiDecode 31121 ops/sec (±7.84%) 31451 ops/sec (±6.18%) 1.01
sign 1556 ops/sec (±0.91%) 1556 ops/sec (±3.34%) 1
verify 369 ops/sec (±0.48%) 358 ops/sec (±0.76%) 0.97

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.