test quality: rubber-stamping, coverage gaps, and improvement opportunities #29
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Rubber-stamping (tests with no real coverage value)
test_config.py
test_returns_empty_dict_when_no_cache_key— tests Python'sdict.get()default, not application logictest_excludes_package_defaults— duplicate oftest_returns_empty_when_key_absent, same code pathtest_cache.py
test_different_paths_produce_different_keys— re-exercises the hash function already covered elsewheretest_docker_auth.py
test_key_contains_all_components,test_different_services_give_different_keys,test_different_scopes_give_different_keys— testing Python string formattingtest_returns_none_for_non_bearer_header— duplicates parse tests through a thin wrappertest_routes.py
test_root_contains_version— checks key exists, not that the value is correcttest_flush_specific_remote_echoes_remote— verifies input round-trips through a struct, proves nothing about flush logictest_flush_all_returns_flushed_structure— asserts key shapes during a no-op where nothing is flushedtest_storage.py
test_returns_http_url_for_secure_storage—securehas no effect onget_url, the test documents a bug without catching regressionstest_different_remotes_give_different_keys,test_different_directories_give_different_keys,test_docker_blob_different_digests_different_keys— testing string inequalitytest_virtual.py
test_path_error_is_non_empty_string,test_output_is_valid_yaml,test_merge_returns_bytes— trivial/redundanttest_helm_handler_is_registered— asserting a dict literal contains a keyBiggest missing coverage gaps
test_routes.py (worst offender)
local.uploadsuccess path, 409 (already exists), and 500 (S3 rollback) paths — all untestedlocal.deletesuccess, not-found, and S3 failure pathsdiscoverymodule — entirePOST /api/v1/artifacts/cacheandGET /api/v1/artifacts/{remote}routes are darkflushwith actual S3 objects and per-type targetingcontent-typebranch and OCI index manifest inferencetest_cache.py
cleanup_expired_index— completely untested despite being the most complex methodexceptfallbacks are verifiedtest_storage.py
exists,get_presigned_url,delete_object— zero testsdownload_objectsuccess path never reached (only 404 path tested)test_config.py
get_s3_config,get_redis_config,get_database_config— all untested including error branches with specific missing-var messagesMost impactful improvements
test_store_expires_30s_before_stated_time— freeze time instead of using ±2s tolerance; currently non-deterministictest_store_and_retrieve_etag/last_modified— mocks aren't state-aware so they don't verify the data written, only the shape returnedtest_flush_all_deletes_redis_keys— asserts call count but not the flushed key count in the response bodytest_cache_miss_marks_index_cached— checks it was called, not what args were passedtest_no_reload_when_file_unchanged— should patch_load_configand assertcall_count == 0to actually prove no reload happened