Skip to content

Commit

Permalink
test: remove demo and screencapture from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mikesmithgh committed Jan 8, 2025
1 parent ea11e3a commit 16d9f1b
Show file tree
Hide file tree
Showing 15 changed files with 17 additions and 555 deletions.
43 changes: 2 additions & 41 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,20 @@ TIMEOUT_MINS := $(shell echo $$((30 * 60 * 1000)))
.PHONY: test-sequential
.PHONY: test-all
.PHONY: test-all-sequential
.PHONY: test-demo
.PHONY: test-demo-main
.PHONY: test-demo-config
.PHONY: record-demo
.PHONY: record-demo-main

test:
@nvim \
--headless \
--noplugin \
-u ${TESTS_INIT} \
-c "lua require([[plenary.test_harness]]).test_directory([[tests ! -regex .*_demo.*_spec.*]], { minimal_init = '"${TESTS_INIT}"', timeout = "${TIMEOUT_MINS}", })"
-c "lua require([[plenary.test_harness]]).test_directory([[tests ! -regex .*_config.*_spec.*]], { minimal_init = '"${TESTS_INIT}"', timeout = "${TIMEOUT_MINS}", })"

test-sequential:
@nvim \
--headless \
--noplugin \
-u ${TESTS_INIT} \
-c "lua require([[plenary.test_harness]]).test_directory([[tests ! -regex .*_demo.*_spec.*]], { minimal_init = '"${TESTS_INIT}"', timeout = "${TIMEOUT_MINS}", sequential = true, })"
-c "lua require([[plenary.test_harness]]).test_directory([[tests ! -regex .*_config.*_spec.*]], { minimal_init = '"${TESTS_INIT}"', timeout = "${TIMEOUT_MINS}", sequential = true, })"

test-all:
@nvim \
Expand All @@ -41,37 +36,3 @@ test-all-sequential:
-u ${TESTS_INIT} \
-c "lua require([[plenary.test_harness]]).test_directory([[tests]], { minimal_init = '"${TESTS_INIT}"', timeout = "${TIMEOUT_MINS}", sequential = true, })"

test-demo:
@nvim \
--headless \
--noplugin \
-u ${TESTS_INIT} \
-c "lua require([[plenary.test_harness]]).test_directory([[tests -regex .*_demo.*_spec.*]], { minimal_init = '"${TESTS_INIT}"', timeout = "${TIMEOUT_MINS}", })"

test-demo-main:
@nvim \
--headless \
--noplugin \
-u ${TESTS_INIT} \
-c "lua require([[plenary.test_harness]]).test_directory([[tests -name kitty_scrollback_demo_spec.lua]], { minimal_init = '"${TESTS_INIT}"', timeout = "${TIMEOUT_MINS}", })"

test-demo-config:
@nvim \
--headless \
--noplugin \
-u ${TESTS_INIT} \
-c "lua require([[plenary.test_harness]]).test_directory([[tests -regex .*kitty_scrollback_config_demo.*_spec.lua]], { minimal_init = '"${TESTS_INIT}"', timeout = "${TIMEOUT_MINS}", })"

record-demo:
@nvim \
--headless \
--noplugin \
-u ${TESTS_INIT} \
-c "lua vim.env.KSB_RECORD_DEMO = 'true' require([[plenary.test_harness]]).test_directory([[tests -regex .*_demo.*_spec.*]], { minimal_init = '"${TESTS_INIT}"', timeout = "${TIMEOUT_MINS}", sequential = true, })"

record-demo-main:
@nvim \
--headless \
--noplugin \
-u ${TESTS_INIT} \
-c "lua vim.env.KSB_RECORD_DEMO = 'true' require([[plenary.test_harness]]).test_directory([[tests -name kitty_scrollback_demo_spec.lua]], { minimal_init = '"${TESTS_INIT}"', timeout = "${TIMEOUT_MINS}", sequential = true, })"
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ Navigate your [Kitty](https://sw.kovidgoyal.net/kitty/) scrollback buffer to qui
<source media="(prefers-color-scheme: light)" srcset="https://github.com/mikesmithgh/kitty-scrollback.nvim/wiki/assets/kitty_scrollback_screencapture_00_kitty_scrollback_nvim.gif">
<img alt="kitty-scrollback.nvim demo" src="https://github.com/mikesmithgh/kitty-scrollback.nvim/wiki/assets/kitty_scrollback_screencapture_00_kitty_scrollback_nvim.gif">
</picture>
<div align="center"><sup>(click for video)<sup></div>
</a>

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
Expand Down Expand Up @@ -67,7 +66,7 @@ Navigate your [Kitty](https://sw.kovidgoyal.net/kitty/) scrollback buffer to qui
> Expand each section under the [Features](#-features) section to see a demo.
>
> Check out the [wiki](https://github.com/mikesmithgh/kitty-scrollback.nvim/wiki) for
> [detailed demos of each configuration option](https://github.com/mikesmithgh/kitty-scrollback.nvim/wiki/Advanced-Configuration-Examples), [useful configurations](https://github.com/mikesmithgh/kitty-scrollback.nvim/wiki#useful-configurations), and more.
> [useful](https://github.com/mikesmithgh/kitty-scrollback.nvim/wiki#useful-configurations) and [recommended](https://github.com/mikesmithgh/kitty-scrollback.nvim/wiki#recommended-configurations-for-other-plugins) configurations.
<!-- panvimdoc-ignore-end -->

Expand Down Expand Up @@ -373,8 +372,6 @@ This section provides details on how to customize your kitty-scrollback.nvim con
> Please review the [Recommended Configurations for other plugins](https://github.com/mikesmithgh/kitty-scrollback.nvim/wiki#recommended-configurations-for-other-plugins)
> section of the wiki to prevent conflicts with other plugins.
>
> The [Advanced Configuration](https://github.com/mikesmithgh/kitty-scrollback.nvim/wiki#advanced-configuration) section of the wiki provides
> [useful configurations](https://github.com/mikesmithgh/kitty-scrollback.nvim/wiki#useful-configurations) and [detailed demos of each configuration option](https://github.com/mikesmithgh/kitty-scrollback.nvim/wiki/Advanced-Configuration-Examples).
### Kitten Arguments
Arguments that can be passed to the `kitty_scrollback_nvim` [Kitten](https://sw.kovidgoyal.net/kitty/kittens_intro/) defined in [kitty.conf](https://sw.kovidgoyal.net/kitty/conf/). You can provide
Expand Down
5 changes: 4 additions & 1 deletion tests/kitty-scrollback/helpers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,10 @@ M.ksb_dir = function()
end

M.init_nvim = function(config_override)
local config_dir = vim.fn.fnamemodify(vim.fn.fnamemodify(vim.fn.stdpath('config'), ':h'), ':p')
--- @type string
--- @diagnostic disable-next-line:assign-type-mismatch
local config_path = vim.fn.stdpath('config')
local config_dir = vim.fn.fnamemodify(vim.fn.fnamemodify(config_path, ':h'), ':p')
local nvim_config_dir = config_dir .. 'ksb-nvim-tests'
local is_directory = vim.fn.isdirectory(nvim_config_dir) > 0
if is_directory then
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
local h = require('tests.kitty-scrollback.helpers')
local screencapture = require('tests.kitty-scrollback.screencapture')

h.setup_backport()

local ksb_dir = h.ksb_dir()
Expand All @@ -14,7 +12,7 @@ local tmpsock = h.tempsocket(ksb_dir .. 'tmp/')
local kitty_instance
local ksb_work_dir

local shell = h.debug(h.is_github_action and '/bin/bash' or (vim.o.shell .. ' --noprofile --norc'))
local shell = h.debug(h.is_github_action and '/bin/bash' or 'bash --noprofile --norc')

local kitty_cmd = h.debug({
h.kitty,
Expand Down Expand Up @@ -81,8 +79,6 @@ local function after_all()
vim.fn.delete(ksb_work_dir, 'rf')
end

local it = screencapture.wrap_it(it, tmpsock, 0)

describe('kitty-scrollback.nvim', function()
before_all()

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
local h = require('tests.kitty-scrollback.helpers')
local screencapture = require('tests.kitty-scrollback.screencapture')

h.setup_backport()

local ksb_dir = h.ksb_dir()
Expand All @@ -13,7 +11,7 @@ local tmpsock = h.tempsocket(ksb_dir .. 'tmp/')
local kitty_instance
local ksb_work_dir

local shell = h.debug(h.is_github_action and '/bin/bash' or (vim.o.shell .. ' --noprofile --norc'))
local shell = h.debug(h.is_github_action and '/bin/bash' or 'bash --noprofile --norc')

local kitty_cmd = h.debug({
h.kitty,
Expand Down Expand Up @@ -80,8 +78,6 @@ local function after_all()
vim.fn.delete(ksb_work_dir, 'rf')
end

local it = screencapture.wrap_it(it, tmpsock, 11)

-- TODO: seeing some flakiness in github runners, adding a delay to see if this helps
-- we may want to add conditional delays depending on if the test is running locally vs a github runner
local append_delay = 3
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
local h = require('tests.kitty-scrollback.helpers')
local screencapture = require('tests.kitty-scrollback.screencapture')

h.setup_backport()

local ksb_dir = h.ksb_dir()
Expand All @@ -13,7 +11,7 @@ local tmpsock = h.tempsocket(ksb_dir .. 'tmp/')
local kitty_instance
local ksb_work_dir

local shell = h.debug(h.is_github_action and '/bin/bash' or (vim.o.shell .. ' --noprofile --norc'))
local shell = h.debug(h.is_github_action and '/bin/bash' or 'bash --noprofile --norc')

local kitty_cmd = h.debug({
h.kitty,
Expand Down Expand Up @@ -80,8 +78,6 @@ local function after_all()
vim.fn.delete(ksb_work_dir, 'rf')
end

local it = screencapture.wrap_it(it, tmpsock, 20)

describe('kitty-scrollback.nvim', function()
before_all()

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
local h = require('tests.kitty-scrollback.helpers')
local screencapture = require('tests.kitty-scrollback.screencapture')

h.setup_backport()

local ksb_dir = h.ksb_dir()
Expand All @@ -13,7 +11,7 @@ local tmpsock = h.tempsocket(ksb_dir .. 'tmp/')
local kitty_instance
local ksb_work_dir

local shell = h.debug(h.is_github_action and '/bin/bash' or (vim.o.shell .. ' --noprofile --norc'))
local shell = h.debug(h.is_github_action and '/bin/bash' or 'bash --noprofile --norc')

local kitty_cmd = h.debug({
h.kitty,
Expand Down Expand Up @@ -80,8 +78,6 @@ local function after_all()
vim.fn.delete(ksb_work_dir, 'rf')
end

local it = screencapture.wrap_it(it, tmpsock, 27)

describe('kitty-scrollback.nvim', function()
before_all()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ h.debug({
local tmpsock
local kitty_instance

local shell = h.debug(h.is_github_action and '/bin/bash' or (vim.o.shell .. ' --noprofile --norc'))
local shell = h.debug(h.is_github_action and '/bin/bash' or 'bash --noprofile --norc')

describe('kitty-scrollback.nvim', function()
h.init_nvim()
Expand Down
Loading

0 comments on commit 16d9f1b

Please sign in to comment.