Skip to content

Conversation

@airwoodix
Copy link
Contributor

Resolves #25.

Handle WATCH_INTERVAL, as override for the -n, --interval option in watch.

@airwoodix airwoodix force-pushed the watch-env-interval branch from 07ccb18 to d8d3eaa Compare March 23, 2025 21:08
@airwoodix airwoodix marked this pull request as ready for review March 23, 2025 21:08
@Krysztal112233
Copy link
Collaborator

Ah, thanks for your contributing and please fix CI failure, you have to format your code using rustfmt :)

@airwoodix airwoodix force-pushed the watch-env-interval branch from d8d3eaa to 33a55e6 Compare March 24, 2025 11:28
@airwoodix
Copy link
Contributor Author

Thanks for the prompt feedback! The code should now be properly formatted.

@Krysztal112233
Copy link
Collaborator

Ah, CI failed.

failures:

---- test_watch::test_interval_environment_variable stdout ----
run: /Users/runner/work/procps/procps/target/debug/procps watch echo -n hello

thread 'test_watch::test_interval_environment_variable' panicked at tests/by-util/test_watch.rs:86:10:
assertion failed: `(left == right)`: stdout as bytes wasn't equal to expected bytes. Result as strings:
stdout  ='Ok("-n hello\n-n hello\n")'
expected='Ok("hellohello")'

Diff < left / right > :
 [
<    45,
<    110,
<    32,
     104,
     101,
     108,
     108,
     111,
<    10,
<    45,
<    110,
<    32,
     104,
     101,
     108,
     108,
     111,
<    10,
 ]




failures:
    test_watch::test_interval_environment_variable

test result: FAILED. 82 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 2.63s

error: test failed, to rerun pass `-p procps --test tests`

could you please fix it?

@airwoodix
Copy link
Contributor Author

Sorry for the delay. I'll get back to this when I have time to debug this apparently macos-specific issue (the test passes locally on my linux machine - the linux CI didn't run yet on this branch).

@airwoodix airwoodix force-pushed the watch-env-interval branch from 33a55e6 to 8bee899 Compare April 4, 2025 09:00
@cakebaker cakebaker force-pushed the watch-env-interval branch from 8bee899 to 70d4f9a Compare April 4, 2025 09:44
@cakebaker
Copy link
Contributor

Can you please run cargo fmt?

@airwoodix airwoodix force-pushed the watch-env-interval branch from 70d4f9a to 5324857 Compare April 4, 2025 11:18
@airwoodix airwoodix force-pushed the watch-env-interval branch from 5324857 to 20d7f29 Compare April 4, 2025 11:20
@airwoodix airwoodix requested a review from cakebaker April 4, 2025 11:21
@cakebaker cakebaker merged commit a592ac3 into uutils:main Apr 4, 2025
14 checks passed
@cakebaker
Copy link
Contributor

Thanks for your PR!

@codecov
Copy link

codecov bot commented Apr 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 0.00%. Comparing base (c597cc6) to head (20d7f29).
Report is 5 commits behind head on main.

Additional details and impacted files
@@     Coverage Diff     @@
##   main   #363   +/-   ##
===========================
===========================

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@airwoodix airwoodix deleted the watch-env-interval branch April 4, 2025 13:25
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.

watch: implement --interval

3 participants