Skip to content

Commit eb3bb46

Browse files
committed
Remove IQP classic integration tests
1 parent 37c44f7 commit eb3bb46

15 files changed

+11
-448
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ jobs:
122122
matrix:
123123
python-version: [ 3.9 ]
124124
os: [ "ubuntu-latest" ]
125-
environment: [ "ibm-quantum-production", "ibm-cloud-production" ]
125+
environment: ["ibm-cloud-production" ]
126126
environment: ${{ matrix.environment }}
127127
env:
128128
QISKIT_IBM_TOKEN: ${{ secrets.QISKIT_IBM_TOKEN }}

.github/workflows/integration-tests-qiskit-main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
matrix:
2828
python-version: [ 3.9 ]
2929
os: [ "ubuntu-latest" ]
30-
environment: [ "ibm-quantum-production", "ibm-quantum-staging", "ibm-cloud-production", "ibm-cloud-staging" ]
30+
environment: ["ibm-cloud-production", "ibm-cloud-staging" ]
3131
environment: ${{ matrix.environment }}
3232
env:
3333
QISKIT_IBM_TOKEN: ${{ secrets.QISKIT_IBM_TOKEN }}

.github/workflows/integration-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
matrix:
2828
python-version: [ 3.9 ]
2929
os: [ "ubuntu-latest" ]
30-
environment: [ "ibm-quantum-production", "ibm-quantum-staging", "ibm-cloud-production", "ibm-cloud-staging" ]
30+
environment: ["ibm-cloud-production", "ibm-cloud-staging" ]
3131
environment: ${{ matrix.environment }}
3232
env:
3333
QISKIT_IBM_TOKEN: ${{ secrets.QISKIT_IBM_TOKEN }}

.github/workflows/smoke-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
matrix:
2525
python-version: [ 3.9 ]
2626
os: [ "ubuntu-latest" ]
27-
environment: [ "ibm-quantum-production", "ibm-quantum-staging", "ibm-cloud-production", "ibm-cloud-staging" ]
27+
environment: [ "ibm-cloud-production", "ibm-cloud-staging" ]
2828
environment: ${{ matrix.environment }}
2929
env:
3030
QISKIT_IBM_TOKEN: ${{ secrets.QISKIT_IBM_TOKEN }}

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ To enable test cases against external system in your private fork, make sure to
237237
The names of the environments must match the ones that the [CI workflow](.github/workflows/ci.yml) relies
238238
upon.
239239

240-
For example, in your github fork settings, add the environment you want to run tests on (ibm-quantum-production, ibm-quantum-staging, ibm-cloud-production, ibm-cloud-staging). Then add the appropriate environment secrets (QISKIT_IBM_INSTANCE, QISKIT_IBM_TOKEN, QISKIT_IBM_URL, QISKIT_IBM_DEVICE).
240+
For example, in your github fork settings, add the environment you want to run tests on (ibm-cloud-production, ibm-cloud-staging). Then add the appropriate environment secrets (QISKIT_IBM_INSTANCE, QISKIT_IBM_TOKEN, QISKIT_IBM_URL, QISKIT_IBM_DEVICE).
241241

242242
### Style guide
243243

test/decorators.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,6 @@ def _wrapper(self, *args, **kwargs):
3535
return _wrapper
3636

3737

38-
def quantum_only(func):
39-
"""Decorator that runs a test using only ibm_quantum services."""
40-
41-
@wraps(func)
42-
def _wrapper(self, service):
43-
if service._channel != "ibm_quantum":
44-
raise SkipTest(
45-
f"Skipping integration test. {self} does not support channel type {service._channel}"
46-
)
47-
func(self, service)
48-
49-
return _wrapper
50-
51-
5238
def run_quantum_and_cloud_fake(func):
5339
"""Decorator that runs a test using both quantum and cloud fake services."""
5440

test/integration/test_account.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,6 @@ def _get_service_instance_name_for_crn(
4848
class TestIntegrationAccount(IBMIntegrationTestCase):
4949
"""Integration tests for account management."""
5050

51-
def _skip_on_ibm_quantum(self):
52-
if self.dependencies.channel == "ibm_quantum":
53-
self.skipTest("Not supported on ibm_quantum")
54-
5551
def test_local_channel(self):
5652
"""Test local channel mode"""
5753
local_service = QiskitRuntimeService(
@@ -68,7 +64,6 @@ def test_local_channel(self):
6864

6965
def test_resolve_crn_for_valid_service_instance_name(self):
7066
"""Verify if CRN is transparently resolved based for an existing service instance name."""
71-
self._skip_on_ibm_quantum()
7267

7368
service_instance_name = _get_service_instance_name_for_crn(self.dependencies)
7469
with self.subTest(instance=service_instance_name):
@@ -83,7 +78,6 @@ def test_resolve_crn_for_valid_service_instance_name(self):
8378

8479
def test_resolve_crn_for_invalid_service_instance_name(self):
8580
"""Verify if CRN resolution fails for non-existing service instance name."""
86-
self._skip_on_ibm_quantum()
8781

8882
service_instance_name = "-non-existing-service-name-"
8983
with (
@@ -96,16 +90,3 @@ def test_resolve_crn_for_invalid_service_instance_name(self):
9690
token=self.dependencies.token,
9791
instance=service_instance_name,
9892
)
99-
100-
def test_logging_instance_at_init(self):
101-
"""Test instance is logged at initialization if instance not passed in."""
102-
if self.dependencies.channel == "ibm_cloud":
103-
self.skipTest("Not supported on ibm_cloud")
104-
105-
with self.assertLogs("qiskit_ibm_runtime", "INFO") as logs:
106-
QiskitRuntimeService(
107-
channel="ibm_quantum",
108-
url=self.dependencies.url,
109-
token=self.dependencies.token,
110-
)
111-
self.assertIn("instance", logs.output[0])

test/integration/test_auth_client.py

Lines changed: 1 addition & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,16 @@
1212

1313
"""Tests for the AccountClient class."""
1414

15-
import re
1615

17-
from qiskit_ibm_runtime.api.exceptions import RequestsApiError
18-
from qiskit_ibm_runtime.exceptions import IBMNotAuthorizedError
1916
from qiskit_ibm_runtime.api.client_parameters import ClientParameters
20-
from qiskit_ibm_runtime.api.clients import AuthClient
17+
2118
from ..ibm_test_case import IBMTestCase
2219
from ..decorators import integration_test_setup, IntegrationTestDependencies
2320

2421

2522
class TestAuthClient(IBMTestCase):
2623
"""Tests for the AuthClient."""
2724

28-
@integration_test_setup(supported_channel=["ibm_quantum"], init_service=False)
29-
def test_valid_login(self, dependencies: IntegrationTestDependencies) -> None:
30-
"""Test valid authentication."""
31-
client = self._init_auth_client(dependencies.token, dependencies.url)
32-
self.assertTrue(client.access_token)
33-
3425
@integration_test_setup(supported_channel=["ibm_cloud"], init_service=False)
3526
def test_cloud_access_token(self, dependencies: IntegrationTestDependencies) -> None:
3627
"""Test valid cloud authentication."""
@@ -43,54 +34,3 @@ def test_cloud_access_token(self, dependencies: IntegrationTestDependencies) ->
4334
cloud_auth = params.get_auth_handler()
4435
self.assertTrue(cloud_auth.tm)
4536
self.assertTrue(cloud_auth.tm.get_token())
46-
47-
@integration_test_setup(supported_channel=["ibm_quantum"], init_service=False)
48-
def test_url_404(self, dependencies: IntegrationTestDependencies) -> None:
49-
"""Test login against a 404 URL"""
50-
url_404 = re.sub(r"/api.*$", "/api/TEST_404", dependencies.url)
51-
with self.assertRaises(RequestsApiError):
52-
_ = self._init_auth_client(dependencies.token, url_404)
53-
54-
@integration_test_setup(supported_channel=["ibm_quantum"], init_service=False)
55-
def test_invalid_token(self, dependencies: IntegrationTestDependencies) -> None:
56-
"""Test login using invalid token."""
57-
qe_token = "INVALID_TOKEN"
58-
with self.assertRaises(IBMNotAuthorizedError):
59-
_ = self._init_auth_client(qe_token, dependencies.url)
60-
61-
@integration_test_setup(supported_channel=["ibm_quantum"], init_service=False)
62-
def test_url_unreachable(self, dependencies: IntegrationTestDependencies) -> None:
63-
"""Test login against an invalid (malformed) URL."""
64-
qe_url = "INVALID_URL"
65-
with self.assertRaises(RequestsApiError):
66-
_ = self._init_auth_client(dependencies.token, qe_url)
67-
68-
@integration_test_setup(supported_channel=["ibm_quantum"], init_service=False)
69-
def test_api_version(self, dependencies: IntegrationTestDependencies) -> None:
70-
"""Check the version of the QX API."""
71-
client = self._init_auth_client(dependencies.token, dependencies.url)
72-
version = client.api_version()
73-
self.assertIsNotNone(version)
74-
75-
@integration_test_setup(supported_channel=["ibm_quantum"], init_service=False)
76-
def test_user_urls(self, dependencies: IntegrationTestDependencies) -> None:
77-
"""Check the user urls of the QX API."""
78-
client = self._init_auth_client(dependencies.token, dependencies.url)
79-
user_urls = client.user_urls()
80-
self.assertIsNotNone(user_urls)
81-
self.assertTrue("http" in user_urls and "ws" in user_urls)
82-
83-
@integration_test_setup(supported_channel=["ibm_quantum"], init_service=False)
84-
def test_user_hubs(self, dependencies: IntegrationTestDependencies) -> None:
85-
"""Check the user hubs of the QX API."""
86-
client = self._init_auth_client(dependencies.token, dependencies.url)
87-
user_hubs = client.user_hubs()
88-
self.assertIsNotNone(user_hubs)
89-
for user_hub in user_hubs:
90-
with self.subTest(user_hub=user_hub):
91-
self.assertTrue("hub" in user_hub and "group" in user_hub and "project" in user_hub)
92-
93-
def _init_auth_client(self, token, url):
94-
"""Return an AuthClient."""
95-
params = ClientParameters(channel="ibm_quantum", token=token, url=url)
96-
return AuthClient(params)

test/integration/test_backend.py

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from qiskit_ibm_runtime import QiskitRuntimeService, SamplerV2 as Sampler
2626

2727
from ..ibm_test_case import IBMIntegrationTestCase
28-
from ..decorators import run_integration_test, production_only, quantum_only
28+
from ..decorators import run_integration_test, production_only
2929
from ..utils import bell
3030

3131

@@ -44,26 +44,6 @@ def test_backends(self, service):
4444
f"backend_names={backend_names}",
4545
)
4646

47-
@run_integration_test
48-
@quantum_only
49-
def test_backend_wrong_instance(self, service):
50-
"""Test getting a backend with wrong instance."""
51-
hgps = list(service._hgps.keys())
52-
if len(hgps) < 2:
53-
raise SkipTest("Skipping test, not enough instances")
54-
55-
hgp_1 = hgps[0]
56-
hgp_2 = hgps[1]
57-
hgp_1_backends = [backend.name for backend in service.backends(instance=hgp_1)]
58-
hgp_2_backends = [backend.name for backend in service.backends(instance=hgp_2)]
59-
unique_backends_list = list(
60-
set(hgp_2_backends) - set(hgp_1_backends)
61-
) # get differences between the two lists
62-
if unique_backends_list:
63-
unique_backend = unique_backends_list[0]
64-
with self.assertRaises(QiskitBackendNotFoundError):
65-
service.backend(unique_backend, instance=hgp_1)
66-
6747
@run_integration_test
6848
def test_get_backend(self, service):
6949
"""Test getting a backend."""

test/integration/test_backend_serialization.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -49,21 +49,6 @@ def test_backend_configuration(self, service):
4949
with self.subTest(backend=backend):
5050
self._verify_data(backend.configuration().to_dict(), good_keys, good_keys_prefixes)
5151

52-
@run_integration_test
53-
def test_pulse_defaults(self, service):
54-
"""Test deserializing backend configuration."""
55-
instance = self.dependencies.instance if service.channel == "ibm_quantum" else None
56-
backends = service.backends(operational=True, open_pulse=True, instance=instance)
57-
if not backends:
58-
self.skipTest("Need pulse backends.")
59-
60-
# Known keys that look like a serialized complex number.
61-
good_keys = ("cmd_def.qubits", "cmd_def.sequence.ch")
62-
63-
for backend in backends:
64-
with self.subTest(backend=backend):
65-
self._verify_data(backend.defaults().to_dict(), good_keys)
66-
6752
@run_integration_test
6853
def test_backend_properties(self, service):
6954
"""Test deserializing backend properties."""

test/integration/test_basic_server_paths.py

Lines changed: 0 additions & 67 deletions
This file was deleted.

test/integration/test_job.py

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
)
2424

2525
from ..ibm_test_case import IBMIntegrationJobTestCase
26-
from ..decorators import run_integration_test, production_only, quantum_only
26+
from ..decorators import run_integration_test, production_only
2727
from ..serialization import (
2828
SerializableClass,
2929
)
@@ -52,18 +52,6 @@ def test_run_with_simplejson(self, service):
5252
except ImportError:
5353
self.assertRaises(ImportError)
5454

55-
@run_integration_test
56-
@quantum_only
57-
def test_run_program_log_level(self, service):
58-
"""Test running with a custom log level."""
59-
levels = ["INFO", "ERROR"]
60-
for level in levels:
61-
with self.subTest(level=level):
62-
job = self._run_program(service, log_level=level)
63-
job.wait_for_final_state()
64-
if job.logs():
65-
self.assertIn("Completed", job.logs())
66-
6755
@run_integration_test
6856
@production_only
6957
def test_cancel_job_queued(self, service):
@@ -156,8 +144,6 @@ def test_wait_for_final_state(self, service):
156144
@production_only
157145
def test_run_program_missing_backend_ibm_cloud(self, service):
158146
"""Test running an ibm_cloud program with no backend."""
159-
if self.dependencies.channel == "ibm_quantum":
160-
self.skipTest("Not supported on ibm_quantum")
161147
with self.subTest():
162148
job = self._run_program(service=service, backend="")
163149
_ = job.status()

0 commit comments

Comments
 (0)