Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 6 additions & 2 deletions .github/workflows/ui-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -181,7 +181,7 @@
{
"command": "Nocalhost.applyKubernetesObject",
"when": "viewItem =~ /^application-(.*)-installed/i",
"group": "application@2"
"group": "inline"
},
{
"command": "Nocalhost.upgradeApp",
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions src/main/commands/DebugCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -64,8 +66,6 @@ export default class DebugCommand implements ICommand {
}
}

const debugProvider = await this.getDebugProvider();

await waitForSync(node, DEBUG);

this.startDebugging(node, debugProvider);
Expand Down
15 changes: 11 additions & 4 deletions test/extension/integration/connect.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,21 @@ 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();

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");
Expand All @@ -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"]');
Expand Down
9 changes: 8 additions & 1 deletion test/extension/integration/connect.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
});
});
};

Expand Down
2 changes: 1 addition & 1 deletion test/extension/integration/nhctl.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async function download() {
path.resolve(homedir(), ".nh", "bin", "nhctl"),
{ nothrow: true }
);
if (result && result.code === 0) {
if (result) {
return;
}

Expand Down
13 changes: 12 additions & 1 deletion test/extension/integration/nhctl.test.js
Original file line number Diff line number Diff line change
@@ -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 };