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

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

Merged

Conversation

briantist
Copy link
Collaborator

@briantist briantist commented Jul 22, 2023

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
  • CI Pull Request
  • Tests Pull Request

@briantist briantist added bug Something isn't working ci Specifically related to the CI on this repo labels Jul 22, 2023
@briantist briantist self-assigned this Jul 22, 2023
@briantist briantist changed the title Ci/docker compose pyyaml cython Ci/docker compose pyyaml cython -- unit mock assertions Jul 22, 2023
@codecov
Copy link

codecov bot commented Jul 22, 2023

Codecov Report

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

❗ 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%> (ø)

@briantist briantist merged commit 6d3b276 into ansible-collections:main Jul 22, 2023
33 checks passed
@briantist briantist deleted the ci/docker-compose_pyyaml_cython branch July 23, 2023 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ci Specifically related to the CI on this repo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant