From 13286bf4c9762b7d6c6176464d94b1fc316fb568 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Sat, 17 Sep 2022 20:20:01 -0700 Subject: [PATCH] wip: refactor vscode integration tests --- ci/dev/test-integration.sh | 20 +++++++++++++++++++ .../routes => integration}/vscode.test.ts | 9 ++++----- 2 files changed, 24 insertions(+), 5 deletions(-) rename test/{unit/node/routes => integration}/vscode.test.ts (94%) diff --git a/ci/dev/test-integration.sh b/ci/dev/test-integration.sh index b2868154f..4f31c7d72 100755 --- a/ci/dev/test-integration.sh +++ b/ci/dev/test-integration.sh @@ -32,6 +32,26 @@ main() { popd fi + # TODO@jsjoeio get this working like in test-unit.sh + # ln -s "/usr/local/Cellar/code-server/4.7.0/libexec/lib/vscode/out" ./lib/vscode/out + # source ./ci/lib.sh + + # Our code imports from `out` in order to work during development but if you + # have only built for production you will have not have this directory. In + # that case symlink `out` to a production build directory. + # if [[ ! -e lib/vscode/out ]]; then + # pushd lib + # local out=(vscode-reh-web-*) + # if [[ -d "${out[0]}" ]]; then + # ln -s "../${out[0]}/out" ./vscode/out + # else + # echo "Could not find lib/vscode/out or lib/vscode-reh-web-*" + # echo "Code must be built before running unit tests" + # # exit 1 + # fi + # popd + # fi + echo "Running tests with code-server binary: '$path'" if [[ ! -f $path ]]; then diff --git a/test/unit/node/routes/vscode.test.ts b/test/integration/vscode.test.ts similarity index 94% rename from test/unit/node/routes/vscode.test.ts rename to test/integration/vscode.test.ts index 5d3dbb63d..2b67b9ae4 100644 --- a/test/unit/node/routes/vscode.test.ts +++ b/test/integration/vscode.test.ts @@ -1,11 +1,10 @@ import { promises as fs } from "fs" import * as path from "path" -import { clean, tmpdir } from "../../../utils/helpers" -import * as httpserver from "../../../utils/httpserver" -import * as integration from "../../../utils/integration" +import { clean, tmpdir } from "../utils/helpers" +import * as httpserver from "../utils/httpserver" +import * as integration from "../utils/integration" -// TODO@jsjoeio - move these to integration tests since they rely on Code -// to be built +// TODO@jsjoeio - remove skip when script fixed describe.skip("vscode", () => { let codeServer: httpserver.HttpServer | undefined