mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Add designated folder for extensions (#1245)
* add store for mapping extension names to filesystem paths - add extension mechinism for getting a folder to save files to - add test to make sure that extensions are being loaded - skip extension loading test Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
b94e523ad5
commit
4e6b8ee10e
9 files changed
+119
-32
No files matched your search
@@ -16,8 +16,8 @@ jest.setTimeout(60000);
|
||||
// FIXME (!): improve / simplify all css-selectors + use [data-test-id="some-id"] (already used in some tests below)
|
||||
describe("Lens integration tests", () => {
|
||||
const TEST_NAMESPACE = "integration-tests";
|
||||
|
||||
const BACKSPACE = "\uE003";
|
||||
|
||||
let app: Application;
|
||||
|
||||
const appStart = async () => {
|
||||
@@ -37,23 +37,33 @@ 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;
|
||||
{
|
||||
const { status } = spawnSync("minikube status", { shell: true });
|
||||
if (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;
|
||||
{
|
||||
const { status } = spawnSync(`minikube kubectl -- get namespace ${TEST_NAMESPACE}`, { shell: true });
|
||||
if (status === 0) {
|
||||
console.warn(`Removing existing ${TEST_NAMESPACE} namespace`);
|
||||
|
||||
const { status, stdout, stderr } = spawnSync(
|
||||
`minikube kubectl -- delete namespace ${TEST_NAMESPACE}`,
|
||||
{ shell: true },
|
||||
);
|
||||
if (status !== 0) {
|
||||
console.warn(`Error removing ${TEST_NAMESPACE} namespace: ${stderr.toString()}`);
|
||||
return false;
|
||||
}
|
||||
|
||||
console.log(stdout.toString());
|
||||
}
|
||||
console.log(status.stdout.toString());
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
const ready = minikubeReady();
|
||||
@@ -62,8 +72,8 @@ describe("Lens integration tests", () => {
|
||||
beforeAll(appStart, 20000);
|
||||
|
||||
afterAll(async () => {
|
||||
if (app && app.isRunning()) {
|
||||
return util.tearDown(app);
|
||||
if (app?.isRunning()) {
|
||||
await util.tearDown(app);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -8,9 +8,8 @@ const AppPaths: Partial<Record<NodeJS.Platform, string>> = {
|
||||
|
||||
export function setup(): Application {
|
||||
return new Application({
|
||||
// path to electron app
|
||||
path: AppPaths[process.platform], // path to electron app
|
||||
args: [],
|
||||
path: AppPaths[process.platform],
|
||||
startTimeout: 30000,
|
||||
waitTimeout: 60000,
|
||||
env: {
|
||||
@@ -19,9 +18,10 @@ export function setup(): Application {
|
||||
});
|
||||
}
|
||||
|
||||
type AsyncPidGetter = () => Promise<number>;
|
||||
|
||||
export async function tearDown(app: Application) {
|
||||
const mpid: any = app.mainProcess.pid;
|
||||
const pid = await mpid();
|
||||
const pid = await (app.mainProcess.pid as any as AsyncPidGetter)();
|
||||
await app.stop();
|
||||
try {
|
||||
process.kill(pid, "SIGKILL");
|
||||
|
||||
Reference in new issue
Block a user