Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests(windows): add basic integration test #224

Merged
merged 22 commits into from
Apr 7, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: debug segfault
mrcjkb committed Apr 7, 2024
commit cc805cd74701c9da1f683381322cefc825f40616
42 changes: 39 additions & 3 deletions .github/resources/init-windows.lua
Original file line number Diff line number Diff line change
@@ -15,6 +15,42 @@ local luarocks_cpath = {
}
package.cpath = package.cpath .. ";" .. table.concat(luarocks_cpath, ";")

vim.opt.runtimepath:append(
vim.fs.joinpath(vim.g.rocks_nvim.rocks_path, "lib", "luarocks", "rocks-5.1", "rocks.nvim", "*")
)
local log = require("rocks.log")
log.trace("loading nio")
-- local nio require("nio")
log.trace("loading rocks.adapter")
local adapter = require("rocks.adapter")
log.trace("loading rocks config")
local config = require("rocks.config.internal")

-- Set up the Rocks user command
require("rocks.commands").create_commands()
local env_path_seperator = vim.uv.os_uname().sysname:lower():find("windows") and ";" or ":"
log.trace("Appending luarocks binary directory to the system path with separator " .. env_path_seperator)
vim.env.PATH = vim.fs.joinpath(config.rocks_path, "bin") .. env_path_seperator .. vim.env.PATH
--
-- if not config.lazy then
-- log.trace("Populating caches")
-- nio.run(function()
-- local cache = require("rocks.cache")
-- nio.gather({
-- cache.populate_cached_rocks,
-- cache.populate_removable_rock_cache,
-- })
-- end)
-- end
--
adapter.init()

local config_file = require("rocks.fs").read_or_create(config.config_path, require("rocks.constants").DEFAULT_CONFIG)
vim.print(config_file)
require("toml_edit")
-- toml.decode(config_file)
-- local user_rocks = config.get_user_rocks()
-- vim.print(user_rocks)
-- require("rocks.api.hooks").run_preload_hooks(user_rocks)
-- require("rocks.runtime").source_start_plugins(user_rocks)

-- vim.opt.runtimepath:append(
-- vim.fs.joinpath(vim.g.rocks_nvim.rocks_path, "lib", "luarocks", "rocks-5.1", "rocks.nvim", "*")
-- )
3 changes: 2 additions & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -38,5 +38,6 @@ jobs:
- name: Run neovim with rocks.nvim
shell: bash
run: |
nvim -u .github/resources/init-windows.lua -c "lua io.write(require('rocks.config.internal').config_path)" +q 2>&1
nvim -u .github/resources/init-windows.lua -c "lua print(vim.uv.os_uname().sysname:lower())" +q
ls rocks
cat rocks/rocks.log
1 change: 0 additions & 1 deletion plugin/rocks.lua
Original file line number Diff line number Diff line change
@@ -5,7 +5,6 @@ end
local log = require("rocks.log")
log.trace("loading nio")
local nio = require("nio")
error("NIO LOADED")
log.trace("loading rocks.adapter")
local adapter = require("rocks.adapter")
log.trace("loading rocks config")