diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 8c0218c0..a12b79e7 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -40,12 +40,10 @@ jobs: uses: actions/checkout@v3 - name: Setup Rust toolchain - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: - toolchain: stable - override: true components: llvm-tools-preview - target: ${{ matrix.target }} + targets: ${{ matrix.target }} - uses: actions/cache@v3 with: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index b04b2b11..c59e74fe 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -56,12 +56,10 @@ jobs: uses: actions/checkout@v3 - name: Setup Rust toolchain - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: - toolchain: stable - override: true - components: rustfmt, clippy - target: ${{ matrix.target }} + components: llvm-tools-preview + targets: ${{ matrix.target }} - uses: actions/cache@v3 with: @@ -77,13 +75,7 @@ jobs: ${{ runner.os }}-cargo-${{ matrix.target }}- - name: cargo fmt - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check + run : cargo fmt --all -- --check - name: cargo clippy - uses: actions-rs/cargo@v1 - with: - command: clippy - args: --tests --workspace -- -D warnings + run: cargo clippy --tests --workspace -- -D warnings diff --git a/.github/workflows/package-binary.yml b/.github/workflows/package-binary.yml index a6e9bae9..d75373b3 100644 --- a/.github/workflows/package-binary.yml +++ b/.github/workflows/package-binary.yml @@ -83,18 +83,17 @@ jobs: uses: actions/checkout@v3 - name: Setup Rust toolchain - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: - toolchain: stable - target: ${{ matrix.target }} - override: true + components: llvm-tools-preview + targets: ${{ matrix.target }} - name: cargo build - uses: actions-rs/cargo@v1 + uses: houseabsolute/actions-rust-cross@v0 with: command: build - args: --release --locked --target=${{ matrix.target }} - use-cross: ${{ matrix.cross }} + args: --release --locked + target: ${{ matrix.target }} - name: Compress client uses: svenstaro/upx-action@v2 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 260c6fce..cb01df5b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -39,49 +39,46 @@ jobs: - os: ubuntu-latest target: x86_64-unknown-linux-gnu cross: false - strip: true - os: ubuntu-latest target: aarch64-unknown-linux-musl cross: true - strip: false - os: ubuntu-latest target: armv7-unknown-linux-musleabihf cross: true - strip: false - os: ubuntu-latest target: arm-unknown-linux-musleabihf cross: true - strip: false - os: windows-latest target: x86_64-pc-windows-msvc cross: false - strip: true - os: macos-latest target: x86_64-apple-darwin cross: false - strip: true - os: macos-latest target: aarch64-apple-darwin cross: true - strip: true steps: - name: Checkout code uses: actions/checkout@v3 - name: Setup Rust toolchain - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: - toolchain: stable - override: true components: llvm-tools-preview - target: ${{ matrix.target }} + targets: ${{ matrix.target }} - name: Install cargo-nextest uses: taiki-e/install-action@v2 with: tool: nextest + - name: Install cargo-cross + uses: taiki-e/install-action@v2 + with: + tool: cross + if: ${{ matrix.cross }} + - uses: actions/cache@v3 with: path: | @@ -94,24 +91,37 @@ jobs: restore-keys: | ${{ runner.os }}-cargo-${{ matrix.target }}- + # ----- Non-Cross path - name: cargo build - uses: actions-rs/cargo@v1 - with: - command: build - args: --target=${{ matrix.target }} - use-cross: ${{ matrix.cross }} + run: cargo build --target=${{ matrix.target }} + if: ${{ !matrix.cross }} - name: cargo test - uses: actions-rs/cargo@v1 - if: ${{ !matrix.cross }} + run: cargo nextest run --workspace --target=${{ matrix.target }} env: NEXTEST_PROFILE: ci # defined in .config/nextest.toml - with: - command: nextest - args: run --workspace --target=${{ matrix.target }} - use-cross: ${{ matrix.cross }} + if: ${{ !matrix.cross }} + + # ----- Cross path + #- name: Install qemu + # run: apt-get install --assume-yes binfmt-support qemu-user-static qemu-user + # if: ${{ matrix.cross }} + + - name: cargo build + run: cross build --target=${{ matrix.target }} + if: ${{ matrix.cross }} + + # We don't do automated testing for cross builds yet. + # - They don't work in the CI. I have yet to figure out why things aren't set up properly. + # - The tests run way to slow and all kinds of race conditions are triggered. + # Until we find a way to run time related tests in an ultra slow environment, this needs to be postponed. + #- name: cargo test + # run: cross test run --workspace --target=${{ matrix.target }} + # env: + # NEXTEST_PROFILE: ci # defined in .config/nextest.toml + # if: ${{ matrix.cross }} - # The test result artifacts are used by the test-report.yaml workflow. + # ----- Test result artifacts are used by the test-report.yaml workflow. - name: upload test results uses: actions/upload-artifact@v3 if: ${{ !matrix.cross }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 47332bdc..4b676f79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ### Fixed +- Include priority in `Task`s' `Debug` output + ## [3.3.3] - 2024-01-04 ### Fixed diff --git a/Cargo.lock b/Cargo.lock index d767e7d2..13da7cb8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -43,9 +43,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.5" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d664a92ecae85fd0a7392615844904654d1d5f5514837f471ddef4a057aba1b6" +checksum = "6e2e1ebcb11de5c03c67de28a7df593d32191b44939c482e97702baaaa6ab6a5" dependencies = [ "anstyle", "anstyle-parse", @@ -91,18 +91,18 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.76" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59d2a3357dde987206219e78ecfbbb6e8dad06cbb65292758d3270e6254f7355" +checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" [[package]] name = "assert_cmd" -version = "2.0.12" +version = "2.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88903cb14723e4d4003335bb7f8a14f27691649105346a0f0957466c096adfe6" +checksum = "00ad3f3a942eee60335ab4342358c161ee296829e0d16ff42fc1d6cb07815467" dependencies = [ "anstyle", - "bstr 1.8.0", + "bstr 1.9.0", "doc-comment", "predicates", "predicates-core", @@ -112,9 +112,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.75" +version = "0.1.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdf6721fb0140e4f897002dd086c06f6c27775df19cfe1fccb21181a48fd2c98" +checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ "proc-macro2", "quote", @@ -144,9 +144,9 @@ dependencies = [ [[package]] name = "base64" -version = "0.21.5" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "better-panic" @@ -164,7 +164,7 @@ version = "0.68.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "726e4313eb6ec35d2730258ad4e15b547ee75d6afaa1361a922e78e59b7d8078" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "cexpr", "clang-sys", "lazy_static", @@ -186,9 +186,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.1" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" [[package]] name = "block-buffer" @@ -212,12 +212,12 @@ dependencies = [ [[package]] name = "bstr" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "542f33a8835a0884b006a0c3df3dadd99c0c3f296ed26c2fdc8028e01ad6230c" +checksum = "c48f0051a4b4c5e0b6d365cd04af53aeaa209e3cc15ec2cdb69e73cc87fbd0dc" dependencies = [ "memchr", - "regex-automata 0.4.3", + "regex-automata 0.4.4", "serde", ] @@ -265,9 +265,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.31" +version = "0.4.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" +checksum = "41daef31d7a747c5c847246f36de49ced6f7403b4cdabc807a97b5cc184cda7a" dependencies = [ "android-tzdata", "iana-time-zone", @@ -275,7 +275,7 @@ dependencies = [ "num-traits", "serde", "wasm-bindgen", - "windows-targets 0.48.5", + "windows-targets 0.52.0", ] [[package]] @@ -290,9 +290,9 @@ dependencies = [ [[package]] name = "clang-sys" -version = "1.6.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f" +checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" dependencies = [ "glob", "libc", @@ -301,9 +301,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.11" +version = "4.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfaff671f6b22ca62406885ece523383b9b64022e341e53e009a62ebc47a45f2" +checksum = "1e578d6ec4194633722ccf9544794b71b1385c3c027efe0c55db226fc880865c" dependencies = [ "clap_builder", "clap_derive", @@ -311,9 +311,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.11" +version = "4.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a216b506622bb1d316cd51328dce24e07bdff4a6128a47c7e7fad11878d5adbb" +checksum = "4df4df40ec50c46000231c914968278b1eb05098cf8f1b3a518a95030e71d1c7" dependencies = [ "anstream", "anstyle", @@ -323,9 +323,9 @@ dependencies = [ [[package]] name = "clap_complete" -version = "4.4.4" +version = "4.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bffe91f06a11b4b9420f62103854e90867812cd5d01557f853c5ee8e791b12ae" +checksum = "df631ae429f6613fcd3a7c1adbdb65f637271e561b03680adaa6573015dfb106" dependencies = [ "clap", ] @@ -378,14 +378,14 @@ dependencies = [ [[package]] name = "console" -version = "0.15.7" +version = "0.15.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c926e00cc70edefdc64d3a5ff31cc65bb97a3460097762bd23afb4d8145fccf8" +checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" dependencies = [ "encode_unicode", "lazy_static", "libc", - "windows-sys 0.45.0", + "windows-sys 0.52.0", ] [[package]] @@ -396,9 +396,9 @@ checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "cpufeatures" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] @@ -409,7 +409,7 @@ version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f476fe445d41c9e991fd07515a6f463074b782242ccf4a5b7b1d1012e70824df" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "crossterm_winapi", "libc", "parking_lot", @@ -447,9 +447,9 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eb30d70a07a3b04884d2677f06bec33509dc67ca60d92949e5535352d3191dc" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" dependencies = [ "powerfmt", ] @@ -503,12 +503,6 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" -[[package]] -name = "either" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" - [[package]] name = "encode_unicode" version = "0.3.6" @@ -517,9 +511,9 @@ checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" [[package]] name = "env_logger" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95b3f3e67048839cb0d0781f445682a35113da7121f7c949db0e2be96a4fbece" +checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" dependencies = [ "humantime", "is-terminal", @@ -657,9 +651,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ "cfg-if", "libc", @@ -712,9 +706,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" +checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" [[package]] name = "hex" @@ -730,9 +724,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "iana-time-zone" -version = "0.1.58" +version = "0.1.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20" +checksum = "b6a67363e2aa4443928ce15e57ebae94fd8949958fd1223c4cfc0cd473ad7539" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -763,22 +757,13 @@ dependencies = [ [[package]] name = "is-terminal" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" +checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455" dependencies = [ "hermit-abi", "rustix", - "windows-sys 0.48.0", -] - -[[package]] -name = "itertools" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" -dependencies = [ - "either", + "windows-sys 0.52.0", ] [[package]] @@ -789,9 +774,9 @@ checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "js-sys" -version = "0.3.66" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" +checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" dependencies = [ "wasm-bindgen", ] @@ -810,18 +795,18 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.151" +version = "0.2.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" +checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" [[package]] name = "libloading" -version = "0.7.4" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161" dependencies = [ "cfg-if", - "winapi", + "windows-sys 0.48.0", ] [[package]] @@ -841,16 +826,16 @@ version = "0.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "libc", "redox_syscall", ] [[package]] name = "linux-raw-sys" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "lock_api" @@ -870,9 +855,9 @@ checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "memchr" -version = "2.6.4" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "minimal-lexical" @@ -917,7 +902,7 @@ version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "cfg-if", "libc", ] @@ -1022,9 +1007,9 @@ dependencies = [ [[package]] name = "pest" -version = "2.7.5" +version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae9cee2a55a544be8b89dc6848072af97a20f2422603c10865be2a42b580fff5" +checksum = "1f200d8d83c44a45b21764d1916299752ca035d15ecd46faca3e9a2a2bf6ad06" dependencies = [ "memchr", "thiserror", @@ -1033,9 +1018,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.5" +version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81d78524685f5ef2a3b3bd1cafbc9fcabb036253d9b1463e726a91cd16e2dfc2" +checksum = "bcd6ab1236bbdb3a49027e920e693192ebfe8913f6d60e294de57463a493cfde" dependencies = [ "pest", "pest_generator", @@ -1043,9 +1028,9 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.5" +version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68bd1206e71118b5356dae5ddc61c8b11e28b09ef6a31acbd15ea48a28e0c227" +checksum = "2a31940305ffc96863a735bef7c7994a00b325a7138fdbc5bda0f1a0476d3275" dependencies = [ "pest", "pest_meta", @@ -1056,9 +1041,9 @@ dependencies = [ [[package]] name = "pest_meta" -version = "2.7.5" +version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c747191d4ad9e4a4ab9c8798f1e82a39affe7ef9648390b7e5548d18e099de6" +checksum = "a7ff62f5259e53b78d1af898941cdcdccfae7385cf7d793a6e55de5d05bb4b7d" dependencies = [ "once_cell", "pest", @@ -1100,13 +1085,12 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "predicates" -version = "3.0.4" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dfc28575c2e3f19cb3c73b93af36460ae898d426eba6fc15b9bd2a5220758a0" +checksum = "68b87bfd4605926cdfefc1c3b5f8fe560e3feca9d5552cf68c466d3d8236c7e8" dependencies = [ "anstyle", "difflib", - "itertools", "predicates-core", ] @@ -1138,9 +1122,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.71" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75cb1540fadbd5b8fbccc4dddad2734eba435053f725621c070711a14bb5f4b8" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ "unicode-ident", ] @@ -1151,7 +1135,7 @@ version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "731e0d9356b0c25f16f33b5be79b1c57b562f141ebfcdb0ad8ac2c13a24293b4" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "hex", "lazy_static", "procfs-core", @@ -1164,7 +1148,7 @@ version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d3554923a69f4ce04c4a754260c338f505ce22642d3830e049a399fc2059a29" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "hex", ] @@ -1249,9 +1233,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.33" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -1320,13 +1304,13 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.2" +version = "1.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.3", + "regex-automata 0.4.4", "regex-syntax", ] @@ -1338,9 +1322,9 @@ checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" [[package]] name = "regex-automata" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +checksum = "3b7fa1134405e2ec9353fd416b17f8dacd46c473d7d3fd1cf202706a14eb792a" dependencies = [ "aho-corasick", "memchr", @@ -1355,9 +1339,9 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "relative-path" -version = "1.9.0" +version = "1.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c707298afce11da2efef2f600116fa93ffa7a032b5d7b628aa17711ec81383ca" +checksum = "e898588f33fdd5b9420719948f9f2a32c922a246964576f71ba7f24f80610fbc" [[package]] name = "rev_buf_reader" @@ -1434,11 +1418,11 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.28" +version = "0.38.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316" +checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "errno", "libc", "linux-raw-sys", @@ -1447,9 +1431,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.22.1" +version = "0.22.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe6b63262c9fcac8659abfaa96cac103d28166d3ff3eaf8f412e19f3ae9e5a48" +checksum = "e87c9956bd9807afa1f77e0f7594af32566e830e088a5576d27c5b6f30f49d41" dependencies = [ "log", "ring", @@ -1477,9 +1461,9 @@ checksum = "9e9d979b3ce68192e42760c7810125eb6cf2ea10efae545a156063e61f314e2a" [[package]] name = "rustls-webpki" -version = "0.102.0" +version = "0.102.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de2635c8bc2b88d367767c5de8ea1d8db9af3f6219eba28442242d9ab81d1b89" +checksum = "ef4ca26037c909dedb327b48c3327d0ba91d3dd3c4e05dad328f210ffb68e95b" dependencies = [ "ring", "rustls-pki-types", @@ -1512,15 +1496,15 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "semver" -version = "1.0.20" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" +checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" [[package]] name = "serde" -version = "1.0.193" +version = "1.0.195" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" +checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" dependencies = [ "serde_derive", ] @@ -1537,9 +1521,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.193" +version = "1.0.195" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" +checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" dependencies = [ "proc-macro2", "quote", @@ -1548,9 +1532,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.108" +version = "1.0.111" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" +checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" dependencies = [ "itoa", "ryu", @@ -1559,9 +1543,9 @@ dependencies = [ [[package]] name = "serde_yaml" -version = "0.9.29" +version = "0.9.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a15e0ef66bf939a7c890a0bf6d5a733c70202225f9888a89ed5c62298b019129" +checksum = "b1bf28c79a99f70ee1f1d83d10c875d2e70618417fda01ad1785e027579d9d38" dependencies = [ "indexmap", "itoa", @@ -1598,15 +1582,15 @@ dependencies = [ [[package]] name = "shlex" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7cee0529a6d40f580e7a5e6c495c8fbfe21b7b52795ed4bb5e62cdf92bc6380" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "similar" -version = "2.3.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2aeaf503862c419d66959f5d7ca015337d864e9c49485d771b732e2a20453597" +checksum = "32fea41aca09ee824cc9724996433064c89f7777e60762749a4170a14abbfa21" dependencies = [ "bstr 0.2.17", "unicode-segmentation", @@ -1644,9 +1628,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.2" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" +checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" [[package]] name = "snap" @@ -1703,9 +1687,9 @@ checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "syn" -version = "2.0.43" +version = "2.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee659fb5f3d355364e1f3e5bc10fb82068efbf824a1e9d1c9504244a6469ad53" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" dependencies = [ "proc-macro2", "quote", @@ -1714,15 +1698,15 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.8.1" +version = "3.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" +checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" dependencies = [ "cfg-if", "fastrand", "redox_syscall", "rustix", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -1763,18 +1747,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.52" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83a48fd946b02c0a526b2e9481c8e2a17755e47039164a86c4070446e3a4614d" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.52" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7fbe9b594d6568a6a1443250a7e67d80b74e1e96f6d1715e1e21cc1888291d3" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" dependencies = [ "proc-macro2", "quote", @@ -1922,9 +1906,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" +checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -1932,9 +1916,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" +checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" dependencies = [ "bumpalo", "log", @@ -1947,9 +1931,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" +checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1957,9 +1941,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" +checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" dependencies = [ "proc-macro2", "quote", @@ -1970,15 +1954,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" +checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" [[package]] name = "web-sys" -version = "0.3.66" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50c24a44ec86bb68fbecd1b3efed7e85ea5621b39b35ef2766b66cd984f8010f" +checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" dependencies = [ "js-sys", "wasm-bindgen", @@ -2027,20 +2011,11 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-core" -version = "0.51.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.45.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.42.2", + "windows-targets 0.52.0", ] [[package]] @@ -2061,21 +2036,6 @@ dependencies = [ "windows-targets 0.52.0", ] -[[package]] -name = "windows-targets" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - [[package]] name = "windows-targets" version = "0.48.5" @@ -2106,12 +2066,6 @@ dependencies = [ "windows_x86_64_msvc 0.52.0", ] -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" - [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -2124,12 +2078,6 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" - [[package]] name = "windows_aarch64_msvc" version = "0.48.5" @@ -2142,12 +2090,6 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" -[[package]] -name = "windows_i686_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" - [[package]] name = "windows_i686_gnu" version = "0.48.5" @@ -2160,12 +2102,6 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" -[[package]] -name = "windows_i686_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" - [[package]] name = "windows_i686_msvc" version = "0.48.5" @@ -2178,12 +2114,6 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" - [[package]] name = "windows_x86_64_gnu" version = "0.48.5" @@ -2196,12 +2126,6 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" - [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" @@ -2214,12 +2138,6 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" -[[package]] -name = "windows_x86_64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" - [[package]] name = "windows_x86_64_msvc" version = "0.48.5" diff --git a/Cross.toml b/Cross.toml new file mode 100644 index 00000000..df5e4a67 --- /dev/null +++ b/Cross.toml @@ -0,0 +1,36 @@ +[target.x86_64-unknown-linux-musl] +image = "ghcr.io/cross-rs/x86_64-unknown-linux-musl:main" +pre-build = [ + """ + dpkg --add-architecture amd64 && \ + apt-get update && \ + apt-get install --assume-yes lld clang + """ +] + +[target.aarch64-unknown-linux-musl] +image = "ghcr.io/cross-rs/aarch64-unknown-linux-musl:main" +pre-build = [ + """ + apt-get update && \ + apt-get install --assume-yes lld clang + """ +] + +[target.armv7-unknown-linux-musleabihf] +image = "ghcr.io/cross-rs/armv7-unknown-linux-musleabihf:main" +pre-build = [ + """ + apt-get update && \ + apt-get install --assume-yes lld clang + """ +] + +[target.arm-unknown-linux-musleabihf] +image = "ghcr.io/cross-rs/arm-unknown-linux-musleabihf:main" +pre-build = [ + """ + apt-get update && \ + apt-get install --assume-yes lld clang + """ +] diff --git a/README.md b/README.md index 10b0db68..937a069a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Pueue -[![GitHub Actions Workflow](https://github.com/nukesor/pueue/workflows/Test%20build/badge.svg)](https://github.com/Nukesor/pueue/actions) +[![Test Build](https://github.com/Nukesor/pueue/actions/workflows/test.yml/badge.svg)](https://github.com/Nukesor/pueue/actions/workflows/test.yml) [![Crates.io](https://img.shields.io/crates/v/pueue)](https://crates.io/crates/pueue) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Downloads](https://img.shields.io/github/downloads/nukesor/pueue/total.svg)](https://github.com/nukesor/pueue/releases) diff --git a/ARCHITECTURE.md b/docs/Architecture.md similarity index 100% rename from ARCHITECTURE.md rename to docs/Architecture.md diff --git a/docs/Cross.md b/docs/Cross.md new file mode 100644 index 00000000..231476e0 --- /dev/null +++ b/docs/Cross.md @@ -0,0 +1,13 @@ +# Cross compilation + +Compilation and testing for other architectures is rather easy with `cross`. + +1. Install `cargo-cross`. +1. Make sure to install `qemu`. + - On Arch-Linux install `qemu-user-static-binfmt`. + - On Ubuntu install `binfmt-support` and `qemu-user-static`. + +Run the build/test against the target infrastructure, I.e.: + +- `cross build --target=aarch64-unknown-linux-musl` +- `cross test --target=aarch64-unknown-linux-musl` diff --git a/pueue/tests/client/integration/follow.rs b/pueue/tests/client/integration/follow.rs index 64f3fc44..aef1cda9 100644 --- a/pueue/tests/client/integration/follow.rs +++ b/pueue/tests/client/integration/follow.rs @@ -2,7 +2,6 @@ use anyhow::{Context, Result}; use rstest::rstest; use crate::client::helper::*; -use pueue_lib::network::message::ResetMessage; pub fn set_read_local_logs(daemon: &mut PueueDaemon, read_local_logs: bool) -> Result<()> { // Force the client to read remote logs via config file. @@ -102,44 +101,48 @@ async fn fail_on_non_existing(#[case] read_local_logs: bool) -> Result<()> { Ok(()) } -/// This test is ignored on apple, since it's super flaky. Somebody has to debug this. -#[cfg(not(target = "x86_64-apple-darwin"))] -mod non_apple { - use super::*; - - /// Fail and print an error message when following a non-existing task disappears - #[rstest] - #[case(true)] - #[case(false)] - #[tokio::test(flavor = "multi_thread", worker_threads = 2)] - async fn fail_on_disappearing(#[case] read_local_logs: bool) -> Result<()> { - let mut daemon = daemon().await?; - set_read_local_logs(&mut daemon, read_local_logs)?; - let shared = &daemon.settings.shared; - - // Add a task echoes something and waits for a while - assert_success(add_task(shared, "echo test && sleep 20").await?); - wait_for_task_condition(shared, 0, |task| task.is_running()).await?; - - // Reset the daemon after 2 seconds. At this point, the client will already be following the - // output and should notice that the task went away.. - // This is a bit hacky, but our client test helper always waits for the command to finish - // and I'm feeling too lazy to add a new helper function now. - let moved_shared = shared.clone(); - tokio::task::spawn(async move { - sleep_ms(2000).await; - // Reset the daemon - send_message(&moved_shared, ResetMessage {}) - .await - .expect("Failed to send Start tasks message"); - }); - - // Execute `follow` and remove the task - // The client should exit with exit code `1`. - let output = run_client_command(shared, &["follow", "0"])?; - - assert_snapshot_matches_stdout("follow__fail_on_disappearing", output.stdout)?; - - Ok(()) - } -} +// /// This test is commented for the time being. +// /// There's a race condition that can happen from time to time. +// /// It's especially reliably hit on MacOS for some reason. +// /// +// /// What happens is that the daemon resets in between reading the output of the file +// /// and the check whether the task actually still exists in the daemon. +// /// There's really no way to properly work around this. +// /// So I'll keep this commented for the time being. +// /// +// /// +// /// Fail and print an error message when following a non-existing task disappears +// #[rstest] +// #[case(true)] +// #[case(false)] +// #[tokio::test(flavor = "multi_thread", worker_threads = 2)] +// async fn fail_on_disappearing(#[case] read_local_logs: bool) -> Result<()> { +// let mut daemon = daemon().await?; +// set_read_local_logs(&mut daemon, read_local_logs)?; +// let shared = &daemon.settings.shared; +// +// // Add a task echoes something and waits for a while +// assert_success(add_task(shared, "echo test && sleep 20").await?); +// wait_for_task_condition(shared, 0, |task| task.is_running()).await?; +// +// // Reset the daemon after 2 seconds. At this point, the client will already be following the +// // output and should notice that the task went away.. +// // This is a bit hacky, but our client test helper always waits for the command to finish +// // and I'm feeling too lazy to add a new helper function now. +// let moved_shared = shared.clone(); +// tokio::task::spawn(async move { +// sleep_ms(2000).await; +// // Reset the daemon +// send_message(&moved_shared, ResetMessage {}) +// .await +// .expect("Failed to send Start tasks message"); +// }); +// +// // Execute `follow` and remove the task +// // The client should exit with exit code `1`. +// let output = run_client_command(shared, &["follow", "0"])?; +// +// assert_snapshot_matches_stdout("follow__fail_on_disappearing", output.stdout)?; +// +// Ok(()) +// } diff --git a/pueue/tests/helper/daemon.rs b/pueue/tests/helper/daemon.rs index 3843a494..3d4e5e69 100644 --- a/pueue/tests/helper/daemon.rs +++ b/pueue/tests/helper/daemon.rs @@ -23,13 +23,14 @@ pub async fn shutdown_daemon(shared: &Shared) -> Result { /// long. pub async fn get_pid(pid_path: &Path) -> Result { // Give the daemon about 1 sec to boot and create the pid file. - let tries = 20; + let sleep = 50; + let tries = TIMEOUT / sleep; let mut current_try = 0; while current_try < tries { // The daemon didn't create the pid file yet. Wait for 100ms and try again. if !pid_path.exists() { - sleep_ms(50).await; + sleep_ms(sleep).await; current_try += 1; continue; } @@ -58,7 +59,8 @@ pub async fn get_pid(pid_path: &Path) -> Result { /// Waits for a daemon to shut down. pub async fn wait_for_shutdown(child: &mut Child) -> Result<()> { // Give the daemon about 1 sec to shutdown. - let tries = 40; + let sleep = 50; + let tries = TIMEOUT / sleep; let mut current_try = 0; while current_try < tries { @@ -66,7 +68,7 @@ pub async fn wait_for_shutdown(child: &mut Child) -> Result<()> { // an error is returned, the process is gone. if let Ok(None) = child.try_wait() { // Process is still alive, wait a little longer - sleep_ms(50).await; + sleep_ms(sleep).await; current_try += 1; continue; } diff --git a/pueue/tests/helper/fixtures.rs b/pueue/tests/helper/fixtures.rs index 7184d942..a257bdbe 100644 --- a/pueue/tests/helper/fixtures.rs +++ b/pueue/tests/helper/fixtures.rs @@ -45,13 +45,14 @@ pub async fn daemon_with_settings(settings: Settings, tempdir: TempDir) -> Resul tokio::spawn(run_and_handle_error(path, true)); let pid = get_pid(&settings.shared.pid_path()).await?; - let tries = 20; + let sleep = 50; + let tries = TIMEOUT / sleep; let mut current_try = 0; // Wait up to 1s for the unix socket to pop up. let socket_path = settings.shared.unix_socket_path(); while current_try < tries { - sleep_ms(50).await; + sleep_ms(sleep).await; if socket_path.exists() { create_test_groups(&settings.shared).await?; return Ok(PueueDaemon { @@ -100,13 +101,14 @@ pub async fn standalone_daemon(shared: &Shared) -> Result { .stderr(Stdio::piped()) .spawn()?; - let tries = 20; + let sleep = 50; + let tries = TIMEOUT / sleep; let mut current_try = 0; // Wait up to 1s for the unix socket to pop up. let socket_path = shared.unix_socket_path(); while current_try < tries { - sleep_ms(50).await; + sleep_ms(sleep).await; if socket_path.exists() { return Ok(child); } diff --git a/pueue/tests/helper/mod.rs b/pueue/tests/helper/mod.rs index a8847359..bc0a96ec 100644 --- a/pueue/tests/helper/mod.rs +++ b/pueue/tests/helper/mod.rs @@ -24,6 +24,9 @@ pub use state::*; pub use task::*; pub use wait::*; +// Global acceptable test timeout +const TIMEOUT: u64 = 5000; + /// A helper function to sleep for ms time. /// Only used to avoid the biolerplate of importing the same stuff all over the place. pub async fn sleep_ms(ms: u64) { diff --git a/pueue/tests/helper/wait.rs b/pueue/tests/helper/wait.rs index f2d4ca97..934118b0 100644 --- a/pueue/tests/helper/wait.rs +++ b/pueue/tests/helper/wait.rs @@ -10,6 +10,8 @@ use pueue_lib::settings::Shared; use pueue_lib::state::GroupStatus; use pueue_lib::task::Task; +use crate::helper::TIMEOUT; + use super::{get_state, sleep_ms}; /// This is a small helper function, which checks in very short intervals, whether a task fulfills @@ -22,7 +24,8 @@ pub async fn wait_for_task_condition( where F: Fn(&Task) -> bool, { - let tries = 20; + let sleep = 50; + let tries = TIMEOUT / sleep; let mut current_try = 0; while current_try <= tries { let state = get_state(shared).await?; @@ -36,7 +39,7 @@ where // The status didn't change to target. Try again. current_try += 1; - sleep_ms(50).await; + sleep_ms(sleep).await; continue; } None => { @@ -50,13 +53,14 @@ where /// This is a small helper function, which checks in very short intervals, whether a task has been /// deleted. This is necessary, as task deletion is asynchronous task. pub async fn wait_for_task_absence(shared: &Shared, task_id: usize) -> Result<()> { - let tries = 20; + let sleep = 50; + let tries = TIMEOUT / sleep; let mut current_try = 0; while current_try <= tries { let state = get_state(shared).await?; if state.tasks.contains_key(&task_id) { current_try += 1; - sleep_ms(50).await; + sleep_ms(sleep).await; continue; } @@ -69,13 +73,14 @@ pub async fn wait_for_task_absence(shared: &Shared, task_id: usize) -> Result<() /// This is a small helper function, which checks in very short intervals, whether a group has been /// initialized. This is necessary, as group creation became an asynchronous task. pub async fn wait_for_group(shared: &Shared, group: &str) -> Result<()> { - let tries = 20; + let sleep = 50; + let tries = TIMEOUT / sleep; let mut current_try = 0; while current_try <= tries { let state = get_state(shared).await?; if !state.groups.contains_key(group) { current_try += 1; - sleep_ms(50).await; + sleep_ms(sleep).await; continue; } @@ -88,13 +93,14 @@ pub async fn wait_for_group(shared: &Shared, group: &str) -> Result<()> { /// This is a small helper function, which checks in very short intervals, whether a group has been /// deleted. This is necessary, as group deletion became an asynchronous task. pub async fn wait_for_group_absence(shared: &Shared, group: &str) -> Result<()> { - let tries = 20; + let sleep = 50; + let tries = TIMEOUT / sleep; let mut current_try = 0; while current_try <= tries { let state = get_state(shared).await?; if state.groups.contains_key(group) { current_try += 1; - sleep_ms(50).await; + sleep_ms(sleep).await; continue; } @@ -111,7 +117,8 @@ pub async fn wait_for_group_status( expected_status: GroupStatus, ) -> Result<()> { // Give the daemon about 1 second to change group status. - let tries = 20; + let sleep = 50; + let tries = TIMEOUT / sleep; let mut current_try = 0; while current_try < tries { @@ -124,7 +131,7 @@ pub async fn wait_for_group_status( // The status didn't change to the expected status. Try again. current_try += 1; - sleep_ms(50).await; + sleep_ms(sleep).await; continue; } None => { diff --git a/pueue_lib/src/task.rs b/pueue_lib/src/task.rs index 5f165e69..33dcbeb1 100644 --- a/pueue_lib/src/task.rs +++ b/pueue_lib/src/task.rs @@ -191,6 +191,7 @@ impl std::fmt::Debug for Task { .field("prev_status", &self.prev_status) .field("start", &self.start) .field("end", &self.end) + .field("priority", &self.priority) .finish() } }