diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 4dd9a689c..50de99277 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 b6e569d0b..9e646cdc9 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, + ) + ) diff --git a/test/decorators.py b/test/decorators.py index ba36405df..af4eef47c 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") diff --git a/test/integration/test_proxies.py b/test/integration/test_proxies.py index 8c3535279..629e8dac2 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)