MCPcopy Create free account
hub / github.com/apple/foundationdb / run

Method run

tests/python_tests/__init__.py:68–126  ·  view source on GitHub ↗
(self, parser=None)

Source from the content-addressed store, hash-verified

66 return "local client"
67
68 def run(self, parser=None):
69 import fdb
70
71 # API version should already be set by the caller
72
73 if parser is None:
74 parser = argparse.ArgumentParser()
75
76 parser.add_argument(
77 "--output-directory",
78 default="",
79 type=str,
80 help="The directory to store the output JSON in. If not set, the current directory is used",
81 )
82 parser.add_argument(
83 "--disable-multiversion-api",
84 action="store_true",
85 help="Disables the multi-version client API",
86 )
87 parser.add_argument(
88 "--enable-callbacks-on-external-threads",
89 action="store_true",
90 help="Allows callbacks to be called on threads created by the client library",
91 )
92 parser.add_argument(
93 "--use-external-client",
94 action="store_true",
95 help="Connect to the server using an external client",
96 )
97
98 self.args = parser.parse_args()
99
100 if self.args.disable_multiversion_api:
101 if (
102 self.args.enable_callbacks_on_external_threads
103 or self.args.use_external_client
104 ):
105 raise Exception("Invalid multi-version API argument combination")
106 fdb.options.set_disable_multi_version_client_api()
107 if self.args.enable_callbacks_on_external_threads:
108 if not self.args.use_external_client:
109 raise Exception(
110 "Cannot enable callbacks on external threads without using external clients"
111 )
112 fdb.options.set_callbacks_on_external_threads()
113 if self.args.use_external_client:
114 fdb.options.set_disable_local_client()
115 fdb.options.set_external_client_directory(
116 os.path.join(
117 os.path.dirname(__file__), "..", "..", "external_libraries"
118 )
119 )
120
121 try:
122 self.run_test()
123 except Exception:
124 self.result.add_error(traceback.format_exc())
125

Callers

nothing calls this directly

Calls 4

run_testMethod · 0.95
add_errorMethod · 0.80
joinMethod · 0.45
saveMethod · 0.45

Tested by

no test coverage detected