Skip to content

Commit

Permalink
test: use prepare.lua to install neovim plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
mikavilpas committed Jan 12, 2025
1 parent 1b9825c commit 0a57ef0
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 24 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ jobs:
key: my-cache-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
- run: pnpm install

- name: Preinstall neovim plugins
run: pnpm tui neovim exec "Lazy! sync"
working-directory: integration-tests

# need to work around https://github.com/cypress-io/github-action/issues/1246
- run: pnpm --filter integration-tests exec cypress install
- run: pnpm cy:run
Expand Down
7 changes: 7 additions & 0 deletions integration-tests/MyTestDirectory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ export const MyTestDirectorySchema = z.object({
extension: z.literal("lua"),
stem: z.literal("init."),
}),
"prepare.lua": z.object({
name: z.literal("prepare.lua"),
type: z.literal("file"),
extension: z.literal("lua"),
stem: z.literal("prepare."),
}),
}),
}),
}),
Expand Down Expand Up @@ -147,6 +153,7 @@ export type MyTestDirectory = MyTestDirectoryContentsSchemaType["contents"]

export const testDirectoryFiles = z.enum([
".config/nvim/init.lua",
".config/nvim/prepare.lua",
".config/nvim",
".config",
"config-modifications/don't_use_debug_mode.lua",
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"zod": "3.24.1"
},
"devDependencies": {
"@tui-sandbox/library": "7.5.6",
"@tui-sandbox/library": "7.6.0",
"@types/node": "22.10.3",
"@types/tinycolor2": "1.4.6",
"@typescript-eslint/eslint-plugin": "8.19.0",
Expand Down
9 changes: 9 additions & 0 deletions integration-tests/test-environment/.config/nvim/prepare.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
-- This file defines how to set up Neovim's plugins and external applications
-- such as LSP servers and formatters.
--
-- They can be slow to install, which would make the tests slow (and they might
-- be flaky because of this). This is why this file can be executed before
-- starting the test run.

-- make sure the dependencies defined in ./init.lua are installed
vim.cmd("Lazy! sync")
38 changes: 19 additions & 19 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0a57ef0

Please sign in to comment.