quipucords / camayoc

Test automation framework that facilitates functional testing of quipucords.
https://camayoc.readthedocs.io/
GNU General Public License v3.0
5 stars 4 forks source link

Port CLI SSH key credential tests to DataProvider #408

Closed mirekdlugosz closed 1 year ago

mirekdlugosz commented 1 year ago

This is #407, but for CLI.

$ pytest -v camayoc/tests/qpc/cli/test_credentials.py
camayoc/tests/qpc/cli/test_credentials.py::test_add_with_username_password[vcenter] PASSED                                                                             [  4%]
camayoc/tests/qpc/cli/test_credentials.py::test_add_with_username_password[network] PASSED                                                                             [  8%]
camayoc/tests/qpc/cli/test_credentials.py::test_add_with_username_password[satellite] PASSED                                                                           [ 13%]
camayoc/tests/qpc/cli/test_credentials.py::test_add_with_username_password_become_password PASSED                                                                      [ 17%]
camayoc/tests/qpc/cli/test_credentials.py::test_add_with_username_sshkeyfile PASSED                                                                                    [ 21%]
camayoc/tests/qpc/cli/test_credentials.py::test_add_with_username_sshkeyfile_become_password PASSED                                                                    [ 26%]
camayoc/tests/qpc/cli/test_credentials.py::test_edit_username[vcenter] PASSED                                                                                          [ 30%]
camayoc/tests/qpc/cli/test_credentials.py::test_edit_username[network] PASSED                                                                                          [ 34%]
camayoc/tests/qpc/cli/test_credentials.py::test_edit_username[satellite] PASSED                                                                                        [ 39%]
camayoc/tests/qpc/cli/test_credentials.py::test_edit_username_negative PASSED                                                                                          [ 43%]
camayoc/tests/qpc/cli/test_credentials.py::test_edit_password[vcenter] PASSED                                                                                          [ 47%]
camayoc/tests/qpc/cli/test_credentials.py::test_edit_password[network] PASSED                                                                                          [ 52%]
camayoc/tests/qpc/cli/test_credentials.py::test_edit_password[satellite] PASSED                                                                                        [ 56%]
camayoc/tests/qpc/cli/test_credentials.py::test_edit_password_negative PASSED                                                                                          [ 60%]
camayoc/tests/qpc/cli/test_credentials.py::test_edit_sshkeyfile ERROR                                                                                                  [ 65%]
camayoc/tests/qpc/cli/test_credentials.py::test_edit_sshkeyfile_negative PASSED                                                                                        [ 69%]
camayoc/tests/qpc/cli/test_credentials.py::test_edit_become_password PASSED                                                                                            [ 73%]
camayoc/tests/qpc/cli/test_credentials.py::test_edit_become_password_negative PASSED                                                                                   [ 78%]
camayoc/tests/qpc/cli/test_credentials.py::test_edit_no_credentials PASSED                                                                                             [ 82%]
camayoc/tests/qpc/cli/test_credentials.py::test_clear PASSED                                                                                                           [ 86%]
camayoc/tests/qpc/cli/test_credentials.py::test_clear_with_source PASSED                                                                                               [ 91%]
camayoc/tests/qpc/cli/test_credentials.py::test_clear_negative PASSED                                                                                                  [ 95%]
camayoc/tests/qpc/cli/test_credentials.py::test_clear_all PASSED                                                                                                       [100%]
======================================================================== 22 passed, 1 error in 55.57s ========================================================================

This one failing test is tricky - it wants to update ssh key of credential to another ssh key. This could be achieved with DataProvider, but we would need to have a config with 2 different credentials using different existing SSH keys. So the fix would have to be also introduced in discovery-ci repo, and in the way we deploy Discovery.

This is all doable, but at this point I think whether there is any value in testing that at CLI level instead of API level, and whether we should just move this to quipucords unit test. So, I'm leaving it failing for now.

codecov[bot] commented 1 year ago

Codecov Report

Merging #408 (2c0952c) into master (ba78169) will not change coverage. The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #408   +/-   ##
=======================================
  Coverage   81.22%   81.22%           
=======================================
  Files           5        5           
  Lines         245      245           
=======================================
  Hits          199      199           
  Misses         46       46           

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more