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

Add Drizzle tests #5467

Merged
merged 15 commits into from
Oct 10, 2018
Merged

Add Drizzle tests #5467

merged 15 commits into from
Oct 10, 2018

Conversation

brunobar79
Copy link
Contributor

@brunobar79 brunobar79 commented Oct 9, 2018

This PR adds a drizzle app to our test suite as the initial step towards making sure we don't break web3 1.0 / drizzle support in the future.

For now the only test we have is just to check that we're exposing the address correctly but ideally we should check other basic stuff like send eth / tokens and ideally subs. Since all the workflow is already in place it should be pretty easy to add additional scenarios.

@metamaskbot
Copy link
Collaborator

Builds ready [a3f6b96]: mascara, chrome, firefox, edge, opera

@whymarrh
Copy link
Contributor

whymarrh commented Oct 9, 2018

I think this has merit. I think that we shouldn't have this in the same repository though as this will incur a large maintenance overhead.

I noticed that in #5450 Dan linked to his issue-5425-repro repository—I think it might be best if we kept these as separate repositories and somehow introduced a generalized way of testing external dapps against each MM build. That way we could allow users to submit dapps as test cases. That way we could (one day) test against the top N dapps. Thoughts? 🤔

@brunobar79
Copy link
Contributor Author

brunobar79 commented Oct 9, 2018

@whymarrh I understand your point and I think it’s fair.

I should have added some emphasis that the main goal of this PR is not to test drizzle itself but to make sure we don’t break compatibility with web3 1.0 (which should be part of our test suite after the provider subs branch gets merged into dev). We used drizzle because it’s probably the most popular framework using it, and yesterday while debugging the subs issue we agreed that it was necessary to add it to the test suite.

Regarding maintanability, there’s a package.json inside drizzle-test where we can bump major versions of truffle or drizzle. That should be all we need to maintain.

EDIT : added truffle unbox drizzle so we always get the latest version of it and it doesn't need any extra maintenance other than make sure the tests still pass

Pinging @danfinlay @kumavis @thuang to hear their opinions.

@metamaskbot
Copy link
Collaborator

Builds ready [b13a1d6]: mascara, chrome, firefox, edge, opera

@brunobar79 brunobar79 changed the base branch from provider-subs to develop October 9, 2018 17:25
@danfinlay
Copy link
Contributor

I think you both have good points:

  • This ensures we don't break Drizzle
  • This adds a lot of overhead to the suite.

Part of me agrees with Whymarrh, thinking maybe we could just periodically run "the larger test suite" before a release, but that just postpones fixing new bugs. I tend to think this is kindof exactly what the test suite is for, and as long as we run it in parallel, it should be fine to add, right?

@whymarrh
Copy link
Contributor

whymarrh commented Oct 9, 2018

I think this is a fine addition, as my main (only?) concern was the bloat included from truffle unbox drizzle which is no longer an issue.

Copy link
Contributor

@whymarrh whymarrh left a comment

Choose a reason for hiding this comment

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

Can we drop the changes to the package-lock.json file? They seem unneeded.

@metamaskbot
Copy link
Collaborator

Builds ready [af2fced]: mascara, chrome, firefox, edge, opera

@brunobar79
Copy link
Contributor Author

@whymarrh done

this.bail(true)

before(async function () {
switch (process.env.SELENIUM_BROWSER) {
Copy link
Member

Choose a reason for hiding this comment

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

This selenium bootstrapping should be extracted into a utility (I'm sure it already is somewhere). You shouldn't need more than a line or two for this generic setup

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good! l’ll handle tomorrow.

@@ -6,5 +6,5 @@ set -o pipefail

export PATH="$PATH:./node_modules/.bin"

shell-parallel -s 'npm run ganache:start -- -b 2' -x 'sleep 5 && static-server test/e2e/beta/contract-test/ --port 8080' -x 'sleep 5 && mocha test/e2e/beta/metamask-beta-ui.spec'
shell-parallel -s 'npm run ganache:start -- -d -b 2' -x 'sleep 5 && static-server test/e2e/beta/contract-test/ --port 8080' -x 'sleep 5 && mocha test/e2e/beta/from-import-beta-ui.spec'
Copy link
Member

Choose a reason for hiding this comment

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

Why this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because there’s nothing on that spec that requires the static server

})


describe('New UI setup', async function () {
Copy link
Member

Choose a reason for hiding this comment

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

All this generic init tests should also be abstracted into a library

Copy link
Contributor

@whymarrh whymarrh left a comment

Choose a reason for hiding this comment

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

I'm cool with these changes as-is. The suggestions @kumavis made could maybe be a separate PR since they'd touch other e2e tests.

@kumavis
Copy link
Member

kumavis commented Oct 10, 2018

Agree with @whymarrh about making it a separate PR

@kumavis kumavis merged commit ccab4ee into develop Oct 10, 2018
@kumavis kumavis deleted the drizzle-tests branch October 10, 2018 05:12
@brunobar79
Copy link
Contributor Author

brunobar79 commented Oct 10, 2018

@whymarrh @kumavis Just created a new issue (#5488) to discuss with @tmashuang and @danjm what would be the best approach for this and will fix in a separate PR.

Bunjin pushed a commit that referenced this pull request Nov 6, 2018
* added drizzle app for testing

* working

* clean up

* clean up script

* make build step required

* add drizzle-tests to .eslintignore

* clean up drizzle run script

* lint

* use truffle unbox

* undo eslintignore changes

* revert change

* dont use global

* dont need this steps

* use the new account flow

* restore package-lock.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants