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

Automated testing is a PITA #77

Closed
mikeshultz opened this issue Mar 22, 2019 · 3 comments
Closed

Automated testing is a PITA #77

mikeshultz opened this issue Mar 22, 2019 · 3 comments
Labels
accounts-module devex Developer expierience, user experience enhancement New feature or request testing-module

Comments

@mikeshultz
Copy link
Owner

mikeshultz commented Mar 22, 2019

Automated testing is a PITA and shouldn't be. The only required command to test your contracts shouldn't have to be more than sb test [network].

Currently, the most annoying process is:

  1. Compile
  2. Create an account
  3. Somehow magically know the address of the new account and set the account as default
  4. Run test command

That's dumb. It should autocompile and autodeploy.

The account part is a little trickier. Using one provided by eth_tester, ganache, or whatever would deprive the user of a test account, and would probably be unexpected. And, since generally sb expects a local account to be used for deployment, would require a bunch of refactoring to do that.

Easiest solution to implement would be to allow the sb accounts create to set the first count as default(or an option to set the account as default).

The best solution may be to add a setting to networks.yml that allows accounts to be auto created and funded as needed. That would remove the whole block of code that solidbyte-test-project uses to autofund the deployer_account.

If that's done, an optional value setting (in wei) should be available as well.

@mikeshultz
Copy link
Owner Author

Possibly in addition to above, maybe there should be a default_test network that's implied to be in networks.yml. Then a user could run sb test without a network, and it would use that. This network would have autocompile, autodeploy, and use a randomly generated test deployer account.

It would also need to be disallowed to be defined in networks.yml.

@mikeshultz mikeshultz added the devex Developer expierience, user experience label Mar 22, 2019
mikeshultz added a commit that referenced this issue Mar 23, 2019
- adds ability to set a newly created account as default
- adds `use_default_account` setting to networks.yml
- accounts with this setting will autodeploy with the default network(if autodeploy_allowed is set, anyway)
- standardized `sb test` exit codes
- `sb test` autocompiles now
- account attribute is now not required for an instance of deployer, only for certain uses
- adds "stateless" test and deploy tests without using ganache

Issue #77
@mikeshultz
Copy link
Owner Author

Alright, so, use_default_account is now a setting in networks.yml. It defaults to False. But now sb test [network] will autocompile and deploy if autodeploy is on and default account use is enabled.

Also, sb accounts create --default will set the newly created account as default. Should make CI easier.

The default_test magic network should probably be split into another issue for consideration.

@mikeshultz
Copy link
Owner Author

default_test network idea moved to #79

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accounts-module devex Developer expierience, user experience enhancement New feature or request testing-module
Projects
None yet
Development

No branches or pull requests

1 participant