Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Split by test type #253

Merged
merged 3 commits into from
Mar 7, 2022
Merged

Conversation

daka1510
Copy link
Collaborator

@daka1510 daka1510 commented Mar 4, 2022

Summary

Make a clear separation between unit (that run locally) and integration tests (that require configured API credentials). Back-ports parts of Qiskit/qiskit-ibm-runtime#139.

Details and comments

In this PR I did neither focus on fixing integration tests, nor making a split between integration and e2e tests. The main goal is to align the overall structure with the one used in qiskit-ibm-runtime to ease porting changes required for #237.

pip install -c constraints.txt -e .
pip install -U -c constraints.txt -r requirements-dev.txt
- name: Run Tests
run: make runtime_integration
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests targeted a file that no longer exists

test/ibm/runtime/test_runtime_integration.py

Comment on lines 36 to +43
test1:
python -m unittest -v test/ibm/test_ibm_backend.py test/ibm/test_account_client.py test/ibm/test_ibm_job_states.py test/ibm/test_tutorials.py test/ibm/test_basic_server_paths.py test/ibm/test_proxies.py test/ibm/test_ibm_integration.py test/ibm/test_ibm_logger.py test/ibm/test_filter_backends.py test/ibm/test_registration.py
python -m unittest -v test/integration/test_ibm_backend.py test/integration/test_account_client.py test/integration/test_ibm_job_states.py test/integration/test_tutorials.py test/integration/test_basic_server_paths.py test/integration/test_proxies.py test/integration/test_ibm_integration.py test/integration/test_ibm_logger.py test/integration/test_filter_backends.py test/integration/test_registration.py

test2:
python -m unittest -v test/ibm/test_ibm_qasm_simulator.py test/ibm/test_serialization.py test/ibm/test_jupyter.py test/ibm/test_composite_job.py test/ibm/test_ibm_provider.py
python -m unittest -v test/integration/test_ibm_qasm_simulator.py test/integration/test_serialization.py test/integration/test_jupyter.py test/integration/test_composite_job.py test/integration/test_ibm_provider.py

test3:
python -m unittest -v test/ibm/test_ibm_job_attributes.py test/ibm/test_ibm_job.py test/ibm/websocket/test_websocket.py test/ibm/websocket/test_websocket_integration.py
python -m unittest -v test/integration/test_ibm_job_attributes.py test/integration/test_ibm_job.py test/integration/websocket/test_websocket.py test/integration/websocket/test_websocket_integration.py
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guess we should migrate this later and get rid of the need to maintain hard-coded lists of file names here. This is easy to do with the new folder structure now.

@@ -73,37 +73,6 @@ def test_pass_unreachable_proxy(self, qe_token, qe_url):
IBMProvider(qe_token, qe_url, proxies=proxies)
self.assertIn("ProxyError", str(context_manager.exception))

def test_provider_init_non_auth_url(self):
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've split off unit tests from this integration test file and added the removed test cases to a new file within test/unit

@@ -43,13 +43,13 @@ def setup_test_logging(logger: logging.Logger, filename: str):
)
formatter = logging.Formatter(log_fmt)

if os.getenv("STREAM_LOG", "true"):
if os.getenv("STREAM_LOG", "true").lower() == "true":
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@coveralls
Copy link

coveralls commented Mar 4, 2022

Pull Request Test Coverage Report for Build 1943753443

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 177 unchanged lines in 22 files lost coverage.
  • Overall coverage decreased (-1.9%) to 41.313%

Files with Coverage Reduction New Missed Lines %
qiskit_ibm_provider/jupyter/dashboard/init.py 1 0.0%
qiskit_ibm_provider/visualization/init.py 2 0.0%
qiskit_ibm_provider/jupyter/init.py 3 0.0%
qiskit_ibm_provider/jupyter/dashboard/utils.py 4 0.0%
qiskit_ibm_provider/jupyter/qubits_widget.py 6 0.0%
qiskit_ibm_provider/utils/utils.py 6 76.83%
qiskit_ibm_provider/jupyter/dashboard/constants.py 7 0.0%
qiskit_ibm_provider/jupyter/gates_widget.py 7 0.0%
qiskit_ibm_provider/jupyter/utils.py 7 0.0%
qiskit_ibm_provider/visualization/interactive/gate_map.py 7 0.0%
Totals Coverage Status
Change from base Build 1935768037: -1.9%
Covered Lines: 1743
Relevant Lines: 4219

💛 - Coveralls

Copy link
Member

@rathishcholarajan rathishcholarajan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@rathishcholarajan rathishcholarajan merged commit 4bf36c9 into Qiskit:main Mar 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants