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

Utility: Introduce command repeater script #8227

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bkhouri
Copy link
Contributor

@bkhouri bkhouri commented Jan 16, 2025

Introduce a command repeater script to help run a set of commands repeatedly.

Downside:

  • the script must be manually modified to define the set of commands to be executed

Copy link
Contributor

@MaxDesiatov MaxDesiatov left a comment

Choose a reason for hiding this comment

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

Is there a particular reason this is written in Bash instead of Python or Swift? What's the plan for running this utility on Windows?

@MaxDesiatov
Copy link
Contributor

Additionally, what's the goal of this script in general? Is this supposed to be used on CI or locally? I see it measures completion time, which is not meaningful to measure on CI in the vast majority of cases. Then if it's only for local use, why prefer this instead of existing utilities like hyperfine?

@bkhouri
Copy link
Contributor Author

bkhouri commented Jan 16, 2025

Additionally, what's the goal of this script in general? Is this supposed to be used on CI or locally?

I have been using it to determine if my changes introduced intermittent test failures. I wrote it in bash as that was alot easier to get started.

I originally created this is bash as I was using it for myself for a while and didn't want to copy it from one worktree to the next. We can investigate converting to Swift or Python at a later date, if it is deems to be useful enough.

The timing calculations were adding for information purposes.

why prefer this instead of existing utilities like hyperfine?

I did not know about hyperfine, and it is not available on all systems by default.

❯ which hyperfine
hyperfine not found

❯ command -v hyperfine

❯ echo $?
1

@bkhouri bkhouri marked this pull request as draft January 16, 2025 15:57
@bkhouri
Copy link
Contributor Author

bkhouri commented Jan 16, 2025

The more I think about it, the more I like the idea of creating a python script. I'm converting this PR to draft to work on this.

@bkhouri bkhouri force-pushed the t/main/add_repeated_command_utility branch from 7cade49 to 35cccb2 Compare January 16, 2025 20:50
@bkhouri bkhouri marked this pull request as ready for review January 16, 2025 20:50
@bkhouri bkhouri force-pushed the t/main/add_repeated_command_utility branch 4 times, most recently from 4a2aee4 to d640fc7 Compare January 17, 2025 01:52
@bkhouri bkhouri requested a review from MaxDesiatov January 17, 2025 03:28
@bkhouri bkhouri force-pushed the t/main/add_repeated_command_utility branch from cc9ac5e to ce43cb7 Compare January 17, 2025 03:53
Introduce a command repeater script to help run a set of commands
repeatedly.

Also, enforce black formatting, flake8 linting and mypy type checking on
`Utilities/repeat_command` via the `Utilities/build-using-self` script,
which is executed in the self-hosted CI pipelines.
@bkhouri bkhouri force-pushed the t/main/add_repeated_command_utility branch from ce43cb7 to 54a56db Compare January 17, 2025 03:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants