diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 63e70f1..ef6a0fe 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,7 +36,17 @@ jobs: NEOVIM_BIN: "C:/tools/neovim/Neovim/bin/nvim.exe" RUST_BACKTRACE: full run: | - cargo test -- -- -Z unstable-options --format json | cargo2junit > results.xml + # Pay attention not to break BUILD stage of a test, + # when tests are failing at BUILD stage, everything after -- is ignored, + # and no json output will be generated. + # Becouse those arguments is passed to compiled test binary. And it is failed to compile. + cargo test -- -Z unstable-options --format json > results.json + # This and `set -eo pipefail` for MacOS/Linux + # is added, becouse without it pipe will eat exit status. + # Docs are stating that it should work by default, but it does not. + # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference + # Oh, it still does not fail on Windows. ¯\_(ツ)_/¯ + cat results.json | cargo2junit > results.xml - name: Publish Test Results uses: EnricoMi/publish-unit-test-result-action/composite@v1 @@ -98,7 +108,8 @@ jobs: env: RUST_BACKTRACE: full run: | - cargo test -- -- -Z unstable-options --format json | cargo2junit > results.xml + set -eo pipefail + cargo test -- -Z unstable-options --format json | cargo2junit > results.xml - name: Publish Test Results uses: EnricoMi/publish-unit-test-result-action/composite@v1 @@ -149,10 +160,6 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Update apt - run: | - sudo apt-get update - - name: Install Nightly Toolchain uses: actions-rs/toolchain@v1 with: @@ -167,23 +174,23 @@ jobs: - uses: Swatinem/rust-cache@v1 - - name: Install Dependencies - run: | - sudo apt-get install -y curl gnupg ca-certificates git gcc-multilib g++-multilib cmake libssl-dev pkg-config libfreetype6-dev libasound2-dev libexpat1-dev libxcb-composite0-dev libbz2-dev freeglut3-dev libxi-dev - - name: Check Formatting run: | cargo fmt --all -- --check - - name: Install Neovim + - name: Install dependencies and neovim run: | - sudo apt-get install -y neovim + sudo apt-get update + sudo apt-get -qq install -y \ + curl gnupg ca-certificates git gcc-multilib g++-multilib cmake libssl-dev pkg-config libfreetype6-dev libasound2-dev libexpat1-dev libxcb-composite0-dev libbz2-dev freeglut3-dev libxi-dev\ + neovim - name: Test env: RUST_BACKTRACE: full run: | - cargo test -- -- -Z unstable-options --format json | cargo2junit > results.xml + set -eo pipefail + cargo test -- -Z unstable-options --format json | cargo2junit > results.xml - name: Publish Test Results uses: EnricoMi/publish-unit-test-result-action@v1 diff --git a/src/bridge/mod.rs b/src/bridge/mod.rs index 180748c..89afd63 100644 --- a/src/bridge/mod.rs +++ b/src/bridge/mod.rs @@ -17,7 +17,7 @@ use crate::{ settings::*, }; -use command::create_nvim_command; +pub use command::create_nvim_command; pub use events::*; use handler::NeovimHandler; use setup::setup_neovide_specific_state; diff --git a/src/editor/window.rs b/src/editor/window.rs index 9fa9021..29a54a5 100644 --- a/src/editor/window.rs +++ b/src/editor/window.rs @@ -325,19 +325,13 @@ impl Window { #[cfg(test)] mod tests { use super::*; - use crate::channel_utils::*; use std::collections::HashMap; use std::sync::mpsc::*; fn build_test_channels() -> (Receiver>, Arc) { - let (batched_draw_command_sender, batched_draw_command_receiver) = channel(); - let logging_batched_draw_command_sender = LoggingSender::attach( - batched_draw_command_sender, - "batched_draw_command".to_owned(), - ); + let (_batched_draw_command_sender, batched_draw_command_receiver) = channel(); - let draw_command_batcher = - Arc::new(DrawCommandBatcher::new(logging_batched_draw_command_sender)); + let draw_command_batcher = Arc::new(DrawCommandBatcher::new()); (batched_draw_command_receiver, draw_command_batcher) } @@ -353,9 +347,7 @@ mod tests { (114, 64), batched_sender.clone(), ); - batched_sender - .send_batch() - .expect("Could not send batch of commands"); + batched_sender.send_batch(); batched_receiver.recv().expect("Could not receive commands"); window.draw_grid_line( @@ -371,9 +363,7 @@ mod tests { assert_eq!(window.grid.get_cell(70, 1), Some(&("|".to_owned(), None))); - batched_sender - .send_batch() - .expect("Could not send batch of commands"); + batched_sender.send_batch(); let sent_commands = batched_receiver.recv().expect("Could not receive commands"); assert!(sent_commands.len() != 0);