From 9fa79400399162ab236bf4c80e02b8fc92f9ccda Mon Sep 17 00:00:00 2001 From: kevin-tian Date: Tue, 5 Dec 2023 14:04:27 -0500 Subject: [PATCH 1/3] wip debug wrong instance test --- .github/workflows/ci.yml | 1 - test/integration/test_backend.py | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 01a763c81..c5c15e80e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -111,7 +111,6 @@ jobs: parallel: true path-to-lcov: coverage.lcov integration-tests: - if: github.event_name == 'push' && github.repository_owner == 'Qiskit' # only kick-off resource intensive integration tests if unit tests and all basic checks succeeded needs: [ "unit-tests" ] name: Run integration tests - ${{ matrix.environment }} diff --git a/test/integration/test_backend.py b/test/integration/test_backend.py index 865a3659d..e61cf8031 100644 --- a/test/integration/test_backend.py +++ b/test/integration/test_backend.py @@ -59,9 +59,12 @@ def test_backend_wrong_instance(self, service): unique_hgp = list( set(hgp_2_backends) - set(hgp_1_backends) ) # get differences between the two lists + print(hgp_1_backends) + print(hgp_2_backends) if unique_hgp: unique_backend = unique_hgp[0] with self.assertRaises(QiskitBackendNotFoundError): + print(unique_backend, hgp_1) service.backend(unique_backend.name, instance=hgp_1) @run_integration_test From 2efbf952de386675ba6aeaee66109e90eabb368e Mon Sep 17 00:00:00 2001 From: kevin-tian Date: Tue, 5 Dec 2023 14:33:09 -0500 Subject: [PATCH 2/3] enable integration test --- .github/workflows/integration-tests.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index a3c6c2cf4..f9293a578 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -18,7 +18,6 @@ on: workflow_dispatch: jobs: integration-tests: - if: github.repository_owner == 'Qiskit' name: Run integration tests - ${{ matrix.environment }} runs-on: ${{ matrix.os }} strategy: From 822660bd1d0f270d094d72098d756d5d19cce458 Mon Sep 17 00:00:00 2001 From: kevin-tian Date: Tue, 5 Dec 2023 18:41:14 -0500 Subject: [PATCH 3/3] use backend names instead of obj --- .github/workflows/ci.yml | 1 + .github/workflows/integration-tests.yml | 1 + test/integration/test_backend.py | 15 ++++++--------- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c5c15e80e..01a763c81 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -111,6 +111,7 @@ jobs: parallel: true path-to-lcov: coverage.lcov integration-tests: + if: github.event_name == 'push' && github.repository_owner == 'Qiskit' # only kick-off resource intensive integration tests if unit tests and all basic checks succeeded needs: [ "unit-tests" ] name: Run integration tests - ${{ matrix.environment }} diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index f9293a578..a3c6c2cf4 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -18,6 +18,7 @@ on: workflow_dispatch: jobs: integration-tests: + if: github.repository_owner == 'Qiskit' name: Run integration tests - ${{ matrix.environment }} runs-on: ${{ matrix.os }} strategy: diff --git a/test/integration/test_backend.py b/test/integration/test_backend.py index bc897c5e1..788d08f46 100644 --- a/test/integration/test_backend.py +++ b/test/integration/test_backend.py @@ -55,18 +55,15 @@ def test_backend_wrong_instance(self, service): hgp_1 = hgps[0] hgp_2 = hgps[1] - hgp_1_backends = service.backends(instance=hgp_1) - hgp_2_backends = service.backends(instance=hgp_2) - unique_hgp = list( + hgp_1_backends = [backend.name for backend in service.backends(instance=hgp_1)] + hgp_2_backends = [backend.name for backend in service.backends(instance=hgp_2)] + unique_backends_list = list( set(hgp_2_backends) - set(hgp_1_backends) ) # get differences between the two lists - print(hgp_1_backends) - print(hgp_2_backends) - if unique_hgp: - unique_backend = unique_hgp[0] + if unique_backends_list: + unique_backend = unique_backends_list[0] with self.assertRaises(QiskitBackendNotFoundError): - print(unique_backend, hgp_1) - service.backend(unique_backend.name, instance=hgp_1) + service.backend(unique_backend, instance=hgp_1) @run_integration_test @quantum_only