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

Extract logic and fix "contracts" command #971

Closed
wants to merge 3 commits into from

Conversation

macor161
Copy link
Contributor

@macor161 macor161 commented Nov 28, 2019

🦅 Pull Request

  • Fix broken contracts command
  • Extract logic to lib folder
  • Add tests

We should probably add more tests to this, but it's currently difficult because the command relies on process.cwd(). In a next iteration, we should add a cwd param so we can run it in the directory of our choice.

Another note: truffle returns a code 1 for the help command, so it's basically considered as an error by execa and it throws an exception. We may want to detect this and handle it correctly in a future iteration. -> Fixed.

🚨 Test instructions

aragpn contracts

@codecov
Copy link

codecov bot commented Nov 28, 2019

Codecov Report

Merging #971 into develop will increase coverage by 1.25%.
The diff coverage is 50%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #971      +/-   ##
===========================================
+ Coverage    19.66%   20.92%   +1.25%     
===========================================
  Files          111      112       +1     
  Lines         2537     2543       +6     
===========================================
+ Hits           499      532      +33     
+ Misses        2038     2011      -27
Impacted Files Coverage Δ
packages/aragon-cli/src/commands/contracts.js 0% <0%> (ø) ⬆️
packages/aragon-cli/src/lib/contracts.js 100% <100%> (ø)
packages/aragon-cli/src/util.js 53.59% <0%> (+3.92%) ⬆️
packages/aragon-cli/src/helpers/truffle-runner.js 80.95% <0%> (+80.95%) ⬆️
...ages/aragon-cli/scripts/setup-integration-tests.js 100% <0%> (+100%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 956208e...412e43d. Read the comment docs.

@0xGabi 0xGabi mentioned this pull request Nov 28, 2019
43 tasks
@theethernaut
Copy link
Contributor

@macor161 this command should be deprecated in v8, so I'm not sure if separating the logic is applicable anymore. However, I would definitely keep new tests around if they are included in the PR.

@0xGabi
Copy link
Contributor

0xGabi commented Dec 2, 2019

Agree with @ajsantander we should prevent move code to /lib

@macor161
Copy link
Contributor Author

macor161 commented Dec 5, 2019

Agreed, closing this and I'm going to add the tests in a new PR

@macor161 macor161 closed this Dec 5, 2019
@macor161 macor161 deleted the sdk7-contracts-command branch December 5, 2019 13:20
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.

3 participants