|
44 | 44 | ) |
45 | 45 | from environment.aws.common.output import header |
46 | 46 | from environment.aws.topology_setup.cbl_library_downloader import CBLLibraryDownloader |
47 | | -from environment.aws.topology_setup.test_server import ( |
48 | | - TEST_SERVER_DIR, |
49 | | - TestServer, |
50 | | - copy_dataset, |
51 | | -) |
| 47 | +from environment.aws.topology_setup.test_server import TEST_SERVER_DIR, TestServer |
52 | 48 |
|
53 | 49 | from .android_bridge import AndroidBridge |
54 | 50 | from .exe_bridge import ExeBridge |
@@ -80,9 +76,6 @@ def __init__(self, version: str): |
80 | 76 | def cbl_filename(self, version: str) -> str: |
81 | 77 | pass |
82 | 78 |
|
83 | | - def _copy_dataset(self) -> None: |
84 | | - copy_dataset(C_TEST_SERVER_DIR / "assets") |
85 | | - |
86 | 79 |
|
87 | 80 | class CTestServer_Desktop(CTestServer): |
88 | 81 | def _download_cbl(self) -> None: |
@@ -115,7 +108,6 @@ def build(self) -> None: |
115 | 108 | """ |
116 | 109 | Build the C test server. |
117 | 110 | """ |
118 | | - self._copy_dataset() |
119 | 111 | shutil.rmtree(LIB_DIR, ignore_errors=True) |
120 | 112 | self._download_cbl() |
121 | 113 | header("Building C test server") |
@@ -219,7 +211,6 @@ def _download_cbl(self): |
219 | 211 |
|
220 | 212 | def build(self): |
221 | 213 | self._download_cbl() |
222 | | - self._copy_dataset() |
223 | 214 | header("Building") |
224 | 215 | env = os.environ.copy() |
225 | 216 | env["LANG"] = "en_US.UTF-8" |
@@ -275,12 +266,14 @@ def create_bridge(self) -> PlatformBridge: |
275 | 266 | Returns: |
276 | 267 | PlatformBridge: The platform bridge. |
277 | 268 | """ |
278 | | - path = ( |
279 | | - IOS_BUILD_DIR / "Build" / "Products" / "Release-iphoneos" / "TestServer.app" |
| 269 | + prefix = ( |
| 270 | + TEST_SERVER_DIR / "downloaded" / self.platform / self.version |
| 271 | + if self._downloaded |
| 272 | + else IOS_BUILD_DIR / "Build" / "Products" / "Release-iphoneos" |
280 | 273 | ) |
281 | 274 |
|
282 | 275 | return iOSBridge( |
283 | | - str(path), |
| 276 | + str(prefix / "TestServer.app"), |
284 | 277 | "com.couchbase.CBLTestServer", |
285 | 278 | ) |
286 | 279 |
|
@@ -370,7 +363,6 @@ def build(self) -> None: |
370 | 363 | Build the C test server. |
371 | 364 | """ |
372 | 365 | self._download_cbl() |
373 | | - self._copy_dataset() |
374 | 366 | gradle_path = C_TEST_SERVER_DIR / "platforms" / "android" / "gradlew" |
375 | 367 | if platform.system() == "Windows": |
376 | 368 | gradle_path = gradle_path.with_suffix(".bat") |
@@ -405,7 +397,13 @@ def create_bridge(self) -> PlatformBridge: |
405 | 397 | PlatformBridge: The platform bridge. |
406 | 398 | """ |
407 | 399 | path = ( |
408 | | - C_TEST_SERVER_DIR |
| 400 | + TEST_SERVER_DIR |
| 401 | + / "downloaded" |
| 402 | + / self.platform |
| 403 | + / self.version |
| 404 | + / "testserver_android.apk" |
| 405 | + if self._downloaded |
| 406 | + else C_TEST_SERVER_DIR |
409 | 407 | / "platforms" |
410 | 408 | / "android" |
411 | 409 | / "app" |
@@ -500,9 +498,12 @@ def create_bridge(self) -> PlatformBridge: |
500 | 498 | Returns: |
501 | 499 | PlatformBridge: The platform bridge. |
502 | 500 | """ |
503 | | - return ExeBridge( |
504 | | - str(BUILD_DIR / "out" / "bin" / "testserver.exe"), |
| 501 | + prefix = ( |
| 502 | + TEST_SERVER_DIR / "downloaded" / self.platform / self.version |
| 503 | + if self._downloaded |
| 504 | + else BUILD_DIR / "out" / "bin" |
505 | 505 | ) |
| 506 | + return ExeBridge(str(prefix / "testserver.exe")) |
506 | 507 |
|
507 | 508 | def compress_package(self) -> str: |
508 | 509 | """ |
@@ -561,9 +562,12 @@ def create_bridge(self) -> PlatformBridge: |
561 | 562 | Returns: |
562 | 563 | PlatformBridge: The platform bridge. |
563 | 564 | """ |
564 | | - return ExeBridge( |
565 | | - str(BUILD_DIR / "out" / "bin" / "testserver"), |
| 565 | + prefix = ( |
| 566 | + TEST_SERVER_DIR / "downloaded" / self.platform / self.version |
| 567 | + if self._downloaded |
| 568 | + else BUILD_DIR / "out" / "bin" |
566 | 569 | ) |
| 570 | + return ExeBridge(str(prefix / "testserver")) |
567 | 571 |
|
568 | 572 | def compress_package(self) -> str: |
569 | 573 | """ |
@@ -622,9 +626,12 @@ def create_bridge(self) -> PlatformBridge: |
622 | 626 | Returns: |
623 | 627 | PlatformBridge: The platform bridge. |
624 | 628 | """ |
625 | | - return ExeBridge( |
626 | | - str(BUILD_DIR / "out" / "bin" / "testserver"), |
| 629 | + prefix = ( |
| 630 | + TEST_SERVER_DIR / "downloaded" / self.platform / self.version |
| 631 | + if self._downloaded |
| 632 | + else BUILD_DIR / "out" / "bin" |
627 | 633 | ) |
| 634 | + return ExeBridge(str(prefix / "testserver")) |
628 | 635 |
|
629 | 636 | def compress_package(self) -> str: |
630 | 637 | """ |
|
0 commit comments