ansible-collections / community.hashi_vault

Ansible collection for managing and working with HashiCorp Vault.
https://docs.ansible.com/ansible/devel/collections/community/hashi_vault/index.html
GNU General Public License v3.0
80 stars 58 forks source link

Ci/docker compose pyyaml cython -- unit mock assertions #390

Closed briantist closed 11 months ago

briantist commented 11 months ago
SUMMARY

CI is failing recently on local integration testing due to some dependency issues. docker-compose depends on pyyaml<6 whose installation is broken with the newly released cython==3.

Until someone fixes things in a way that doesn't require a workaround, we're putting a workaround in place.

Also took this opportunity to remove six and a constraint for py2.7 since we don't support it anymore.


Another error has been revealed: we had several instances of assert some_mock.called_once_with(...) which is a classic error; the method name is assert_called_once_with and since the mock returns a MagicMock for all members that don't exist, the incorrect form always asserts True.

It seems that in python 3.12 this case has been caught as a probable error, and our CI is failing on these:

ISSUE TYPE
codecov[bot] commented 11 months ago

Codecov Report

Merging #390 (9baadab) into main (1bf76d5) will not change coverage. The diff coverage is 100.00%.

:exclamation: Current head 9baadab differs from pull request most recent head 6bf5d9f. Consider uploading reports for the commit 6bf5d9f to get more accurate results

@@           Coverage Diff           @@
##             main     #390   +/-   ##
=======================================
  Coverage   98.86%   98.86%           
=======================================
  Files          82       82           
  Lines        4235     4235           
  Branches      455      455           
=======================================
  Hits         4187     4187           
  Misses         39       39           
  Partials        9        9           
Flag Coverage Δ
env_docker-default 98.86% <100.00%> (ø)
integration 81.31% <ø> (ø)
sanity 39.49% <ø> (ø)
target_auth_approle 89.47% <ø> (ø)
target_auth_aws_iam 50.00% <ø> (ø)
target_auth_azure 53.84% <ø> (ø)
target_auth_cert 86.36% <ø> (ø)
target_auth_jwt 91.30% <ø> (ø)
target_auth_ldap 89.47% <ø> (ø)
target_auth_none 100.00% <ø> (ø)
target_auth_token 71.42% <ø> (ø)
target_auth_userpass 85.71% <ø> (ø)
target_connection_options 74.76% <ø> (ø)
target_controller 83.93% <ø> (ø)
target_filter_vault_login_token 77.77% <ø> (ø)
target_import 39.49% <ø> (ø)
target_lookup_hashi_vault 81.33% <ø> (ø)
target_lookup_vault_ansible_settings 56.07% <ø> (ø)
target_lookup_vault_kv1_get 91.30% <ø> (ø)
target_lookup_vault_kv2_get 91.11% <ø> (ø)
target_lookup_vault_list 90.00% <ø> (ø)
target_lookup_vault_login 88.57% <ø> (ø)
target_lookup_vault_read 90.00% <ø> (ø)
target_lookup_vault_token_create 79.24% <ø> (ø)
target_lookup_vault_write 57.14% <ø> (ø)
target_module_utils 97.48% <100.00%> (ø)
target_module_vault_kv1_get 87.50% <ø> (ø)
target_module_vault_kv2_delete 56.93% <ø> (ø)
target_module_vault_kv2_get 87.23% <ø> (ø)
target_module_vault_kv2_write 57.32% <ø> (ø)
target_module_vault_list 85.71% <ø> (ø)
target_module_vault_login 83.72% <ø> (ø)
target_module_vault_pki_generate_certificate 78.72% <ø> (ø)
target_module_vault_read 85.71% <ø> (ø)
target_module_vault_token_create 91.66% <ø> (ø)
target_module_vault_write 56.25% <ø> (ø)
target_modules 82.09% <ø> (ø)
units 95.55% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...s/module_utils/authentication/test_auth_aws_iam.py 100.00% <100.00%> (ø)
...ins/module_utils/authentication/test_auth_azure.py 100.00% <100.00%> (ø)