amonks / run

Go run some tasks!
https://amonks.github.io/run/
Other
19 stars 4 forks source link

watch is confusing #129

Open jellevandenhooff opened 7 months ago

jellevandenhooff commented 7 months ago

Hi! Thank you for your delightful software.

I tried the following tasks.toml.

# tasks.toml

[[task]]
id = "go-test"
type = "short"
watch = ["**/*.go"]
cmd = """
    go test ./...
  """

I ran run -ui=tui go-test. This ran my tests.

Then I went and changed a go file and expected the tests would run again. The tests did not run again, even though @watch claiming to be watching **/*.go.

Eventually I figured out that running a long dev task depending on go-test fixed the re-runner. Is this behavior intended?

amonks commented 7 months ago

@jellevandenhooff! thanks for trying run.

Great catch! This is only semi-intended behavior: it works as designed, but it's a bad design. What's happening is that even though the ui is "tui", the run as-a-whole is getting marked as "short", and the execution stuff exits when the last task completes.

I'm working on a refactor that makes the long-vs-short behavior a lot more explicit; I'll include this as a test case. In the meantime, your workaround seems like a good option.

amonks commented 6 months ago

this test is now passing in my dev branch, so this enhancement will definitely happen some time.