Revert "BuildStore: Switch 4 functions to Buildbucket from CIDB"
This reverts commit cbc6195a16f9e129db296027a09242456ae21aca.
Reason for revert: Will reland after refactoring Report logic
Original change's description:
> BuildStore: Switch 4 functions to Buildbucket from CIDB
>
> The four functions are GetBuildStatuses, GetBuildStages,
> GetKilledChildBuilds and GetSlaveStatuses. This CL should be
> easily reverted if necessary.
>
> CQ-DEPEND=CL:1554584
> BUG=chromium:914909
> TEST=run_tests
>
> Change-Id: I6efd17108fe3e3c42dfb57902a2ebda3530645f2
> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/1557114
> Reviewed-by: Dhanya Ganesh <dhanyaganesh@chromium.org>
> Commit-Queue: Dhanya Ganesh <dhanyaganesh@chromium.org>
> Tested-by: Dhanya Ganesh <dhanyaganesh@chromium.org>
Bug: chromium:914909
Change-Id: I23cc7a80c0e50260f397a0c8866d8e5cd1fd4464
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/1556503
Reviewed-by: Dhanya Ganesh <dhanyaganesh@chromium.org>
Commit-Queue: Dhanya Ganesh <dhanyaganesh@chromium.org>
Tested-by: Dhanya Ganesh <dhanyaganesh@chromium.org>
diff --git a/lib/buildstore.py b/lib/buildstore.py
index 808818f..d70d803 100644
--- a/lib/buildstore.py
+++ b/lib/buildstore.py
@@ -58,7 +58,7 @@
# This value is only to be used by read functions that are ready for
# transition to Buildbucket. The plan is to move more and more functions
# to depend on this till we can finally eliminate it.
- self._transitioning_to_bb = True
+ self._transitioning_to_bb = False
self._write_to_bb = _write_to_bb
self._write_to_cidb = _write_to_cidb
self.cidb_creds = cidb_creds
diff --git a/lib/buildstore_unittest.py b/lib/buildstore_unittest.py
index 87c3920..90051fb 100644
--- a/lib/buildstore_unittest.py
+++ b/lib/buildstore_unittest.py
@@ -20,10 +20,10 @@
class TestBuildStore(cros_test_lib.MockTestCase):
"""Test buildstore.BuildStore."""
- # pylint: disable=protected-access
def testIsCIDBClientMissing(self):
"""Tests _IsCIDBClientMissing function."""
+ # pylint: disable=protected-access
# Test CIDB needed and client missing.
bs = BuildStore(_read_from_bb=False, _write_to_cidb=True)
self.assertEqual(bs._IsCIDBClientMissing(), True)
@@ -47,6 +47,7 @@
def testIsBuildbucketClientMissing(self):
"""Tests _IsBuildbucketClientMissing function."""
+ # pylint: disable=protected-access
# Test Buildbucket needed and client missing.
bs = BuildStore(_read_from_bb=True, _write_to_bb=True)
self.assertEqual(bs._IsBuildbucketClientMissing(), True)
@@ -66,7 +67,6 @@
self.assertEqual(bs._IsBuildbucketClientMissing(), False)
# Test Buildbucket is not needed.
bs = BuildStore(_read_from_bb=False, _write_to_bb=False)
- bs._transitioning_to_bb = False
self.assertEqual(bs._IsBuildbucketClientMissing(), False)
# Test _transitioning_to_bb logic.
bs = BuildStore(_read_from_bb=False, _write_to_bb=False)
@@ -162,7 +162,6 @@
init = self.PatchObject(BuildStore, 'InitializeClients',
return_value=True)
bs = BuildStore(_read_from_bb=False)
- bs._transitioning_to_bb = False
fake_result = [
{'message_value': 1234},
{'message_value': 2341},
@@ -457,7 +456,6 @@
init = self.PatchObject(BuildStore, 'InitializeClients',
return_value=True)
bs = BuildStore(_read_from_bb=False)
- bs._transitioning_to_bb = False
bs.cidb_conn = mock.MagicMock()
buildbucket_ids = ['bucket 1', 'bucket 2']
# Test for buildbucket_ids.
@@ -481,7 +479,6 @@
init = self.PatchObject(BuildStore, 'InitializeClients',
return_value=True)
bs = BuildStore(_read_from_bb=False)
- bs._transitioning_to_bb = False
bs.cidb_conn = mock.MagicMock()
build_ids = ['build 1', 'build 2']
buildbucket_ids = [1234, 2341]