def test_success(mock_taskcluster): bus = MessageBus() hook = CodeCoverage("services-staging-codecoverage/bot", "project-test", bus) assert run_async_parser(hook, "RS0UwZahQ_qAcdZzEb_Y9g", "gecko-level-1") == [{ "REPOSITORY": "https://hg.mozilla.org/mozilla-central", "REVISION": "ec3dd3ee2ae4b3a63529a912816a110e925eb2d0", }]
def test_is_coverage_task(mock_taskcluster): bus = MessageBus() hook = CodeCoverage("services-staging-codecoverage/bot", "project-test", bus) cov_task = {"task": {"metadata": {"name": "build-linux64-ccov"}}} assert hook.is_coverage_task(cov_task) cov_task = {"task": {"metadata": {"name": "build-linux1804-64-ccov"}}} assert hook.is_coverage_task(cov_task) cov_task = {"task": {"metadata": {"name": "build-linux64-ccov/opt"}}} assert hook.is_coverage_task(cov_task) cov_task = {"task": {"metadata": {"name": "build-win64-ccov/debug"}}} assert hook.is_coverage_task(cov_task) cov_task = { "task": { "metadata": { "name": "test-linux64-ccov/opt-mochitest-1" } } } assert hook.is_coverage_task(cov_task) cov_task = { "task": { "metadata": { "name": "test-windows10-64-ccov-qr/opt-mochitest-1" } } } assert hook.is_coverage_task(cov_task) nocov_task = { "task": { "metadata": { "name": "test-linux64/opt-mochitest-1" } } } assert not hook.is_coverage_task(nocov_task)