From d304a028245f1a32f846e254517cb91ad0101a26 Mon Sep 17 00:00:00 2001 From: "Diego M. Rodriguez" Date: Wed, 1 Apr 2026 11:57:23 +0200 Subject: [PATCH 1/3] Pass url in service test --- test/integration/test_proxies.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test/integration/test_proxies.py b/test/integration/test_proxies.py index 8c3535279c..629e8dac27 100644 --- a/test/integration/test_proxies.py +++ b/test/integration/test_proxies.py @@ -97,6 +97,7 @@ def test_proxies_qiskit_runtime_service( channel=dependencies.channel, verify=False, proxies={"urls": VALID_PROXIES}, + url=dependencies.url, ) service.jobs(limit=1) From d3bb6ea08cf1ae364072058822957b0abc67360f Mon Sep 17 00:00:00 2001 From: "Diego M. Rodriguez" Date: Wed, 1 Apr 2026 12:31:31 +0200 Subject: [PATCH 2/3] Better skipping, homogeneous time unit --- .github/workflows/integration-tests.yml | 3 ++- test/benchmarks/test_benchmarks.py | 18 ++++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 4dd9a689cc..50de992779 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -72,6 +72,7 @@ jobs: LOG_LEVEL: DEBUG STREAM_LOG: True QISKIT_IN_PARALLEL: True + PYTEST_ADDOPTS: "--benchmark-time-unit s" steps: - uses: actions/checkout@v4 with: @@ -83,6 +84,6 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install -e '.[dev]' + pip install -e '.[test,performance]' - name: Run benchmarks run: make benchmark diff --git a/test/benchmarks/test_benchmarks.py b/test/benchmarks/test_benchmarks.py index b6e569d0b4..93694ee81e 100644 --- a/test/benchmarks/test_benchmarks.py +++ b/test/benchmarks/test_benchmarks.py @@ -18,7 +18,8 @@ from unittest import SkipTest from qiskit_ibm_runtime import QiskitRuntimeService -from qiskit_ibm_runtime.accounts import AccountManager + +from ..decorators import _get_integration_test_config def run_in_subprocess(cmd: str) -> None: @@ -40,8 +41,17 @@ def test_import_qiskit_ibm_runtime(benchmark): def test_instantiate_qiskit_runtime_service(benchmark): """Benchmark the instantating of `QiskitRuntimeService`.""" - account_manager = AccountManager() - if len(account_manager.list()) == 0: + + channel, token, url, instance, _ = _get_integration_test_config() + if not all([channel, token, url]): raise SkipTest("No accounts available") - benchmark(QiskitRuntimeService) + benchmark( + partial( + QiskitRuntimeService, + instance=instance, + channel=channel, + token=token, + url=url, + ) + ) From e304da73fc418755e9a84db1be18b3c69d9408cc Mon Sep 17 00:00:00 2001 From: "Diego M. Rodriguez" Date: Wed, 1 Apr 2026 12:48:23 +0200 Subject: [PATCH 3/3] Rename private function --- test/benchmarks/test_benchmarks.py | 4 ++-- test/decorators.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/benchmarks/test_benchmarks.py b/test/benchmarks/test_benchmarks.py index 93694ee81e..9e646cdc9c 100644 --- a/test/benchmarks/test_benchmarks.py +++ b/test/benchmarks/test_benchmarks.py @@ -19,7 +19,7 @@ from qiskit_ibm_runtime import QiskitRuntimeService -from ..decorators import _get_integration_test_config +from ..decorators import get_integration_test_config def run_in_subprocess(cmd: str) -> None: @@ -42,7 +42,7 @@ def test_import_qiskit_ibm_runtime(benchmark): def test_instantiate_qiskit_runtime_service(benchmark): """Benchmark the instantating of `QiskitRuntimeService`.""" - channel, token, url, instance, _ = _get_integration_test_config() + channel, token, url, instance, _ = get_integration_test_config() if not all([channel, token, url]): raise SkipTest("No accounts available") diff --git a/test/decorators.py b/test/decorators.py index ba36405df3..af4eef47cc 100644 --- a/test/decorators.py +++ b/test/decorators.py @@ -53,7 +53,7 @@ def _wrapper(self, *args, **kwargs): return _wrapper -def _get_integration_test_config(): +def get_integration_test_config(): token, url, instance, qpu = ( os.getenv("QISKIT_IBM_TOKEN"), os.getenv("QISKIT_IBM_URL"), @@ -103,7 +103,7 @@ def _wrapper(self, *args, **kwargs): else supported_channel ) - channel, token, url, instance, qpu = _get_integration_test_config() + channel, token, url, instance, qpu = get_integration_test_config() if not all([channel, token, url]): raise Exception("Configuration Issue")