Skip to content

Commit

Permalink
WIP - #339 test fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
tegefaulkes committed Mar 9, 2022
1 parent d3bf324 commit 57f93b7
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 12 deletions.
1 change: 0 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ lint:
image: registry.gitlab.com/matrixai/engineering/maintenance/gitlab-runner
stage: check
interruptible: true
allow_failure: true
script:
- >
nix-shell -I nixpkgs=./pkgs.nix --packages nodejs --run '
Expand Down
5 changes: 1 addition & 4 deletions src/bin/vaults/CommandScan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import CommandPolykey from '../CommandPolykey';
import * as binUtils from '../utils';
import * as binOptions from '../utils/options';
import * as binProcessors from '../utils/processors';
import { LogLevel } from '@matrixai/logger';

class CommandScan extends CommandPolykey {
constructor(...args: ConstructorParameters<typeof CommandPolykey>) {
Expand All @@ -18,8 +17,7 @@ class CommandScan extends CommandPolykey {
this.action(async (nodeId, options) => {
const { default: PolykeyClient } = await import('../../PolykeyClient');
const nodesPB = await import('../../proto/js/polykey/v1/nodes/nodes_pb');
this.logger.setLevel(LogLevel.INFO);
console.log(options);

const clientOptions = await binProcessors.processClientOptions(
options.nodePath,
options.nodeId,
Expand All @@ -28,7 +26,6 @@ class CommandScan extends CommandPolykey {
this.fs,
this.logger.getChild(binProcessors.processClientOptions.name),
);
console.log(clientOptions);
const client = await PolykeyClient.createPolykeyClient({
nodePath: options.nodePath,
nodeId: clientOptions.nodeId,
Expand Down
1 change: 0 additions & 1 deletion src/client/service/vaultsScan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ function vaultsScan({
await genWritable.next(null);
return;
} catch (e) {
console.error(e);
await genWritable.throw(e);
return;
}
Expand Down
9 changes: 3 additions & 6 deletions tests/bin/vaults/vaults.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { NodeAddress, NodeIdEncoded, NodeInfo } from '@/nodes/types';
import type { NodeIdEncoded, NodeAddress, NodeInfo } from '@/nodes/types';
import type { VaultId, VaultName } from '@/vaults/types';
import os from 'os';
import path from 'path';
Expand Down Expand Up @@ -33,7 +33,7 @@ jest.mock('@/keys/utils', () => ({
*/
describe('CLI vaults', () => {
const password = 'password';
const logger = new Logger('CLI Test', LogLevel.INFO, [new StreamHandler()]);
const logger = new Logger('CLI Test', LogLevel.WARN, [new StreamHandler()]);
let dataDir: string;
let passwordFile: string;
let polykeyAgent: PolykeyAgent;
Expand Down Expand Up @@ -100,7 +100,6 @@ describe('CLI vaults', () => {
});
});
beforeEach(async () => {
logger.setLevel(LogLevel.WARN);
vaultName = genVaultName();
command = [];
});
Expand Down Expand Up @@ -693,10 +692,9 @@ describe('CLI vaults', () => {
test.todo('test formatting of the output');
});
describe('commandScanNode', () => {
test.only(
test(
'should return the vaults names and ids of the remote vault',
async () => {
logger.setLevel(LogLevel.INFO);
let remoteOnline: PolykeyAgent | undefined;
try {
remoteOnline = await PolykeyAgent.createPolykeyAgent({
Expand Down Expand Up @@ -729,7 +727,6 @@ describe('CLI vaults', () => {
{ PK_PASSWORD: 'password' },
dataDir,
);
console.log(result1);
expect(result1.exitCode).toEqual(sysexits.NOPERM);
expect(result1.stderr).toContain(
'ErrorVaultsPermissionDenied: Permission was denied - Scanning is not allowed for',
Expand Down

0 comments on commit 57f93b7

Please sign in to comment.