Skip to content

Commit 6be6b3e

Browse files
authored
Merge pull request #609 from FlorentinD/encode-buildid
Encode build id in AuraDS test instance
2 parents 0156d50 + 2019345 commit 6be6b3e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

scripts/ci/run_targeting_aura.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,11 @@ def get_access_token() -> str:
2626
return response.json()["access_token"] # type: ignore
2727

2828

29-
def create_instance(access_token: str) -> Dict[str, Any]:
29+
def create_instance(name: str, access_token: str) -> Dict[str, Any]:
3030
CREATE_OK_MAX_WAIT_TIME = 10
31-
MAX_INT = 2**31
3231

3332
data = {
34-
"name": "ci-instance-" + str(rd.randint(0, MAX_INT)),
33+
"name": name,
3534
"memory": "8GB",
3635
"version": "5",
3736
"region": "europe-west1",
@@ -151,7 +150,10 @@ def main() -> None:
151150
access_token = get_access_token()
152151
logging.info("Access token for creation acquired")
153152

154-
create_result = create_instance(access_token)
153+
MAX_INT = 1000000
154+
instance_name = f"ci-build-{sys.argv[2]}" if len(sys.argv) > 1 else "ci-instance-" + str(rd.randint(0, MAX_INT))
155+
156+
create_result = create_instance(instance_name, access_token)
155157
instance_id = create_result["id"]
156158
logging.info("Creation of database accepted")
157159

0 commit comments

Comments
 (0)