Open last active cluster after switching workspaces (#1444)

* Save and restore lastActiveClusterId

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Activate clusters from workspaces page

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Fix saving last cluster while jumping from tray

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Adding workspace switch tests

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Remove console.log()

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Cleaning up

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Clean duplicated ClusterId definition

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Moving lastActiveClusterId field into WorkspaceModel

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* fix extensionLoader error on dev environments where renderer might start early (#1447)

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* Add Search by Ip to Pod View (#1445)

Signed-off-by: Pavel Ashevskii <pashevskii@mirantis.com>

* Make BaseStore abstract (#1431)

* make BaseStore abstract so that implementers are forced to decide how to store data

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Enforce semicolons in eslint

Signed-off-by: Panu Horsmalahti <phorsmalahti@mirantis.com>

* Add a few missing folders to be linted.

Signed-off-by: Panu Horsmalahti <phorsmalahti@mirantis.com>

* Use @typescript-eslint/semi.

Signed-off-by: Panu Horsmalahti <phorsmalahti@mirantis.com>

* Allow extension cluster menus to have a parent (#1452)

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

* fix SwitchCase indent rule in eslint (#1454)

Signed-off-by: Sebastian Malton <sebastian@malton.name>

* Revert "fix SwitchCase indent rule in eslint (#1454)"

This reverts commit 082774fe6e.

* Revert "Allow extension cluster menus to have a parent (#1452)"

This reverts commit 622c45cd6d.

* Revert "Use @typescript-eslint/semi."

This reverts commit 890fa5dd9e.

* Revert "Add a few missing folders to be linted."

This reverts commit c7b24c2922.

* Revert "Enforce semicolons in eslint"

This reverts commit ca67caea60.

* Revert "Make BaseStore abstract (#1431)"

This reverts commit 4b56ab7c61.

* Revert "Add Search by Ip to Pod View (#1445)"

This reverts commit 4079214dc1.

* Revert "fix extensionLoader error on dev environments where renderer might start early (#1447)"

This reverts commit 8a3613ac6f.

* Split workspace tests to smaller ones

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Missing semicolons

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Split workspace tests a bit more

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Adding extra click in Add Cluster button

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Adding more awaits to check running cluster

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

* Wait for minikube before running tests

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

Co-authored-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
Co-authored-by: pashevskii <53330707+pashevskii@users.noreply.github.com>
Co-authored-by: Sebastian Malton <sebastian@malton.name>
Co-authored-by: Panu Horsmalahti <phorsmalahti@mirantis.com>
This commit is contained in:
authored and GitHub committed 2020-11-20 14:53:28 +03:00
1 parent 5fd1abe99d
commit 8c73861962
8 files changed
+106 -31

No files matched your search

+63 -20
View File
@@ -35,6 +35,29 @@ describe("Lens integration tests", () => {
await app.client.waitUntilTextExists("h1", "Welcome");
};
const minikubeReady = (): boolean => {
// determine if minikube is running
let status = spawnSync("minikube status", { shell: true });
if (status.status !== 0) {
console.warn("minikube not running");
return false;
}
// Remove TEST_NAMESPACE if it already exists
status = spawnSync(`minikube kubectl -- get namespace ${TEST_NAMESPACE}`, { shell: true });
if (status.status === 0) {
console.warn(`Removing existing ${TEST_NAMESPACE} namespace`);
status = spawnSync(`minikube kubectl -- delete namespace ${TEST_NAMESPACE}`, { shell: true });
if (status.status !== 0) {
console.warn(`Error removing ${TEST_NAMESPACE} namespace: ${status.stderr.toString()}`);
return false;
}
console.log(status.stdout.toString());
}
return true;
};
const ready = minikubeReady();
describe("app start", () => {
beforeAll(appStart, 20000);
@@ -73,28 +96,48 @@ describe("Lens integration tests", () => {
});
});
const minikubeReady = (): boolean => {
// determine if minikube is running
let status = spawnSync("minikube status", { shell: true });
if (status.status !== 0) {
console.warn("minikube not running");
return false;
}
describeif(ready)("workspaces", () => {
beforeAll(appStart, 20000);
// Remove TEST_NAMESPACE if it already exists
status = spawnSync(`minikube kubectl -- get namespace ${TEST_NAMESPACE}`, { shell: true });
if (status.status === 0) {
console.warn(`Removing existing ${TEST_NAMESPACE} namespace`);
status = spawnSync(`minikube kubectl -- delete namespace ${TEST_NAMESPACE}`, { shell: true });
if (status.status !== 0) {
console.warn(`Error removing ${TEST_NAMESPACE} namespace: ${status.stderr.toString()}`);
return false;
afterAll(async () => {
if (app && app.isRunning()) {
return util.tearDown(app);
}
console.log(status.stdout.toString());
}
return true;
};
const ready = minikubeReady();
});
it('creates new workspace', async () => {
await clickWhatsNew(app);
await app.client.click('#current-workspace .Icon');
await app.client.click('a[href="/workspaces"]');
await app.client.click('.Workspaces button.Button');
await app.client.keys("test-workspace");
await app.client.click('.Workspaces .Input.description input');
await app.client.keys("test description");
await app.client.click('.Workspaces .workspace.editing .Icon');
await app.client.waitUntilTextExists(".workspace .name a", "test-workspace");
});
it('adds cluster in default workspace', async () => {
await addMinikubeCluster(app);
await app.client.waitUntilTextExists("pre.kube-auth-out", "Authentication proxy started");
await app.client.waitForExist(`iframe[name="minikube"]`);
await app.client.waitForVisible(".ClustersMenu .ClusterIcon.active");
});
it('adds cluster in test-workspace', async () => {
await app.client.click('#current-workspace .Icon');
await app.client.click('.WorkspaceMenu li[title="test description"]');
await addMinikubeCluster(app);
await app.client.waitUntilTextExists("pre.kube-auth-out", "Authentication proxy started");
await app.client.waitForExist(`iframe[name="minikube"]`);
});
it('checks if default workspace has active cluster', async () => {
await app.client.click('#current-workspace .Icon');
await app.client.click('.WorkspaceMenu > li:first-of-type');
await app.client.waitForVisible(".ClustersMenu .ClusterIcon.active");
});
});
const addMinikubeCluster = async (app: Application) => {
await app.client.click("div.add-cluster");