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

fix(executor): Adding silent mode and tests #125

Merged
merged 3 commits into from
Feb 26, 2024
Merged

Conversation

sledigabel
Copy link
Contributor

@sledigabel sledigabel commented Feb 1, 2024

Reason for change

While looking at #94, I've notived that the output of turbolift commit
includes a weird line:

Executing: /opt/homebrew/bin/zsh [-c ...]
image

This is because isRepoChanged function executes a command to figure out whether something is marked as changed. Every command executed generates an echo of the command for the user.

What's changed?

This PR introduces a new flag on the executor that will skip the echo.
This fixes the extraneous output in isRepoChanged but will also be useful in future features.

It also adds unit tests on the executor package which were missing before.
The tests highlighted a race condition that went unnoticed previously and is also now fixed.

Result of the PR

The extra line doesn't print any more.
image

While looking at #94, I've notived that the output of `turbolift commit`
includes a weird line:

```
Executing: /opt/homebrew/bin/zsh [-c ...]
```

This is because `isRepoChanged` function executes a command to figure out whether something is marked as changed. Every command executed generates an echo of the command for the user.

This PR introduces a new flag on the executor that will skip the echo.
This fixes the extraneous output in `isRepoChanged` but will also be
useful in future features.
@sledigabel sledigabel marked this pull request as ready for review February 1, 2024 19:16
Copy link
Collaborator

@Dan7-7-7 Dan7-7-7 left a comment

Choose a reason for hiding this comment

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

LGTM - adds a flag to suppress logging command output to the user, but maintains the current behaviour as default. Also fixes and tests for a race condition to do with the command outputs.

@sledigabel sledigabel merged commit 591f889 into main Feb 26, 2024
5 checks passed
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