Skip to content

Commit

Permalink
more ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Cedric Halbronn committed May 16, 2024
1 parent bd34a1e commit bdf5ee1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
# with:
# repository: thinca/vim-themis
# path: vim-themis
# testing
# testing - D:\a\cursorless\cursorless
- run: pwd
- name: Install Neovim
uses: rhysd/action-setup-vim@v1
Expand Down
32 changes: 20 additions & 12 deletions packages/test-harness/src/launchNeovimAndRunTests.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import * as cp from "child_process";
// import * as path from "path";
// import * as os from "os";
import { copyFile } from "fs";
// import {
// downloadAndUnzipVSCode,
// resolveCliArgsFromVSCodeExecutablePath,
// runTests,
// } from "@vscode/test-electron";
// import {
// extensionDependencies,
// getCursorlessRepoRoot,
// } from "@cursorless/common";
import {
// extensionDependencies,
getCursorlessRepoRoot,
} from "@cursorless/common";
import { getEnvironmentVariableStrict } from "@cursorless/common";

// https://stackoverflow.com/questions/37764665/how-to-implement-sleep-function-in-typescript
Expand Down Expand Up @@ -72,25 +73,32 @@ export async function launchNeovimAndRunTests(extensionTestsPath: string) {
// stdio: "inherit",
env: {
...process.env,
CURSORLESS_REPO_ROOT: "${workspaceFolder}",
// "NVIM_NODE_HOST_DEBUG": "1",
NVIM_NODE_LOG_FILE:
"${workspaceFolder}/packages/cursorless-neovim/out/nvim_node.log",
NVIM_NODE_LOG_FILE: `${getCursorlessRepoRoot()}/packages/cursorless-neovim/out/nvim_node.log`,
NVIM_NODE_LOG_LEVEL: "debug",
CURSORLESS_MODE: "test",
},
});

// C:\Users\user\AppData\Local\nvim\init.lua
// C:\Users\user\AppData\Local\nvim-data\lazy\{cursorless.nvim,lazy.nvim,talon.nvim}
// C:\Users\user\AppData\Local\nvim-data\log

// do not wait for nvim to exit to avoid any blocking
nvim_process.unref();

console.log(`pid: ${nvim_process.pid}`);

await delay(3000);
// C:\Users\user\AppData\Local\nvim\init.lua
// C:\Users\user\AppData\Local\nvim-data\lazy\{cursorless.nvim,lazy.nvim,talon.nvim}
// C:\Users\user\AppData\Local\nvim-data\log
copyFile(
`${getCursorlessRepoRoot()}\\packages\\test-harness\\src\\config\\init.lua`,
"C:\\Users\\runneradmin\\AppData\\Local\\nvim\\init.lua",
(err) => {
if (err) {
console.error(err);
}
},
);

await delay(5000);

nvim_process.kill("SIGTERM");
console.log(`killed: ${nvim_process.killed}`);
Expand Down

0 comments on commit bdf5ee1

Please sign in to comment.