Skip to content

Instantly share code, notes, and snippets.

@GabiThume
Last active Dec 18, 2015
Embed
What would you like to do?
coverage of socorro unittest
Do not exist testing directory for: webapi.
Missing tests in lib:
['socorro/socorro/lib/productVersionCache.py', 'socorro/socorro/lib/dynamicConfigurationManager.py', 'socorro/socorro/lib/uuid.py', 'socorro/socorro/lib/threadlib.py', 'socorro/socorro/lib/stats.py', 'socorro/socorro/lib/httpclient.py']
All coverage in processor.
All coverage in database.
Do not exist testing directory for: othertests.
All coverage in storage.
Missing tests in app:
['socorro/socorro/app/example_app.py', 'socorro/socorro/app/fetch_transform_save_app.py']
Missing tests in monitor:
['socorro/socorro/monitor/monitor_app.py', 'socorro/socorro/monitor/crashstore_new_crash_source.py']
Do not exist testing directory for: deferredcleanup.
Do not exist testing directory for: unittest.
Missing tests in external:
['socorro/socorro/external/fs/crash_data.py', 'socorro/socorro/external/fs/crashstorage.py']
Missing tests in cron:
['socorro/socorro/cron/jobs/buggy.py']
Missing tests in middleware:
['socorro/socorro/middleware/crash_service.py', 'socorro/socorro/middleware/tcbs_service.py', 'socorro/socorro/middleware/crash_trends_service.py', 'socorro/socorro/middleware/products_service.py', 'socorro/socorro/middleware/bugs_service.py', 'socorro/socorro/middleware/signature_summary_service.py', 'socorro/socorro/middleware/crashes_exploitability_service.py', 'socorro/socorro/middleware/crontabber_state_service.py', 'socorro/socorro/middleware/crashes_comments_service.py', 'socorro/socorro/middleware/signature_urls_service.py', 'socorro/socorro/middleware/crashes_daily_service.py', 'socorro/socorro/middleware/crash_data_service.py', 'socorro/socorro/middleware/releases_featured_service.py', 'socorro/socorro/middleware/server_status_service.py', 'socorro/socorro/middleware/report_list_service.py', 'socorro/socorro/middleware/priorityjobs_service.py', 'socorro/socorro/middleware/extensions_service.py', 'socorro/socorro/middleware/platforms_service.py', 'socorro/socorro/middleware/versions_info_service.py', 'socorro/socorro/middleware/search_service.py', 'socorro/socorro/middleware/products_builds_service.py', 'socorro/socorro/middleware/field_service.py', 'socorro/socorro/middleware/crashes_paireduuid_service.py', 'socorro/socorro/middleware/job_service.py', 'socorro/socorro/middleware/correlations_service.py', 'socorro/socorro/middleware/crashes_frequency_service.py']
Do not exist testing directory for: integrationtest.
All coverage in services.
Missing tests in collector:
['socorro/socorro/collector/submitter.py', 'socorro/socorro/collector/submitter_app.py']
import os, subprocess, string
socorro = os.listdir("socorro/socorro/")
unittest = os.listdir("socorro/socorro/unittest/")
def search_diff(path_original, path_test):
diff = []
search = False
if os.path.isdir(path_original) and os.path.isdir(path_test):
dir_original = os.listdir(path_original)
dir_test = os.listdir(path_test)
else:
return diff
for original_file in dir_original:
if os.path.isdir(path_original+"/"+original_file):
return search_diff(path_original+"/"+original_file, path_test+"/"+original_file)
else:
if os.path.splitext(original_file)[1]==".py":
search = False
for test_file in dir_test:
test = test_file.lower().replace("_", "").replace("test", "")
original = original_file.lower().replace("_", "").replace("test", "")
if test==original:
search = True
if search == False:
diff.append(path_original+"/"+original_file)
cmd = "grep \"socorro."+string.join(path_original.split("/")[2:], ".")+"."+original_file.replace(".py","")+"\" "+path_test+"/*.py"
foo = os.system(cmd)
return diff
for files in socorro:
if files.find("__")!=-1:
socorro.remove(files)
for dir_socorro in socorro:
if unittest.count(dir_socorro):
diff = search_diff("socorro/socorro/"+dir_socorro, "socorro/socorro/unittest/"+dir_socorro)
if diff!=[]:
print "\nMissing tests in "+dir_socorro+":\n", diff
else:
print "\nAll coverage in "+dir_socorro+"."
else:
print "\nDo not exist testing directory for: "+dir_socorro+"."
@GabiThume
Copy link
Author

GabiThume commented Jun 19, 2013

I searched in other test files commands that import this "missing tests":

socorro/socorro/unittest/lib/testConfigurationManager.py:import socorro.lib.dynamicConfigurationManager as CM
socorro/socorro/unittest/lib/testOoid.py:import socorro.lib.uuid as uu
socorro/socorro/unittest/app/test_generic_fetch_transform_save_app.py:from socorro.app.fetch_transform_save_app import FetchTransformSaveApp
socorro/socorro/unittest/external/fs/test_fsdatedradixtreestorage.py:from socorro.external.fs.crashstorage import FSDatedRadixTreeStorage
socorro/socorro/unittest/external/fs/test_fslegacydatedradixtreestorage.py:from socorro.external.fs.crashstorage import FSLegacyDatedRadixTreeStorage
socorro/socorro/unittest/external/fs/test_fsradixtreestorage.py:from socorro.external.fs.crashstorage import FSRadixTreeStorage
socorro/socorro/unittest/services/testEmailCampaignCreate.py:import socorro.services.emailCampaignCreate as ecc

So I look at each one and found that:
"socorro/socorro/lib/dynamicConfigurationManager.py",
"socorro/socorro/app/fetch_transform_save_app.py"
"socorro/socorro/external/fs/crashstorage.py"
are tested in other files (different names).

@rhelmer
Copy link

rhelmer commented Jun 19, 2013

This is really valuable, thanks for posting this!

I think a lot of the stuff in socorro/socorro/middleware/ is deprecated and can go away when we ship the new middleware (shipping the django app is blocking this)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment