Skip to content
This repository has been archived by the owner on Jan 24, 2022. It is now read-only.

Migrates SDK CLI tests to test-environment #1288

Merged
merged 53 commits into from
Nov 27, 2019
Merged

Conversation

ylv-io
Copy link
Contributor

@ylv-io ylv-io commented Nov 21, 2019

This makes all tests in cli run using test-environment with Mocha and Chai instead of truffle test. On my machine, a clean run using this setup takes 3min 38s, while master takes 5min 02s. There is a massive difference on the time until the first test starts executing.

This PR is similar to a PR by @nventuro Migrate Lib tests.

Environment Truffle Test Test Environment % Gain
Local 4:35 3:38 ~21
CircleCI 5:33 4:59 ~10

Migration

  • Mocha, Chain and @openzeppelin/test-environment dependencies added.
  • Truffle contract statements replaced by describe.
  • Tests fixed.

I had to fix some tests due to differences how truffle test and test-env operate but they are rather small and trivial.
Screen Shot 2019-11-25 at 11 27 23 PM

image

PS Commit history is a mess. Sorry for that but it is possible to review only file changes.

nventuro and others added 27 commits November 20, 2019 18:56
`GSNRecipient` doesn't implement `_preRelayedCall` and `_postRelayedCall` so our `Counter` contract needs to otherwise it is abstract and can't be `oz create`d.

Add empty implementations of `_preRelayedCall` and `_postRelayedCall`
Remove version `npm install @openzeppelin/upgrades@2.4.0` as `@openzeppelin/upgrades@2.4.0` doesn't exist and to use the latest version.
Copy link
Contributor

@spalladino spalladino left a comment

Choose a reason for hiding this comment

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

Great work Igor! Left a minor suggestion, after addressed, it's good to merge for me.

packages/cli/package.json Outdated Show resolved Hide resolved
packages/cli/package.json Outdated Show resolved Hide resolved
Copy link
Contributor

@nventuro nventuro left a comment

Choose a reason for hiding this comment

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

Looks great! I left a couple minor comments and questions. There's a couple duplicated changes with the current master, but I'm not sure it'll be easy to improve that, given the mess I've made of the repo's history 😅

packages/cli/package.json Outdated Show resolved Hide resolved
packages/cli/test/models/Dependency.test.js Outdated Show resolved Hide resolved
packages/cli/test/scripts/balance.test.js Outdated Show resolved Hide resolved
packages/cli/test/scripts/transfer.test.js Outdated Show resolved Hide resolved
@ylv-io ylv-io requested a review from nventuro November 27, 2019 07:44
Copy link
Contributor

@nventuro nventuro left a comment

Choose a reason for hiding this comment

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

I made a commit moving some leftover account destructurings inside the describe blocks. Great work @ylv-io!

@nventuro nventuro added the status:ready-to-merge Order mergify to merge label Nov 27, 2019
@mergify mergify bot merged commit e5d011e into master Nov 27, 2019
@mergify mergify bot deleted the feature/test-env-cli branch November 27, 2019 16:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status:ready-to-merge Order mergify to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants