Skip to content

untangle entangled tests #5892

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 27, 2022
Merged
Show file tree
Hide file tree
Changes from 2 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: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,7 @@ jobs:
- name: Install dependencies
run: pip install -r dev_tools/requirements/isolated-base.env.txt
- name: Test each module in isolation
# TODO(#5870) - remove --randomly-dont-reorganize after fixing order-related test failures
run: pytest --randomly-dont-reorganize -n auto -m slow dev_tools/packaging/isolated_packages_test.py
run: pytest -n auto -m slow dev_tools/packaging/isolated_packages_test.py
pytest:
name: Pytest Ubuntu
strategy:
Expand Down
2 changes: 0 additions & 2 deletions check/pytest
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ cd "$(dirname "${BASH_SOURCE[0]}")"
cd "$(git rev-parse --show-toplevel)"

PYTEST_ARGS=()
# TODO(#5870) - remove this after fixing order-related test failures
PYTEST_ARGS+=("--randomly-dont-reorganize")

PARALLEL=""
for arg in "$@"; do
Expand Down
2 changes: 1 addition & 1 deletion cirq-google/cirq_google/engine/engine_job_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from cirq_google.engine.test_utils import uses_async_mock


@pytest.fixture(scope='session', autouse=True)
@pytest.fixture(scope='module', autouse=True)
def mock_grpc_client():
with mock.patch(
'cirq_google.engine.engine_client.quantum.QuantumEngineServiceClient'
Expand Down
2 changes: 1 addition & 1 deletion cirq-google/cirq_google/engine/engine_processor_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def _to_timestamp(json_string):
)


@pytest.fixture(scope='session', autouse=True)
@pytest.fixture(scope='module', autouse=True)
def mock_grpc_client():
with mock.patch(
'cirq_google.engine.engine_client.quantum.QuantumEngineServiceClient'
Expand Down
2 changes: 1 addition & 1 deletion cirq-google/cirq_google/engine/engine_program_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ def test_get_batch_size(get_program_async):
_ = program.batch_size()


@pytest.fixture(scope='session', autouse=True)
@pytest.fixture(scope='module', autouse=True)
def mock_grpc_client():
with mock.patch(
'cirq_google.engine.engine_client.quantum.QuantumEngineServiceClient'
Expand Down
2 changes: 1 addition & 1 deletion cirq-google/cirq_google/engine/engine_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ def test_make_random_id():
assert random_id != random_id2


@pytest.fixture(scope='session', autouse=True)
@pytest.fixture(scope='module', autouse=True)
def mock_grpc_client_async():
with mock.patch(
'cirq_google.engine.engine_client.quantum.QuantumEngineServiceAsyncClient', autospec=True
Expand Down
3 changes: 1 addition & 2 deletions dev_tools/packaging/isolated_packages_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,8 @@ def test_isolated_packages(cloned_env, module):
)
assert result.returncode == 0, f"Failed to install {module.name}:\n{result.stderr}"

# TODO(#5870) - remove --randomly-dont-reorganize after fixing order-related test failures
result = shell_tools.run(
f"{env}/bin/pytest --randomly-dont-reorganize ./{module.root} --ignore ./cirq-core/cirq/contrib".split(),
f"{env}/bin/pytest ./{module.root} --ignore ./cirq-core/cirq/contrib".split(),
capture_output=True,
check=False,
)
Expand Down