Skip to content
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

Update CI MacOS to fix notebook test error #6366

Merged
merged 10 commits into from
Dec 2, 2023
3 changes: 2 additions & 1 deletion .github/workflows/ci-daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ jobs:
pip install \
-r dev_tools/requirements/deps/format.txt \
-r dev_tools/requirements/deps/pylint.txt \
-r dev_tools/requirements/deps/pytest.txt
-r dev_tools/requirements/deps/pytest.txt \
-r dev_tools/requirements/deps/notebook.txt
- name: Pytest check
run: check/pytest -n auto --ignore=cirq-core/cirq/contrib --enable-slow-tests
2 changes: 1 addition & 1 deletion dev_tools/notebooks/notebook_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def env_with_temporary_pip_target():


@pytest.mark.slow
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we temporarily comment out this slow mark to include the test in this PR checks?

If the checks pass, let's put the mark back and merge.

Copy link
Contributor Author

@smburdick smburdick Dec 1, 2023

Choose a reason for hiding this comment

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

Can you explain what you mean by check the CI here? I thought the PR checks were handling that, but I could be mistaken

Copy link
Collaborator

Choose a reason for hiding this comment

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

If test is decorated with @pytest.mark.slow it is not included in the CI checks executed for the PR and instead runs in scheduled daily workflows. Removing/commenting the slow mark will run the test in PR checks and we'll know if the fix worked sooner.

@pytest.mark.skipif(sys.platform != "linux", reason="Linux-only test")
@pytest.mark.skipif(sys.platform not in ["linux", "darwin"], reason="Linux/Mac-only test")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
@pytest.mark.skipif(sys.platform not in ["linux", "darwin"], reason="Linux/Mac-only test")
@only_on_posix

please reuse the existing decorator from dev_tools.test_utils import only_on_posix
Otherwise LGTM, thank you!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@pytest.mark.parametrize("notebook_path", filter_notebooks(list_all_notebooks(), SKIP_NOTEBOOKS))
def test_notebooks_against_cirq_head(
notebook_path, require_packages_not_changed, env_with_temporary_pip_target
Expand Down
Loading