Skip to content

Conversation

@mhucka
Copy link
Contributor

@mhucka mhucka commented Jan 4, 2025

image

This workflow is designed to let you run pytest with various debugging options. It's meant to be executed manually using the "Run workflow" button on https://github.com/quantumlib/Cirq/actions/workflows/debug.yaml

Clicking the "Run workflow" button there will make GitHub present a form interface with various options for the characteristics of the run. (See screenshot at right.) Options include:

  • give it a specific test to run (in the form of a path to a test file)
  • set the number of repetitions of the test
  • set the python version to use
  • set the random seed
  • turn on verbose logging

This workflow was developed as an aid to debugging issue #6906, involving curve fitting that failed on occasion. This workflow is general and I think it will be useful for other debugging needs.

mhucka added 2 commits January 3, 2025 18:15
This workflow is designed to let you run pytest with various debugging
options. It's meant to be executed manually using "Run workflow"on
https://github.com/quantumlib/Cirq/actions/workflows/debug.yaml

Clicking the "Run workflow" button there will make GitHub present a
form interface with various options for the characteristics of the
run. Options include:

- give it a specific test to run (in the form of a path to a test file)
- set the number of repetitions of the test
- set the python version to use
- set the random seed
- turn on verbose logging

This workflow was developed as an aid to debugging issue quantumlib#6906,
involving curve fitting that failed on occasion. This workflow is
general and I think it will be useful for other debugging needs.
@CirqBot CirqBot added the size: M 50< lines changed <250 label Jan 4, 2025
@codecov
Copy link

codecov bot commented Jan 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.87%. Comparing base (0361a81) to head (dbb5871).
Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6918   +/-   ##
=======================================
  Coverage   97.87%   97.87%           
=======================================
  Files        1084     1084           
  Lines       94420    94447   +27     
=======================================
+ Hits        92409    92436   +27     
  Misses       2011     2011           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mhucka mhucka marked this pull request as ready for review January 4, 2025 02:34
@mhucka mhucka requested review from a team and vtomole as code owners January 4, 2025 02:34
1) Turns out `--trace-config` is not that useful.
2) Using `--strict-config` seems like a good idea.
@mhucka mhucka self-assigned this Jan 9, 2025
@mhucka mhucka enabled auto-merge (squash) January 14, 2025 15:23
@mhucka mhucka merged commit ede4124 into quantumlib:main Jan 15, 2025
35 checks passed
@pavoljuhas
Copy link
Collaborator

Thank you for adding this @mhucka. A couple of questions for future reference -

  1. Can this be triggered for a pull request from forked repository?
    The "Use worfklow from" menu shows only branches and tags in the main repo.

  2. I assume non-member GitHub users cannot run this, is that correct?

@mhucka
Copy link
Contributor Author

mhucka commented Jan 21, 2025

  1. Can this be triggered for a pull request from forked repository? The "Use worfklow from" menu shows only branches and tags in the main repo.

A person should be able to run it in their fork on GitHub. The user may first need to enable running workflows from forked repositories in their fork's repository settings, and if their repo is under an organization, that setting may be controlled at the org level, which means it might require permissions adjustments by the org admins. Also, the workflow will run in their forked environment (using their tokens etc.).

However, as currently set up, I don't think a user could run it from the Cirq repository interface on their fork. So, the interface at https://github.com/quantumlib/Cirq/actions/workflows/pytest-debug.yaml won't let it be run on a pull request from a fork. However, the user themselves should be able to run it from https://github.com/USERACCOUNT/Cirq/actions/workflows/pytest-debug.yaml.

I guess the upshot is that users can run it for themselves on their own repo, but we can't run it on their pull request.

  1. I assume non-member GitHub users cannot run this, is that correct?

As I understand it, to manually trigger a workflow using workflow_dispatch, a user must have write access to the repository, so basically that's correct; however, I think it's possible to give special permissions to individual users, so it might be possible to grant the privileges to non-member users.

I'm not sure what non-member users will see in the GUI interface – I don't know whether that means the "Run workflow" button doesn't show up at all for them, or something else happens.

@mhucka mhucka deleted the mhucka-add-debug-workflow branch January 29, 2025 17:48
@mhucka mhucka changed the title Add manually-triggered debugging workflow Add manually-triggered GitHub Actions workflow for debugging Apr 8, 2025
BichengYing pushed a commit to BichengYing/Cirq that referenced this pull request Jun 20, 2025
* Add manually-triggered debugging workflow

This workflow is designed to let you run pytest with various debugging options. It's meant to be executed manually using "Run workflow"on https://github.com/quantumlib/Cirq/actions/workflows/debug.yaml

Clicking the "Run workflow" button there will make GitHub present a form interface with various options for the characteristics of the run. Options include:

- give it a specific test to run (in the form of a path to a test file)
- set the number of repetitions of the test
- set the python version to use
- set the random seed
- turn on verbose logging

This workflow was developed as an aid to debugging issue quantumlib#6906, involving curve fitting that failed on occasion. This workflow is general and I think it will be useful for other debugging needs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: M 50< lines changed <250

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants