diff --git a/.github/workflows/ui-test.yml b/.github/workflows/ui-test.yml index ba8fcbff..acc7f1d3 100644 --- a/.github/workflows/ui-test.yml +++ b/.github/workflows/ui-test.yml @@ -28,12 +28,16 @@ jobs: with: version: 6 run_install: false + - run: | + BRANCH=${GITHUB_HEAD_REF:-$(git rev-parse --abbrev-ref HEAD)} + BRANCH=${BRANCH/\//-} + echo "BRANCH=${BRANCH}">>$GITHUB_ENV - uses: actions/cache@v2 id: pnpm-cache with: path: "**/node_modules" - key: ${{ runner.os }}-ui-test-${{ hashFiles('**/pnpm-lock.yaml') }} + key: ${{ env.BRANCH }}-${{ runner.os }}-ui-test-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: ${{ runner.os }}-ui-test - uses: pnpm/action-setup@v2.1.0 @@ -67,7 +71,7 @@ jobs: action: devSpace.create - name: Run tests - timeout-minutes: 20 + timeout-minutes: 30 env: CYPRESS_EVERY_NTH_FRAME: 1 VIDEO_CAPTURE: 1 diff --git a/package.json b/package.json index 79784b9a..9705e844 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nocalhost", - "version": "0.6.16-alpha.f0d3f86", + "version": "0.6.16-alpha.0bc690b", "displayName": "Nocalhost", "description": "Makes developing with Kubernetes feel like on local. IDE tool for cloud-native development", "license": "Apache-2.0", @@ -151,7 +151,7 @@ { "command": "Nocalhost.run", "when": "viewItem =~ /^workload-(deployment|statefulSet|job|daemonSet|cronjob|pod|crd-resources)-dev-(?!vpn_)/i", - "group": "developing@3" + "group": "inline" }, { "command": "Nocalhost.debug", @@ -181,7 +181,7 @@ { "command": "Nocalhost.applyKubernetesObject", "when": "viewItem =~ /^application-(.*)-installed/i", - "group": "application@2" + "group": "inline" }, { "command": "Nocalhost.upgradeApp", @@ -206,7 +206,7 @@ { "command": "Nocalhost.startCopyDevMode", "when": "viewItem =~ /^workload-(deployment|statefulSet|job|daemonSet|cronjob|pod|crd-resources)-dev-(?!(developing-duplicate|developing-replace-self|starting|vpn_healthy|vpn_unhealthy))/i", - "group": "navigation" + "group": "inline" }, { "command": "Nocalhost.endDevMode", @@ -241,7 +241,7 @@ { "command": "Nocalhost.log", "when": "viewItem =~ /^(viewer:|)workload-(deployment|statefulSet|daemonSet|job|cronJob|pod|crd-resources)-dev-(?!vpn_)/i", - "group": "1" + "group": "inline" }, { "command": "Nocalhost.editManifest", @@ -252,7 +252,7 @@ { "command": "Nocalhost.portForward", "when": "viewItem =~ /^(viewer:|)workload-(deployment|statefulSet|job|daemonSet|cronjob|pod|pod-Running|crd-resources)-dev-(?!vpn_)/i", - "group": "1" + "group": "inline" }, { "command": "Nocalhost.portForward", diff --git a/src/main/commands/DebugCommand.ts b/src/main/commands/DebugCommand.ts index 14518a5c..45e17a6e 100644 --- a/src/main/commands/DebugCommand.ts +++ b/src/main/commands/DebugCommand.ts @@ -50,6 +50,8 @@ export default class DebugCommand implements ICommand { this.node = node; this.container = await getContainer(node); + const debugProvider = await this.getDebugProvider(); + this.validateDebugConfig(this.container); if (!param?.command) { @@ -64,8 +66,6 @@ export default class DebugCommand implements ICommand { } } - const debugProvider = await this.getDebugProvider(); - await waitForSync(node, DEBUG); this.startDebugging(node, debugProvider); diff --git a/test/extension/integration/connect.js b/test/extension/integration/connect.js index 1ac1b896..57f55403 100644 --- a/test/extension/integration/connect.js +++ b/test/extension/integration/connect.js @@ -35,7 +35,10 @@ async function loginServer() { async function getIframe() { const parentHandle = await page.waitForSelector( - "#webview-webviewview-nocalhost-home .webview.ready" + `.webview.ready[src$="purpose=webviewView"]`, + { + timeout: 60_000, + } ); const parent = await parentHandle.contentFrame(); @@ -43,6 +46,10 @@ async function getIframe() { assert.ok(parent); const iframeHandle = await parent.waitForSelector("#active-frame"); + + assert.ok(parent); + assert.ok(iframeHandle); + const iframe = await iframeHandle.contentFrame(); await iframe.waitForSelector(".nocalhost-tab"); @@ -55,9 +62,9 @@ async function pasteAsText() { const tabs = await (await iframe.$(".nocalhost-tab")).$$(":scope > *"); await tabs[0].click(); - const buttons = await (await iframe.$(".MuiTabs-flexContainer")).$$( - ":scope > *" - ); + const buttons = await ( + await iframe.$(".MuiTabs-flexContainer") + ).$$(":scope > *"); await buttons[1].click(); await iframe.focus('[placeholder="KubeConfig"]'); diff --git a/test/extension/integration/connect.test.js b/test/extension/integration/connect.test.js index fb5dfe70..0f418017 100644 --- a/test/extension/integration/connect.test.js +++ b/test/extension/integration/connect.test.js @@ -3,7 +3,14 @@ const { pasteAsText, loadKubeConfig } = require("./connect"); const connectTests = () => { describe("connect to Cluster", () => { it.skip("paste as Text", pasteAsText); - it("load KubeConfig", loadKubeConfig); + it("load KubeConfig", () => { + return loadKubeConfig().catch((err) => { + setTimeout(() => { + process.kill(process.pid); + }, 1_000); + throw err; + }); + }); }); }; diff --git a/test/extension/integration/nhctl.js b/test/extension/integration/nhctl.js index 1bf4d442..a3c983ed 100644 --- a/test/extension/integration/nhctl.js +++ b/test/extension/integration/nhctl.js @@ -11,7 +11,7 @@ async function download() { path.resolve(homedir(), ".nh", "bin", "nhctl"), { nothrow: true } ); - if (result && result.code === 0) { + if (result) { return; } diff --git a/test/extension/integration/nhctl.test.js b/test/extension/integration/nhctl.test.js index 214e1923..19b90793 100644 --- a/test/extension/integration/nhctl.test.js +++ b/test/extension/integration/nhctl.test.js @@ -1,7 +1,18 @@ const { download } = require("./nhctl"); const nhctlTests = () => { - it("download", download, 10 * 60 * 1000); + it( + "download", + () => { + return download().catch((err) => { + setTimeout(() => { + process.kill(process.pid); + }, 1_000); + throw err; + }); + }, + 10 * 60 * 1000 + ); }; module.exports = { nhctlTests };