Skip to content

Commit

Permalink
test: Resolve integration test job ARNs becoming UUIDs (#900)
Browse files Browse the repository at this point in the history
  • Loading branch information
AbeCoull authored Mar 2, 2024
1 parent 4314100 commit f4d642a
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions test/integ_tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,16 +161,22 @@ def job_failed_name(request):


@pytest.fixture(scope="session", autouse=True)
def completed_quantum_job(aws_session, job_completed_name):
account = boto3.client("sts").get_caller_identity().get("Account")
region = aws_session.region
job = AwsQuantumJob(arn=f"arn:aws:braket:{region}:{account}:job/{job_completed_name}")
return job
def completed_quantum_job(job_completed_name):
job_arn = [
job["jobArn"]
for job in boto3.client("braket").search_jobs(filters=[])["jobs"]
if job["jobName"] == job_completed_name
][0]

return AwsQuantumJob(arn=job_arn)


@pytest.fixture(scope="session", autouse=True)
def failed_quantum_job(aws_session, job_failed_name):
account = boto3.client("sts").get_caller_identity().get("Account")
region = aws_session.region
job = AwsQuantumJob(arn=f"arn:aws:braket:{region}:{account}:job/{job_failed_name}")
return job
def failed_quantum_job(job_failed_name):
job_arn = [
job["jobArn"]
for job in boto3.client("braket").search_jobs(filters=[])["jobs"]
if job["jobName"] == job_failed_name
][0]

return AwsQuantumJob(arn=job_arn)

0 comments on commit f4d642a

Please sign in to comment.