Skip to content

Commit

Permalink
fix: issues in e2e tests
Browse files Browse the repository at this point in the history
Signed-off-by: Ivo Yankov <[email protected]>
  • Loading branch information
Ivo-Yankov committed Jan 6, 2025
1 parent 016cee4 commit 33c0401
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
14 changes: 12 additions & 2 deletions src/commands/cluster/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import * as ContextFlags from './flags.js';
import {RemoteConfigTasks} from '../../core/config/remote/remote_config_tasks.js';
import type {RemoteConfigManager} from '../../core/config/remote/remote_config_manager.js';
import {connectConfigBuilder, resetConfigBuilder, setupConfigBuilder} from './configs.js';
import {SoloError} from "../../core/errors.js";

Check failure on line 25 in src/commands/cluster/handlers.ts

View workflow job for this annotation

GitHub Actions / Code Style / Standard

Replace `"../../core/errors.js"` with `'../../core/errors.js'`

export class ClusterCommandHandlers implements CommandHandlers {
readonly parent: BaseCommand;
Expand Down Expand Up @@ -110,7 +111,12 @@ export class ClusterCommandHandlers implements CommandHandlers {
null,
);

await action(argv, this);
try {
await action(argv, this);

Check failure on line 115 in src/commands/cluster/handlers.ts

View workflow job for this annotation

GitHub Actions / Code Style / Standard

Delete `··`
} catch (e: Error | any) {
throw new SoloError('Error on cluster setup', e);

Check failure on line 117 in src/commands/cluster/handlers.ts

View workflow job for this annotation

GitHub Actions / Code Style / Standard

Delete `··`
}

return true;
}

Expand All @@ -131,7 +137,11 @@ export class ClusterCommandHandlers implements CommandHandlers {
null,
);

await action(argv, this);
try {
await action(argv, this);

Check failure on line 141 in src/commands/cluster/handlers.ts

View workflow job for this annotation

GitHub Actions / Code Style / Standard

Delete `··`
} catch (e: Error | any) {
throw new SoloError('Error on cluster reset', e);

Check failure on line 143 in src/commands/cluster/handlers.ts

View workflow job for this annotation

GitHub Actions / Code Style / Standard

Delete `··`
}
return true;
}
}
6 changes: 3 additions & 3 deletions src/commands/cluster/tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,10 +310,10 @@ export class ClusterCommandTasks {
);
}

async acquireNewLease(argv) {
const lease = await this.parent.getLeaseManager().create();
acquireNewLease(argv) {
return new Task('Acquire new lease', async (ctx: any, task: ListrTaskWrapper<any, any, any>) => {
ListrLease.newAcquireLeaseTask(lease, task);
const lease = await this.parent.getLeaseManager().create();
return ListrLease.newAcquireLeaseTask(lease, task);
});
}

Expand Down
2 changes: 1 addition & 1 deletion test/e2e/commands/cluster.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ describe('ClusterCommand', () => {

it('function showInstalledChartList should return right true', async () => {
// @ts-ignore
await expect(clusterCmd.showInstalledChartList()).to.eventually.be.undefined;
await expect(clusterCmd.handlers.tasks.showInstalledChartList()).to.eventually.be.undefined;
}).timeout(Duration.ofMinutes(1).toMillis());

// helm list would return an empty list if given invalid namespace
Expand Down

0 comments on commit 33c0401

Please sign in to comment.