From bdf5ee16c80087ad9493219e4ae19efe71f40153 Mon Sep 17 00:00:00 2001 From: Cedric Halbronn Date: Thu, 16 May 2024 11:52:22 +0100 Subject: [PATCH] more ci --- .github/workflows/test.yml | 2 +- .../src/launchNeovimAndRunTests.ts | 32 ++++++++++++------- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a7c217b88e..a967ef318c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 diff --git a/packages/test-harness/src/launchNeovimAndRunTests.ts b/packages/test-harness/src/launchNeovimAndRunTests.ts index 9ffc958288..0d0cfe4adb 100644 --- a/packages/test-harness/src/launchNeovimAndRunTests.ts +++ b/packages/test-harness/src/launchNeovimAndRunTests.ts @@ -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 @@ -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}`);