diff options
Diffstat (limited to 'buildscripts/tests/resmokelib')
7 files changed, 30 insertions, 20 deletions
diff --git a/buildscripts/tests/resmokelib/logging/__init__.py b/buildscripts/tests/resmokelib/logging/__init__.py index e69de29bb2d..4b7a2bb941b 100644 --- a/buildscripts/tests/resmokelib/logging/__init__.py +++ b/buildscripts/tests/resmokelib/logging/__init__.py @@ -0,0 +1 @@ +"""Empty.""" diff --git a/buildscripts/tests/resmokelib/logging/test_buildlogger.py b/buildscripts/tests/resmokelib/logging/test_buildlogger.py index 734f418bf10..b57ec041f30 100644 --- a/buildscripts/tests/resmokelib/logging/test_buildlogger.py +++ b/buildscripts/tests/resmokelib/logging/test_buildlogger.py @@ -7,6 +7,8 @@ import unittest from buildscripts.resmokelib.logging import buildlogger +# pylint: disable=missing-docstring,protected-access + class TestLogsSplitter(unittest.TestCase): """Unit tests for the _LogsSplitter class.""" diff --git a/buildscripts/tests/resmokelib/test_archival.py b/buildscripts/tests/resmokelib/test_archival.py index e0a05d51b45..43a63fa17c6 100644 --- a/buildscripts/tests/resmokelib/test_archival.py +++ b/buildscripts/tests/resmokelib/test_archival.py @@ -11,6 +11,8 @@ import unittest from buildscripts.resmokelib.utils import archival +# pylint: disable=missing-docstring,protected-access + _BUCKET = "mongodatafiles" diff --git a/buildscripts/tests/resmokelib/test_selector.py b/buildscripts/tests/resmokelib/test_selector.py index 809bce67e70..50694c05a3e 100644 --- a/buildscripts/tests/resmokelib/test_selector.py +++ b/buildscripts/tests/resmokelib/test_selector.py @@ -10,6 +10,8 @@ import buildscripts.resmokelib.utils.globstar as globstar import buildscripts.resmokelib.config import buildscripts.resmokeconfig +# pylint: disable=missing-docstring,protected-access + class TestExpressions(unittest.TestCase): """Unit tests for the tag matching expressions.""" @@ -119,7 +121,7 @@ class MockTestFileExplorer(object): self.binary = "dbtest" self.jstest_tag_file = {"dir/subdir1/test11.js": "tagA", "dir/subdir3/a/test3a1.js": "tagB"} - def is_glob_pattern(self, pattern): + def is_glob_pattern(self, pattern): # pylint: disable=no-self-use return globstar.is_glob_pattern(pattern) def iglob(self, pattern): @@ -132,21 +134,22 @@ class MockTestFileExplorer(object): def jstest_tags(self, file_path): return self.tags.get(file_path, []) - def read_root_file(self, root_file_path): + def read_root_file(self, root_file_path): # pylint: disable=no-self-use,unused-argument return ["build/testA", "build/testB"] - def fnmatchcase(self, name, pattern): + def fnmatchcase(self, name, pattern): # pylint: disable=no-self-use return fnmatch.fnmatchcase(name, pattern) def isfile(self, path): return path in self.files - def list_dbtests(self, binary): + def list_dbtests(self, binary): # pylint: disable=no-self-use,unused-argument return ["dbtestA", "dbtestB", "dbtestC"] def parse_tag_file(self, test_kind): if test_kind == "js_test": return self.jstest_tag_file + return None class TestTestList(unittest.TestCase): diff --git a/buildscripts/tests/resmokelib/testing/fixtures/__init__.py b/buildscripts/tests/resmokelib/testing/fixtures/__init__.py index e69de29bb2d..4b7a2bb941b 100644 --- a/buildscripts/tests/resmokelib/testing/fixtures/__init__.py +++ b/buildscripts/tests/resmokelib/testing/fixtures/__init__.py @@ -0,0 +1 @@ +"""Empty.""" diff --git a/buildscripts/tests/resmokelib/testing/fixtures/test_interface.py b/buildscripts/tests/resmokelib/testing/fixtures/test_interface.py index ea2ce03b110..851c33e5318 100644 --- a/buildscripts/tests/resmokelib/testing/fixtures/test_interface.py +++ b/buildscripts/tests/resmokelib/testing/fixtures/test_interface.py @@ -5,9 +5,11 @@ import unittest from buildscripts.resmokelib import errors from buildscripts.resmokelib.testing.fixtures import interface +# pylint: disable=missing-docstring,protected-access + class TestFixture(unittest.TestCase): - def test_teardown_ok(self): + def test_teardown_ok(self): # pylint: disable=no-self-use raising_fixture = UnitTestFixture(should_raise=False) raising_fixture.teardown() @@ -41,7 +43,7 @@ class TestFixtureTeardownHandler(unittest.TestCase): self.assertEqual(expected_msg, handler.get_error_message()) -class UnitTestFixture(interface.Fixture): +class UnitTestFixture(interface.Fixture): # pylint: disable=abstract-method ERROR_MESSAGE = "Failed" def __init__(self, should_raise=False): diff --git a/buildscripts/tests/resmokelib/testing/hooks/test_combine_benchmark_results.py b/buildscripts/tests/resmokelib/testing/hooks/test_combine_benchmark_results.py index d67e96a99b8..bb211fcd401 100755 --- a/buildscripts/tests/resmokelib/testing/hooks/test_combine_benchmark_results.py +++ b/buildscripts/tests/resmokelib/testing/hooks/test_combine_benchmark_results.py @@ -1,4 +1,5 @@ #!/usr/bin/env python +"""Unit tests for the resmokelib.testing.hooks.combine_benchmark_results module.""" from __future__ import absolute_import @@ -9,6 +10,8 @@ import mock import buildscripts.resmokelib.testing.hooks.combine_benchmark_results as cbr +# pylint: disable=missing-docstring,protected-access + _BM_CONTEXT = { "date": "2018/01/30-18:40:25", "num_cpus": 40, "mhz_per_cpu": 4999, "cpu_scaling_enabled": False, "library_build_type": "debug" @@ -26,8 +29,7 @@ _BM_REPORT_2 = { _BM_MEAN_REPORT = { "name": "BM_Name1/arg1/arg with space_mean", "iterations": 1000, "real_time": 1200, - "cpu_time": 1300, - "bytes_per_second": 1400, "items_per_second": 1500, "custom_counter_1": 1600 + "cpu_time": 1300, "bytes_per_second": 1400, "items_per_second": 1500, "custom_counter_1": 1600 } _BM_MULTITHREAD_REPORT = { @@ -41,9 +43,11 @@ _BM_MULTITHREAD_MEDIAN_REPORT = { } _BM_FULL_REPORT = { - "context": _BM_CONTEXT, - "benchmarks": [_BM_REPORT_1, _BM_REPORT_2, _BM_MEAN_REPORT, _BM_MULTITHREAD_REPORT, - _BM_MULTITHREAD_MEDIAN_REPORT] + "context": + _BM_CONTEXT, "benchmarks": [ + _BM_REPORT_1, _BM_REPORT_2, _BM_MEAN_REPORT, _BM_MULTITHREAD_REPORT, + _BM_MULTITHREAD_MEDIAN_REPORT + ] } # 12/31/2999 @ 11:59pm (UTC) @@ -58,7 +62,7 @@ class CombineBenchmarkResultsFixture(unittest.TestCase): # Mock the hook's parent class because we're testing only functionality of this hook and # not anything related to or inherit from the parent class. @mock.patch("buildscripts.resmokelib.testing.hooks.interface.Hook", autospec=True) - def setUp(self, MockHook): + def setUp(self, MockHook): # pylint: disable=arguments-differ,unused-argument self.bm_threads_report = cbr._BenchmarkThreadsReport(_BM_CONTEXT) self.cbr_hook = cbr.CombineBenchmarkResults(None, None) @@ -118,8 +122,7 @@ class TestBenchmarkThreadsReport(CombineBenchmarkResultsFixture): # Also test add_report() in the process. self.bm_threads_report.add_report( self.bm_threads_report.parse_bm_name(_BM_MULTITHREAD_REPORT["name"]), - _BM_MULTITHREAD_REPORT - ) + _BM_MULTITHREAD_REPORT) self.assertEqual(len(self.bm_threads_report.thread_benchmark_map.keys()), 1) @@ -135,14 +138,10 @@ class TestBenchmarkThreadsReport(CombineBenchmarkResultsFixture): def test_generate_single_thread_perf_plugin_dict(self): self.bm_threads_report.add_report( - self.bm_threads_report.parse_bm_name(_BM_REPORT_1["name"]), - _BM_REPORT_1 - ) + self.bm_threads_report.parse_bm_name(_BM_REPORT_1["name"]), _BM_REPORT_1) self.bm_threads_report.add_report( - self.bm_threads_report.parse_bm_name(_BM_REPORT_2["name"]), - _BM_REPORT_2 - ) + self.bm_threads_report.parse_bm_name(_BM_REPORT_2["name"]), _BM_REPORT_2) self.assertEqual(len(self.bm_threads_report.thread_benchmark_map.keys()), 1) |