taskwarrior-tui: Tests are failing in clean chroot (Arch Linux build)
Describe the bug
While running the tests in a clean chroot, I’m getting the following error:
running 8 tests
test config::tests::test_get_config_last_long_value ... ok
test config::tests::test_get_config_long_value ... ok
test app::tests::test_centered_rect ... ok
test config::tests::test_get_config_long_value_followed_by_default_value ... ok
test config::tests::test_colors ... ok
test completion::tests::test_completion ... ok
test table::tests::table_invalid_percentages - should panic ... ok
Importing 'STDIN'
add 0b11967d-9dae-4333-a137-c3b1e8a641d3 Move between tasks using 'j' and 'k'
add f5a18641-dc38-4ae1-80f0-588166a2aa44 Edit task in editor using 'e'
add b3f9e124-64c2-4dc0-8351-9b2200e2863e Filter tasks using '/'
add 62c386dc-4403-4756-a56a-becad2538e77 Undo last action using u
add 22bba0bf-7fac-4382-9d3f-bce17e981378 Start and Stop task using 's'
add b16a359d-427f-4e0f-92eb-8cc07736b6a4 Annotate tasks using 'A'
add 7bb0e242-4610-475d-98a6-9b75d97be6a7 Log tasks using 'l'
add 6c4c9ee8-d6c4-4d64-a84d-bf9cb710684e Run custom shell command using '!'
add 48fe34a2-9991-4ffd-ae0d-ac37d94ac197 Toggle between task and calendar view using '[' and ']'
add f8470e92-0286-4b85-91f4-acf6bf693f6c Support color for tasks based on your .taskrc
add 3f43831b-88dc-45e2-bf0d-4aea6db634cc Add task with 'a'
add 3c88c2b0-19c8-46d3-aaa3-0f915368ac25 Modify task with 'm'
add c490691d-67e1-4bea-92d7-6b9237c54560 тесd
add 1861bcb6-a199-4bf4-b8b9-d4011749906c ähe
add 60391ac0-1c29-4ad8-b5c4-b3660422060a Adding task 😂
add ca22ab2b-8182-4735-b7d7-d47e6fba3e81 ähellasd
add cf7b68e4-1c7b-47ae-9706-65e66b605053 whatever
add 4748c6a4-8f98-4bb7-8650-a92c971e17e0 Maßnahmen
add f3151f54-5628-49be-b977-0f9beb6dd1f4 tui
add d63bb624-27f6-4ba5-bb3e-9eed3fb6f389 new task
add 30fdbcb9-37b9-44ce-8132-35d912bdd087 00000000000000000000000000000000000000000000000000
add 1e3b4865-d02f-4d41-8f3f-69b53b88c456 asddsfsdfsdfdsfdsfdsfdsfsdfsdfsdfafasfasfdsfsdfsdfsd
add acd790f8-47bd-4bdd-ab34-4614f054c864 das
add f97c4200-8288-48fd-8e61-b972127a96ed creating a task
add 88ff806a-f7f5-4107-90b4-8bc4a2c81657 Mark task as done using 'd'
add be9c4324-bf96-4f15-904a-4bb8098500fe See help using '?'
add 456fc642-433b-4bfc-b437-7a3f6449a5ec Delete task using 'x'
add 02f5517d-3cfd-4669-bb23-82cbaaf8d08e https://github.com/kdheepak/taskw
add 80bd2a88-22a7-4e11-8ec9-b63af7f1db7d klsdajfadslkfjdaslfkajsdflkjdsaflksdajflksdajfsadlkfjasldfkjasdlkfjlasdfjasldkfjasldkfjlakjdflkajsdflaksdjflaskdjflasdkjfdsklajfalskdjfds
add a177437b-7ad6-4569-b7eb-f89e9d7fa905 gdsds
add f3a91c08-78ae-4aae-91ba-5c6b17745493 gasfsd
add a0609c14-6f4c-4856-9933-adf0e82a0b6b gsdfsd
add 9e22c54f-1ee5-46c9-a1f7-a9752c898f82 fsdafsda
TASKRC override: /build/taskwarrior-tui/src/taskwarrior-tui-0.13.34/../taskwarrior-testdata/.taskrc
TASKDATA override: /build/taskwarrior-tui/src/taskwarrior-tui-0.13.34/../taskwarrior-testdata/.task
Imported 33 tasks.
test app::tests::test_taskwarrior_tui ... FAILED
failures:
---- app::tests::test_taskwarrior_tui stdout ----
thread 'app::tests::test_taskwarrior_tui' panicked at 'assertion failed: `(left == right)`
left: `"\"Buy groceries\" +test"`,
right: `"\"Buy groceries"`', src/app.rs:3232:9
failures:
app::tests::test_taskwarrior_tui
test result: FAILED. 7 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 2.25s
To Reproduce
- Reproducible using the test data located here: https://github.com/kdheepak/taskwarrior-testdata/
Steps to reproduce the behavior:
1. Prepare the PKGBUILD for building taskwarrior-tui-0.13.34-1.
Either fetch it from the Arch repositories and bump it to 0.13.34:
wget https://raw.githubusercontent.com/archlinux/svntogit-community/packages/taskwarrior-tui/trunk/PKGBUILD
sed "s/^pkgver=.*\$/pkgver=0.13.34/" -i PKGBUILD
updpkgsums
Or use the following PKGBUILD (slightly modified for offline builds):
PKGBUILD
# Maintainer: Orhun Parmaksız <orhun@archlinux.org>
pkgname=taskwarrior-tui
pkgver=0.13.34
pkgrel=1
pkgdesc="A terminal user interface for taskwarrior"
arch=('x86_64')
url="https://github.com/kdheepak/taskwarrior-tui"
license=('MIT')
depends=('task')
makedepends=('rust' 'git' 'pandoc')
source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz"
"git+https://github.com/kdheepak/taskwarrior-testdata")
sha256sums=('6d5c5a67420204f603e61054382fb39432098fd2daa758029b5ac848a9356024'
'SKIP')
prepare() {
cd "$pkgname-$pkgver"
cargo fetch --locked
}
build() {
cd "$pkgname-$pkgver"
cargo build --release --frozen --all-features
pandoc "docs/$pkgname.1.md" --standalone --to=man -o "docs/$pkgname.1"
}
check() {
cd "$pkgname-$pkgver"
export TASKRC="../taskwarrior-testdata/.taskrc"
export TASKDATA="../taskwarrior-testdata/.task"
cargo test --release --frozen --all-features
}
package() {
cd "$pkgname-$pkgver"
install -Dm 755 "target/release/$pkgname" -t "$pkgdir/usr/bin"
install -Dm 644 README.md -t "$pkgdir/usr/share/doc/$pkgname"
install -Dm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname"
install -Dm 644 "docs/$pkgname.1" -t "$pkgdir/usr/share/man/man1"
install -Dm 644 "completions/$pkgname.bash" "${pkgdir}/usr/share/bash-completion/completions/$pkgname"
install -Dm 644 "completions/$pkgname.fish" -t "${pkgdir}/usr/share/fish/vendor_completions.d"
install -Dm 644 "completions/_$pkgname" -t "${pkgdir}/usr/share/zsh/site-functions"
}
# vim: ts=2 sw=2 et:
2. Build the package by running extra-x86_64-build.
3. See error.
Environment (please complete the following information):
- Operating System: Arch Linux (clean chroot)
- taskwarrior-tui version:
0.13.34
Additional context and information
If I remove the --release flag while running tests (cargo test), I get a different error:
running 8 tests
test completion::tests::test_completion ... ok
test config::tests::test_get_config_long_value ... ok
test config::tests::test_get_config_last_long_value ... ok
test config::tests::test_get_config_long_value_followed_by_default_value ... ok
test table::tests::table_invalid_percentages - should panic ... ok
test config::tests::test_colors ... ok
test app::tests::test_centered_rect ... ok
Importing 'STDIN'
add 0b11967d-9dae-4333-a137-c3b1e8a641d3 Move between tasks using 'j' and 'k'
add f5a18641-dc38-4ae1-80f0-588166a2aa44 Edit task in editor using 'e'
add b3f9e124-64c2-4dc0-8351-9b2200e2863e Filter tasks using '/'
add 62c386dc-4403-4756-a56a-becad2538e77 Undo last action using u
add 22bba0bf-7fac-4382-9d3f-bce17e981378 Start and Stop task using 's'
add b16a359d-427f-4e0f-92eb-8cc07736b6a4 Annotate tasks using 'A'
add 7bb0e242-4610-475d-98a6-9b75d97be6a7 Log tasks using 'l'
add 6c4c9ee8-d6c4-4d64-a84d-bf9cb710684e Run custom shell command using '!'
add 48fe34a2-9991-4ffd-ae0d-ac37d94ac197 Toggle between task and calendar view using '[' and ']'
add f8470e92-0286-4b85-91f4-acf6bf693f6c Support color for tasks based on your .taskrc
add 3f43831b-88dc-45e2-bf0d-4aea6db634cc Add task with 'a'
add 3c88c2b0-19c8-46d3-aaa3-0f915368ac25 Modify task with 'm'
add c490691d-67e1-4bea-92d7-6b9237c54560 тесd
add 1861bcb6-a199-4bf4-b8b9-d4011749906c ähe
add 60391ac0-1c29-4ad8-b5c4-b3660422060a Adding task 😂
add ca22ab2b-8182-4735-b7d7-d47e6fba3e81 ähellasd
add cf7b68e4-1c7b-47ae-9706-65e66b605053 whatever
add 4748c6a4-8f98-4bb7-8650-a92c971e17e0 Maßnahmen
add f3151f54-5628-49be-b977-0f9beb6dd1f4 tui
add d63bb624-27f6-4ba5-bb3e-9eed3fb6f389 new task
add 30fdbcb9-37b9-44ce-8132-35d912bdd087 00000000000000000000000000000000000000000000000000
add 1e3b4865-d02f-4d41-8f3f-69b53b88c456 asddsfsdfsdfdsfdsfdsfdsfsdfsdfsdfafasfasfdsfsdfsdfsd
add acd790f8-47bd-4bdd-ab34-4614f054c864 das
add f97c4200-8288-48fd-8e61-b972127a96ed creating a task
add 88ff806a-f7f5-4107-90b4-8bc4a2c81657 Mark task as done using 'd'
add be9c4324-bf96-4f15-904a-4bb8098500fe See help using '?'
add 456fc642-433b-4bfc-b437-7a3f6449a5ec Delete task using 'x'
add 02f5517d-3cfd-4669-bb23-82cbaaf8d08e https://github.com/kdheepak/taskw
add 80bd2a88-22a7-4e11-8ec9-b63af7f1db7d klsdajfadslkfjdaslfkajsdflkjdsaflksdajflksdajfsadlkfjasldfkjasdlkfjlasdfjasldkfjasldkfjlakjdflkajsdflaksdjflaskdjflasdkjfdsklajfalskdjfds
add a177437b-7ad6-4569-b7eb-f89e9d7fa905 gdsds
add f3a91c08-78ae-4aae-91ba-5c6b17745493 gasfsd
add a0609c14-6f4c-4856-9933-adf0e82a0b6b gsdfsd
add 9e22c54f-1ee5-46c9-a1f7-a9752c898f82 fsdafsda
TASKRC override: /build/taskwarrior-tui/src/taskwarrior-tui-0.13.34/../taskwarrior-testdata/.taskrc
TASKDATA override: /build/taskwarrior-tui/src/taskwarrior-tui-0.13.34/../taskwarrior-testdata/.task
Imported 33 tasks.
test app::tests::test_taskwarrior_tui ... FAILED
failures:
---- app::tests::test_taskwarrior_tui stdout ----
thread 'app::tests::test_taskwarrior_tui' panicked at 'attempt to subtract with overflow', src/app.rs:1221:56
failures:
app::tests::test_taskwarrior_tui
test result: FAILED. 7 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.87s
It is probably about overflow-checks being false for the release profile and it might be pointing out to another issue.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 24 (24 by maintainers)
I got tests passing again for me locally, but it requires the following changes: https://github.com/kdheepak/task-hookrs/pull/1 https://github.com/kdheepak/taskwarrior-testdata/pull/3
Thanks again for reporting!
In any case, this is resolved now and I made a new release with this fix: https://github.com/kdheepak/taskwarrior-tui/releases/tag/v0.14.6
I figured out what was going on. The
tuistored command history on my computer and was using that for tests. When I removed the command history file, I was able to reproduce the error. That helped me improve the history handling too.I’m very surprised that the tests never failed on the CI though. I’m not sure what is going on there but that doesn’t make me feel confident.
Thanks for the PR! Sorry about that, I wasn’t able to run tests locally and couldn’t verify that things were working. I did check it now and it works. I’ve made a new release.