Commit graph

1615 commits

Author SHA1 Message Date
Martijn Pieters 6635d1e1b8
Give each task a separate process group
This makes it vastly easier to handle task singnalling; signals can be sent to all
processes in the group, including SIGTERM.

The Apple and Linux variants have largely been combined into a single codebase.
2022-11-14 21:35:09 +00:00
Arne Beer 9b69c422a4
Merge pull request #387 from Nukesor/local_time_logging
Local time logging
2022-11-14 14:19:03 +01:00
Arne Beer 4c27640484
fix: Use localtime for log output 2022-11-14 14:01:49 +01:00
Arne Beer c5a303ee36
Merge pull request #386 from Nukesor/task_creation
Task created_at and enqueued_at
2022-11-14 13:39:25 +01:00
Arne Beer 4762d2a90f
refactor: Streamline docblock position 2022-11-14 13:27:35 +01:00
Arne Beer a6d6963df7
add: Task.created_at and Task.enqueued_at 2022-11-14 13:21:21 +01:00
Arne Beer fcf6c30726
add: status query changelog entry 2022-11-14 12:25:56 +01:00
Arne Beer 57da8ff3a7
Merge pull request #384 from mjpieters/rust_165_warnings
Address warnings issued by new rust release.
2022-11-05 07:57:18 +01:00
Martijn Pieters fc7e362423
Address warnings issued by new rust release.
Rust 1.65.0 was released this week and clippy now [flags up needless
borrows in more situations][1]. This commit addresses the new warnings.

[1]: https://github.com/rust-lang/rust-clippy/blob/master/CHANGELOG.md#enhancements
2022-11-04 16:23:28 +00:00
Arne Beer ad21f142f4
Merge pull request #378 from mjpieters/project-unflake
Address flaky tests
2022-10-29 12:54:12 +02:00
Martijn Pieters 2bd359b837
Avoid forwarding messages to the task handler that won't succeed
This avoids a class of race errors where the message handler reports a failure but because the task handler sees a later iteration of the state, the request actually succeeds.
2022-10-28 20:27:58 +01:00
Martijn Pieters 5cfecbfb32
Fix flaky client::group::default test
The group command could be run before the `group add` command had
completed. Explicitly wait for the group to exist first.
2022-10-28 20:26:02 +01:00
Martijn Pieters 96ddcd40bf
Fix flaky daemon::group::colored test
The status output sometimes ran before the group state git changed; add
a group status wait for the state to change.
2022-10-28 20:26:02 +01:00
Martijn Pieters 9adf322df4
Make tests::helper::wait::wait_for_group_status actually wait
Make the function fetch a new status every loop iteration and actually
test the group status attribute against the expected status.

This fixes the flaking observed in `daemon_tests` ->
`daemon::edit::test_edit_flow`, where the final task state after editing
is 'Running' because the edit takes place before the 'Pause' operation
has completed.
2022-10-28 20:26:02 +01:00
Martijn Pieters 2cb281787e
Dev support: add test-log to help debug tests
With test-log, using the test_log::test macro to replace a `#[test]`
attribute (or to wrap a `#[tokio::test(...)]` attribute) injects logging
setup boilerplate to that test. Use `RUST_LOG=<level>` to then control
logging output for such tests, visible when the test fails or when using
`cargo test -- --nocapture` / `cargo nextest run --no-capture`.  The
default log level is 'error'.
2022-10-28 20:26:01 +01:00
Martijn Pieters 595e4d4128
Produce test reports for test runs
These will help surface flaky tests, and help PR authors see what tests
are failing, if any. The workflow uses the really excellent [Publish
Test Results][ptr] GitHub action to do all the heavy lifting.

[ptr]: https://github.com/marketplace/actions/publish-test-results
2022-10-28 20:25:29 +01:00
Martijn Pieters e355e38f9b
Use cargo nextest to run tests
Cargo nextest is faster, and handles flaky tests (tests that can fail even
though nothing changed). Both the regular test run and the coverage run include
it.
2022-10-28 20:25:28 +01:00
Arne Beer 6ccefcab0e
Merge pull request #381 from mjpieters/refactor_use_from_into
Refactor: Use From / Into to abstract message sending
2022-10-28 17:30:15 +02:00
Martijn Pieters 9a3cf4ab17
Refactor: Use From / Into to abstract message sending
This makes Message use simpler, getting rid of a lot of boilerplate. The task manager channel is now a wrapper type accepting Into<Message>, keeping implementation details closer to the rest of the task manager code base.
2022-10-28 15:15:45 +01:00
Arne Beer 3d0fb4bfff
Merge pull request #382 from mjpieters/codecov_fix
CI: correct codecov configuration syntax
2022-10-28 12:05:28 +02:00
Martijn Pieters 3f7ee0c4db
CI: correct codecov configuration syntax
Following the [documentation][1], this is clearly intended to be the
[`coverage` section][2]. The file is now valid [as per the codecov
API][3].

[1]: https://docs.codecov.com/docs/codecovyml-reference
[2]: https://docs.codecov.com/docs/codecovyml-reference#coverage
[3]: https://docs.codecov.com/docs/codecov-yaml#validate-your-repository-yaml
2022-10-20 10:09:39 +01:00
Arne Beer dbdcf6ec88
Merge pull request #380 from mjpieters/async_sleep
Use async sleep
2022-10-19 16:53:52 +02:00
Martijn Pieters ed2a757492
Use async sleep
Use tokio::time::sleep rather than std:🧵:sleep; the async version cooperates (yields to other tasks), so _just the task_ is blocked, not all tasks being run in the same thread.
2022-10-18 22:11:31 +01:00
Arne Beer beaad446f7
docs: Fix inter-code link in TableBuilder. 2022-10-14 13:25:38 +02:00
Arne Beer 358fa10364
Merge pull request #373 from Nukesor/update_deps
Update deps
2022-10-13 23:42:19 +02:00
Arne Beer 8082143be8
chore: Update to clapv4 2022-10-12 22:26:17 +02:00
Arne Beer 913f1473dd
chore: Bump safe deps 2022-10-12 21:21:46 +02:00
Arne Beer c2bf0807db
fix: Flaky client wait test 2022-10-06 11:56:54 +02:00
Arne Beer a6893de560
Merge pull request #370 from Nukesor/label-like-filter
add: Label contains filter and label tests
2022-10-01 22:10:35 +02:00
Arne Beer 2b04910fe3
add: Label contains filter and label tests 2022-10-01 21:57:36 +02:00
Arne Beer a322493e7d
Merge pull request #367 from Nukesor/filter-status
Filter status
2022-10-01 19:57:37 +02:00
Arne Beer a33e17177c
fix: Rust v1.64 lints 2022-10-01 19:50:47 +02:00
Arne Beer b90beb54bb
fix: Smaller enqueue_at interval to prevent CI failures at midnight 2022-10-01 19:50:47 +02:00
Arne Beer 72cef39bfd
test: status with multiple groups 2022-10-01 19:50:46 +02:00
Arne Beer a1c4cf606f
test: status --group 2022-10-01 19:50:46 +02:00
Arne Beer d2a56eb83d
refactor: Streamline status snapshot and test names 2022-10-01 19:50:46 +02:00
Arne Beer f59b9138c4
refactor: Simplify state json printing logic 2022-10-01 19:50:46 +02:00
Arne Beer d4f39bce62
fix: Flaky filter start test 2022-10-01 19:50:46 +02:00
Arne Beer 27a5d9facc
test: Filter status 2022-10-01 19:50:45 +02:00
Arne Beer a4fa1dc12a
tests: Fix running test in query tests 2022-10-01 19:50:45 +02:00
Arne Beer ae749645d5
refactor: Ignore trailing whitespaces in snapshot tests 2022-10-01 19:50:45 +02:00
Arne Beer 2a93be7132
tests: query first and last tasks 2022-10-01 19:50:45 +02:00
Arne Beer f79c5284bf
test: Query columns 2022-10-01 19:50:45 +02:00
Arne Beer 5a5a2680c6
refactor: Rename filter to query 2022-10-01 19:50:44 +02:00
Arne Beer a1edf3d537
test: order_by status, filter end, filter start 2022-10-01 19:50:44 +02:00
Arne Beer c0f738a68a
tests: Default filter status 2022-10-01 19:50:44 +02:00
Arne Beer 37ba666ced
tests: pueue status filters 2022-10-01 19:50:44 +02:00
Arne Beer dad40ff2ab
refactor: Simplify pest result handling 2022-10-01 19:50:44 +02:00
Arne Beer b0c92e5e2d
add: limit condition 2022-10-01 19:50:43 +02:00
Arne Beer 26bc96fbb2
add: Order by in status query 2022-10-01 19:50:43 +02:00