cidb: add a factory function to create CIDBConnection for builders

CQ-DEPEND=CL:209684
BUG=chromium:387755
TEST=Tested in a future CL

Change-Id: I748681c4414d53238903801e3960836772cac018
Reviewed-on: https://chromium-review.googlesource.com/209823
Reviewed-by: Aviv Keshet <akeshet@chromium.org>
Tested-by: Aviv Keshet <akeshet@chromium.org>
Commit-Queue: Aviv Keshet <akeshet@chromium.org>
diff --git a/scripts/cbuildbot.py b/scripts/cbuildbot.py
index f32b96f..41249f4 100644
--- a/scripts/cbuildbot.py
+++ b/scripts/cbuildbot.py
@@ -1357,6 +1357,10 @@
             'MasterSlaveSyncCompletionStage, by specifying a file with a '
             'pickle of the result to be returned.'))
 
+  group.add_remote_option(
+      '--test-cidb', dest='test_cidb', default=False, action='store_true',
+      help='Use test instance of cidb database, instead of prod instance.')
+
   parser.add_option_group(group)
 
   #