()
| 237 | |
| 238 | @pytest.fixture(scope='session') |
| 239 | def gcs_server(): |
| 240 | port = find_free_port() |
| 241 | env = os.environ.copy() |
| 242 | exe = 'storage-testbench' |
| 243 | args = [exe, '--port', str(port)] |
| 244 | proc = None |
| 245 | try: |
| 246 | # start server |
| 247 | proc = subprocess.Popen(args, env=env) |
| 248 | # Make sure the server is alive. |
| 249 | if proc.poll() is not None: |
| 250 | pytest.skip(f"Command {args} did not start server successfully!") |
| 251 | except OSError as e: |
| 252 | pytest.skip(f"Command {args} failed to execute: {e}") |
| 253 | else: |
| 254 | yield { |
| 255 | 'connection': ('localhost', port), |
| 256 | 'process': proc, |
| 257 | } |
| 258 | finally: |
| 259 | if proc is not None: |
| 260 | proc.kill() |
| 261 | proc.wait() |
| 262 | |
| 263 | |
| 264 | @pytest.fixture(scope='session') |
nothing calls this directly
no test coverage detected