diff --git a/.Dockerfile b/.Dockerfile index 81e2ca2..119a730 100644 --- a/.Dockerfile +++ b/.Dockerfile @@ -29,6 +29,13 @@ RUN git clone https://github.com/bats-core/bats-support.git /opt/bats-support && git clone https://github.com/bats-core/bats-core.git /opt/bats && \ /opt/bats/install.sh /usr/local + +# Install zyedidia/eget, to install github release like nothing +RUN cd /usr/local/bin && curl https://zyedidia.github.io/eget.sh | sh + +# Install rhysd/vim-startuptime +RUN eget rhysd/vim-startuptime --to=/usr/local/bin + # Create a new user RUN useradd -ms /bin/bash -G sudo testuser RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers diff --git a/.tests/2_nvim.bats b/.tests/2_nvim.bats index 7b8f17a..3117b67 100644 --- a/.tests/2_nvim.bats +++ b/.tests/2_nvim.bats @@ -22,6 +22,11 @@ load '/opt/bats-file/load' assert_exists "$HOME/.local/share/nvim/lazy/telescope.nvim/lua/telescope/init.lua" } +@test "bootstrap TSInstall " { + run nvim --headless "+TSInstallSync all" +qall! + assert_success +} + # NOTE: Test is a bit flary because of that the retry @test "Install all LSPs with Mason" { # Define a list of LSPs to be installed @@ -79,3 +84,15 @@ load '/opt/bats-file/load' refute_line 'ERROR isort: the command "isort" is not executable.' refute_line 'ERROR markdownlint: the command "markdownlint" is not executable.' } + +@test "Average startuptime is below 12 msec" { + LOG_FILE="vim-startuptime.log" + run vim-startuptime -vimpath nvim > $LOG_FILE + total_avg=$(grep "Total Average:" "$LOG_FILE" | awk '{print $3}') + total_avg_rounded=$(printf "%.0f" $total_avg) + + limit=150 + + assert_success + assert [ "$total_avg_rounded" -lt "$limit" ] +}