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

[sui CLI] Unit test Sui cli - Part 2 #452

Merged
merged 3 commits into from
Feb 15, 2022
Merged

[sui CLI] Unit test Sui cli - Part 2 #452

merged 3 commits into from
Feb 15, 2022

Conversation

patrickkuo
Copy link
Contributor

  • implement execute for SuiCommand
  • test cli output for addresses and objects command
  • test_objects_command is an integration test starting up a network using Sui start and retrieve informations from the authorities.

This PR include moving Sui commands, wants to merge in earlier to unblock other task.

Base automatically changed from pat/cli-make-testable to main February 14, 2022 22:17
@patrickkuo patrickkuo force-pushed the pat/more-cli-tests branch 2 times, most recently from 155d2fe to 3926605 Compare February 14, 2022 22:24
@patrickkuo
Copy link
Contributor Author

patrickkuo commented Feb 14, 2022

There might be a bug in tracing-test crate, I couldn't get the traced_test macro working in the second test file, so I put all test in cli_test.rs for now, will investigate when have more bandwidth.

This PR tests synchronise and retrieve objects logic in Sui, should be good enough to ensure basic functionality working for Sui cli and the wallet, will add more test in future PR.

@patrickkuo patrickkuo marked this pull request as ready for review February 14, 2022 23:03
@patrickkuo patrickkuo linked an issue Feb 15, 2022 that may be closed by this pull request
Copy link
Contributor

@huitseeker huitseeker left a comment

Choose a reason for hiding this comment

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

There might be a bug in tracing-test crate, I couldn't get the traced_test macro to working in the second test file, so I put all test in cli_test.rs for now, will investigate when have more bandwidth.

I'm a bit confused: what was the original issue, in which configuration did you encounter it, and what was the workaround?

@patrickkuo
Copy link
Contributor Author

patrickkuo commented Feb 15, 2022

I'm a bit confused: what was the original issue, in which configuration did you encounter it, and what was the workaround?

I had 2 test files in the original configuration, "sui_tests.rs" and "wallet_tests.rs", one for each binary, the test in sui_tests.rs runs fine, the logs are printed to the console and logs_contains works as expected. However for the tests in second file, "wallet_tests.rs", logs are not printing to the console and logs_contain returns false every time, seems like it's not intercepting the logs.

All tests are annotated with the #[traced_test] macro, no other configuration needed.

The workaround is to put all the test in 1 file.

@patrickkuo patrickkuo merged commit a215f77 into main Feb 15, 2022
@patrickkuo patrickkuo deleted the pat/more-cli-tests branch February 15, 2022 21:24
mwtian pushed a commit that referenced this pull request Sep 12, 2022
mwtian pushed a commit to mwtian/sui that referenced this pull request Sep 29, 2022
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.

[fastx CLI] Unit test fastx cli and wallet
3 participants