Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
18 changes: 14 additions & 4 deletions test/benchmarks/test_benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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,
)
)
4 changes: 2 additions & 2 deletions test/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down Expand Up @@ -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")

Expand Down
1 change: 1 addition & 0 deletions test/integration/test_proxies.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Loading