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 end to end tests to the "showCommandCmdF" mmctl command #15943
Comments
I would like to give this issue a shot! |
Sure @djanda97, thanks for taking a look at the issue!! |
I am having some trouble building mmctl. When I cloned a fresh copy and ran Do you have any ideas about what could be causing this error? |
@djanda97 try pulling the latest master |
I was successfully able to build mmctl and run the existing e2e tests, however I can't find the |
@djanda97 You should create the file |
Great, thanks! |
Hi @djanda97! Are you still planning to work on this issue? Is there anything we can help with? |
Hi @mgdelacroix! Yes, I still plan on working on this issue, I've just been busy with my new job. |
I would like to work on this please. |
Mattermost is increasing the end to end test coverage for the mmctl CLI tool. The goal is to create a suite of tests that check the main logic paths of each command and ensure that they work against a running server.
This Help Wanted issue covers the addition of end to end tests to the
showCommandCmdF
command, in thecommands/command.go
file. The expected way to add these tests is to create a test function in thecommands/command_e2e_test.go
file and add ones.Run
block for each possible test case.Thanks to the good amount of already existing unit tests that the commands have, it is not necessary to write an end to end test for every possible logic path of the command; the main focus should be in covering the happy path, the error path and the cases where the user doesn't have permissions to perform an action.
To help with the test process, there are some helpers that can be used. The
s.SetupTestHelper().InitBasic()
chain will create a set of default users, teams and channels to be used during the tests,s.RunForAllClients
is useful when a test case should be valid for a sysadmin user, a local mode user and an unprivileged user, ands.RunForSystemAdminAndLocal
will test a block for both a sysadmin user and a local mode user. Please take a look at the example pull request to see how all these work.Example: mattermost/mmctl#202
For instructions on how to set up the end to end tests, take a look at the corresponding section of the mmctl README.
If you have questions about the ticket or you need any help, feel free to post your question in the community CLI channel or contact
miguel.delacruz
in https://community.mattermost.com/If you're interested please comment here and come join our "Contributors" community channel on our daily build server, where you can discuss questions with community members and the Mattermost core team. For technical advice or questions, please join our "Developers" community channel.
New contributors please see our Developer's Guide.
JIRA: https://mattermost.atlassian.net/browse/MM-29565
The text was updated successfully, but these errors were encountered: