finch icon indicating copy to clipboard operation
finch copied to clipboard

feat: add `finch vm status` command

Open niklasmtj opened this issue 2 years ago • 5 comments

Issue #, if available: #23

Description of changes: Adding the finch vm status command.

Testing done: make && make lint && make test-unit since I did not yet updated the e2e tests where I need help to understand how to test the command

  • [x] I've reviewed the guidance in CONTRIBUTING.md

License Acceptance

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

niklasmtj avatar Dec 02 '22 15:12 niklasmtj

We also need e2e tests here.

ningziwen avatar Dec 02 '22 18:12 ningziwen

@niklasmtj Hey I see you pushed one commit labeled "apply pr feedback". We are still waiting for the changes of addressing other comments. Whenever you are ready, you can reply in the comments to let us know.

ningziwen avatar Dec 07 '22 18:12 ningziwen

Hey, thanks. I will do that. Before that i have to get more into the mock testing. But will to this in the next couple of days.

niklasmtj avatar Dec 07 '22 19:12 niklasmtj

Hey, I think I might need a helping hand here. I'm pretty new to Golang and have a hard time figuring out how the mocking is done. I did try to use the tests from the start or stop command to get a grasp on how to do it. I also got a couple of tests that are green but to be completely honest I don't know if this really tests the method in the right way. I will push my current tests and would appreciate any guidance on how to do it. Thank you in advance!

If this PR takes too long you can also go forward and finish it. Reading the results would also help me a lot to understand how it have to be done :)

niklasmtj avatar Dec 17 '22 17:12 niklasmtj

Hey, I think I might need a helping hand here. I'm pretty new to Golang and have a hard time figuring out how the mocking is done. I did try to use the tests from the start or stop command to get a grasp on how to do it. I also got a couple of tests that are green but to be completely honest I don't know if this really tests the method in the right way. I will push my current tests and would appreciate any guidance on how to do it. Thank you in advance!

If this PR takes too long you can also go forward and finish it. Reading the results would also help me a lot to understand how it have to be done :)

No rush for this change. I'm happy to use this PR to help you onboard Finch slowly. I will put comments in your existing change and give suggestions.

ningziwen avatar Dec 20 '22 18:12 ningziwen

Not a big deal but fyi :) https://github.com/runfinch/finch/blob/main/CONTRIBUTING.md?plain=1#L88

ningziwen avatar Jan 04 '23 19:01 ningziwen

Oh I'm sorry, this makes sense. Did not know this. Were used to use it as a reference for me of the things to do :)

niklasmtj avatar Jan 04 '23 20:01 niklasmtj

Started with the e2e tests but still trying to understand how to implement the tests that makes the most sense. I was thinking about adding one per each When block to see if the status command is returning the desired output.

In terms of syntax can I use the testVersion as a reference point?

niklasmtj avatar Jan 11 '23 20:01 niklasmtj

@niklasmtj

I was thinking about adding one per each When block to see if the status command is returning the desired output.

If you're referring to adding an It block to in each When block in https://github.com/runfinch/finch/blob/main/e2e/virtual_machine_test.go, then I think it makes sense.

In terms of syntax can I use the testVersion as a reference point?

Sure. Every file in the e2e package should have a consistent style. If more references are needed, you can also take a look at https://github.com/runfinch/common-tests/tree/main/tests.

davidhsingyuchen avatar Jan 11 '23 22:01 davidhsingyuchen

Hey, just added the e2e tests and ran make && make lint && make test-unit && make test-e2e which passed successfully. Will have a look at the conflicts if I'm able to resolve them by myself. ~But I guess I will need a bit of help here 😀~ Nevermind, seems to be an easier conflict than I thought. Testing it all through now.

niklasmtj avatar Jan 15 '23 15:01 niklasmtj