@memberjunction/cli 2.117.0 → 2.119.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +358 -55
- package/dist/commands/clean/index.js +2 -4
- package/dist/commands/dbdoc/analyze.d.ts +3 -3
- package/dist/commands/dbdoc/analyze.js +25 -48
- package/dist/commands/dbdoc/export.d.ts +11 -4
- package/dist/commands/dbdoc/export.js +72 -75
- package/dist/commands/dbdoc/generate-queries.d.ts +13 -0
- package/dist/commands/dbdoc/generate-queries.js +82 -0
- package/dist/commands/dbdoc/init.d.ts +1 -4
- package/dist/commands/dbdoc/init.js +7 -118
- package/dist/commands/dbdoc/reset.d.ts +9 -0
- package/dist/commands/dbdoc/reset.js +53 -0
- package/dist/commands/dbdoc/status.d.ts +9 -0
- package/dist/commands/dbdoc/status.js +52 -0
- package/dist/commands/migrate/index.js +3 -5
- package/dist/commands/sync/push.d.ts +2 -0
- package/dist/commands/sync/push.js +18 -1
- package/dist/commands/sync/status.d.ts +2 -0
- package/dist/commands/sync/status.js +14 -1
- package/dist/commands/test/compare.d.ts +18 -0
- package/dist/commands/test/compare.js +73 -0
- package/dist/commands/test/history.d.ts +15 -0
- package/dist/commands/test/history.js +66 -0
- package/dist/commands/test/index.d.ts +6 -0
- package/dist/commands/test/index.js +31 -0
- package/dist/commands/test/list.d.ts +16 -0
- package/dist/commands/test/list.js +73 -0
- package/dist/commands/test/run.d.ts +17 -0
- package/dist/commands/test/run.js +69 -0
- package/dist/commands/test/suite.d.ts +15 -0
- package/dist/commands/test/suite.js +58 -0
- package/dist/commands/test/validate.d.ts +17 -0
- package/dist/commands/test/validate.js +70 -0
- package/dist/config.d.ts +16 -12
- package/dist/config.js +45 -9
- package/oclif.manifest.json +791 -85
- package/package.json +12 -9
- package/dist/commands/dbdoc/review.d.ts +0 -10
- package/dist/commands/dbdoc/review.js +0 -81
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class TestCompare extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static args: {
|
|
6
|
+
runId1: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
7
|
+
runId2: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
8
|
+
};
|
|
9
|
+
static flags: {
|
|
10
|
+
version: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
commit: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
+
'diff-only': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
format: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
14
|
+
output: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
15
|
+
verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
16
|
+
};
|
|
17
|
+
run(): Promise<void>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const testing_cli_1 = require("@memberjunction/testing-cli");
|
|
5
|
+
class TestCompare extends core_1.Command {
|
|
6
|
+
static description = 'Compare test runs for regression detection';
|
|
7
|
+
static examples = [
|
|
8
|
+
'<%= config.bin %> <%= command.id %> <run-id-1> <run-id-2>',
|
|
9
|
+
'<%= config.bin %> <%= command.id %> --baseline=<run-id> --current=<run-id>',
|
|
10
|
+
'<%= config.bin %> <%= command.id %> --suite=<suite-id> --since="2024-01-01"',
|
|
11
|
+
'<%= config.bin %> <%= command.id %> <run-id-1> <run-id-2> --format=json',
|
|
12
|
+
];
|
|
13
|
+
static args = {
|
|
14
|
+
runId1: core_1.Args.string({
|
|
15
|
+
description: 'First test run ID to compare',
|
|
16
|
+
required: false,
|
|
17
|
+
}),
|
|
18
|
+
runId2: core_1.Args.string({
|
|
19
|
+
description: 'Second test run ID to compare',
|
|
20
|
+
required: false,
|
|
21
|
+
}),
|
|
22
|
+
};
|
|
23
|
+
static flags = {
|
|
24
|
+
version: core_1.Flags.string({
|
|
25
|
+
char: 'v',
|
|
26
|
+
description: 'Compare runs by version',
|
|
27
|
+
multiple: true,
|
|
28
|
+
}),
|
|
29
|
+
commit: core_1.Flags.string({
|
|
30
|
+
char: 'c',
|
|
31
|
+
description: 'Compare runs by git commit',
|
|
32
|
+
multiple: true,
|
|
33
|
+
}),
|
|
34
|
+
'diff-only': core_1.Flags.boolean({
|
|
35
|
+
description: 'Show only differences',
|
|
36
|
+
default: false,
|
|
37
|
+
}),
|
|
38
|
+
format: core_1.Flags.string({
|
|
39
|
+
char: 'f',
|
|
40
|
+
description: 'Output format',
|
|
41
|
+
options: ['console', 'json', 'markdown'],
|
|
42
|
+
default: 'console',
|
|
43
|
+
}),
|
|
44
|
+
output: core_1.Flags.string({
|
|
45
|
+
char: 'o',
|
|
46
|
+
description: 'Output file path',
|
|
47
|
+
}),
|
|
48
|
+
verbose: core_1.Flags.boolean({
|
|
49
|
+
description: 'Show detailed information',
|
|
50
|
+
default: false,
|
|
51
|
+
}),
|
|
52
|
+
};
|
|
53
|
+
async run() {
|
|
54
|
+
const { args, flags } = await this.parse(TestCompare);
|
|
55
|
+
try {
|
|
56
|
+
// Create CompareCommand instance and execute
|
|
57
|
+
// Context user will be fetched internally after MJ provider initialization
|
|
58
|
+
const compareCommand = new testing_cli_1.CompareCommand();
|
|
59
|
+
await compareCommand.execute(args.runId1, args.runId2, {
|
|
60
|
+
version: flags.version,
|
|
61
|
+
commit: flags.commit,
|
|
62
|
+
diffOnly: flags['diff-only'],
|
|
63
|
+
format: flags.format,
|
|
64
|
+
output: flags.output,
|
|
65
|
+
verbose: flags.verbose,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
this.error(error);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
exports.default = TestCompare;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class TestHistory extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
test: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
7
|
+
recent: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
|
+
from: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
|
+
status: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
format: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
output: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
+
verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
};
|
|
14
|
+
run(): Promise<void>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const testing_cli_1 = require("@memberjunction/testing-cli");
|
|
5
|
+
class TestHistory extends core_1.Command {
|
|
6
|
+
static description = 'View test execution history';
|
|
7
|
+
static examples = [
|
|
8
|
+
'<%= config.bin %> <%= command.id %>',
|
|
9
|
+
'<%= config.bin %> <%= command.id %> --test=<test-id>',
|
|
10
|
+
'<%= config.bin %> <%= command.id %> --suite=<suite-id>',
|
|
11
|
+
'<%= config.bin %> <%= command.id %> --since="2024-01-01"',
|
|
12
|
+
'<%= config.bin %> <%= command.id %> --limit=50',
|
|
13
|
+
];
|
|
14
|
+
static flags = {
|
|
15
|
+
test: core_1.Flags.string({
|
|
16
|
+
char: 't',
|
|
17
|
+
description: 'Filter by test ID',
|
|
18
|
+
}),
|
|
19
|
+
recent: core_1.Flags.integer({
|
|
20
|
+
char: 'r',
|
|
21
|
+
description: 'Number of recent runs to show',
|
|
22
|
+
}),
|
|
23
|
+
from: core_1.Flags.string({
|
|
24
|
+
description: 'Show history from date (YYYY-MM-DD)',
|
|
25
|
+
}),
|
|
26
|
+
status: core_1.Flags.string({
|
|
27
|
+
char: 's',
|
|
28
|
+
description: 'Filter by status',
|
|
29
|
+
}),
|
|
30
|
+
format: core_1.Flags.string({
|
|
31
|
+
char: 'f',
|
|
32
|
+
description: 'Output format',
|
|
33
|
+
options: ['console', 'json', 'markdown'],
|
|
34
|
+
default: 'console',
|
|
35
|
+
}),
|
|
36
|
+
output: core_1.Flags.string({
|
|
37
|
+
char: 'o',
|
|
38
|
+
description: 'Output file path',
|
|
39
|
+
}),
|
|
40
|
+
verbose: core_1.Flags.boolean({
|
|
41
|
+
char: 'v',
|
|
42
|
+
description: 'Show detailed information',
|
|
43
|
+
default: false,
|
|
44
|
+
}),
|
|
45
|
+
};
|
|
46
|
+
async run() {
|
|
47
|
+
const { flags } = await this.parse(TestHistory);
|
|
48
|
+
try {
|
|
49
|
+
// Create HistoryCommand instance and execute
|
|
50
|
+
// Context user will be fetched internally after MJ provider initialization
|
|
51
|
+
const historyCommand = new testing_cli_1.HistoryCommand();
|
|
52
|
+
await historyCommand.execute(flags.test, {
|
|
53
|
+
recent: flags.recent,
|
|
54
|
+
from: flags.from,
|
|
55
|
+
status: flags.status,
|
|
56
|
+
format: flags.format,
|
|
57
|
+
output: flags.output,
|
|
58
|
+
verbose: flags.verbose,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
this.error(error);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
exports.default = TestHistory;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
class Test extends core_1.Command {
|
|
5
|
+
static description = 'MemberJunction Testing Framework - Execute and manage tests';
|
|
6
|
+
static examples = [
|
|
7
|
+
'<%= config.bin %> <%= command.id %> run <test-id>',
|
|
8
|
+
'<%= config.bin %> <%= command.id %> run --name="Active Members Count"',
|
|
9
|
+
'<%= config.bin %> <%= command.id %> suite <suite-id>',
|
|
10
|
+
'<%= config.bin %> <%= command.id %> list',
|
|
11
|
+
'<%= config.bin %> <%= command.id %> list --suites',
|
|
12
|
+
'<%= config.bin %> <%= command.id %> validate --all',
|
|
13
|
+
];
|
|
14
|
+
async run() {
|
|
15
|
+
this.log('MemberJunction Testing Framework\n');
|
|
16
|
+
this.log('Available commands:');
|
|
17
|
+
this.log(' mj test run <test-id> - Execute a single test');
|
|
18
|
+
this.log(' mj test suite <suite-id> - Execute a test suite');
|
|
19
|
+
this.log(' mj test list - List available tests');
|
|
20
|
+
this.log(' mj test validate - Validate test definitions');
|
|
21
|
+
this.log(' mj test history - View test execution history');
|
|
22
|
+
this.log(' mj test compare - Compare test runs for regressions');
|
|
23
|
+
this.log('');
|
|
24
|
+
this.log('Legacy commands (file-based evals):');
|
|
25
|
+
this.log(' mj test eval <eval-id> - Run file-based AI evaluation');
|
|
26
|
+
this.log(' mj test report --type=eval - Generate eval report');
|
|
27
|
+
this.log('');
|
|
28
|
+
this.log('Run "mj test COMMAND --help" for more information on a command.');
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.default = Test;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class TestList extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
suites: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
types: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
type: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
|
+
tag: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
status: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
format: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
+
output: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
|
+
verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
};
|
|
15
|
+
run(): Promise<void>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const testing_cli_1 = require("@memberjunction/testing-cli");
|
|
5
|
+
class TestList extends core_1.Command {
|
|
6
|
+
static description = 'List available tests, suites, and types';
|
|
7
|
+
static examples = [
|
|
8
|
+
'<%= config.bin %> <%= command.id %>',
|
|
9
|
+
'<%= config.bin %> <%= command.id %> --suites',
|
|
10
|
+
'<%= config.bin %> <%= command.id %> --types',
|
|
11
|
+
'<%= config.bin %> <%= command.id %> --type=agent-eval',
|
|
12
|
+
'<%= config.bin %> <%= command.id %> --tag=smoke',
|
|
13
|
+
'<%= config.bin %> <%= command.id %> --status=active --verbose',
|
|
14
|
+
];
|
|
15
|
+
static flags = {
|
|
16
|
+
suites: core_1.Flags.boolean({
|
|
17
|
+
description: 'List test suites instead of tests',
|
|
18
|
+
default: false,
|
|
19
|
+
}),
|
|
20
|
+
types: core_1.Flags.boolean({
|
|
21
|
+
description: 'List test types',
|
|
22
|
+
default: false,
|
|
23
|
+
}),
|
|
24
|
+
type: core_1.Flags.string({
|
|
25
|
+
char: 't',
|
|
26
|
+
description: 'Filter by test type',
|
|
27
|
+
}),
|
|
28
|
+
tag: core_1.Flags.string({
|
|
29
|
+
description: 'Filter by tag',
|
|
30
|
+
}),
|
|
31
|
+
status: core_1.Flags.string({
|
|
32
|
+
char: 's',
|
|
33
|
+
description: 'Filter by status',
|
|
34
|
+
}),
|
|
35
|
+
format: core_1.Flags.string({
|
|
36
|
+
char: 'f',
|
|
37
|
+
description: 'Output format',
|
|
38
|
+
options: ['console', 'json', 'markdown'],
|
|
39
|
+
default: 'console',
|
|
40
|
+
}),
|
|
41
|
+
output: core_1.Flags.string({
|
|
42
|
+
char: 'o',
|
|
43
|
+
description: 'Output file path',
|
|
44
|
+
}),
|
|
45
|
+
verbose: core_1.Flags.boolean({
|
|
46
|
+
char: 'v',
|
|
47
|
+
description: 'Show detailed information',
|
|
48
|
+
default: false,
|
|
49
|
+
}),
|
|
50
|
+
};
|
|
51
|
+
async run() {
|
|
52
|
+
const { flags } = await this.parse(TestList);
|
|
53
|
+
try {
|
|
54
|
+
// Create ListCommand instance and execute
|
|
55
|
+
// Context user will be fetched internally after MJ provider initialization
|
|
56
|
+
const listCommand = new testing_cli_1.ListCommand();
|
|
57
|
+
await listCommand.execute({
|
|
58
|
+
suites: flags.suites,
|
|
59
|
+
types: flags.types,
|
|
60
|
+
type: flags.type,
|
|
61
|
+
tag: flags.tag,
|
|
62
|
+
status: flags.status,
|
|
63
|
+
format: flags.format,
|
|
64
|
+
output: flags.output,
|
|
65
|
+
verbose: flags.verbose,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
this.error(error);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
exports.default = TestList;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class TestRun extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static args: {
|
|
6
|
+
testId: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
static flags: {
|
|
9
|
+
name: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
environment: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
format: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
+
output: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
|
+
'dry-run': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
15
|
+
};
|
|
16
|
+
run(): Promise<void>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const testing_cli_1 = require("@memberjunction/testing-cli");
|
|
5
|
+
class TestRun extends core_1.Command {
|
|
6
|
+
static description = 'Execute a single test by ID or name';
|
|
7
|
+
static examples = [
|
|
8
|
+
'<%= config.bin %> <%= command.id %> <test-id>',
|
|
9
|
+
'<%= config.bin %> <%= command.id %> --name="Active Members Count"',
|
|
10
|
+
'<%= config.bin %> <%= command.id %> <test-id> --environment=staging',
|
|
11
|
+
'<%= config.bin %> <%= command.id %> <test-id> --format=json --output=results.json',
|
|
12
|
+
'<%= config.bin %> <%= command.id %> <test-id> --dry-run',
|
|
13
|
+
];
|
|
14
|
+
static args = {
|
|
15
|
+
testId: core_1.Args.string({
|
|
16
|
+
description: 'Test ID to execute',
|
|
17
|
+
required: false,
|
|
18
|
+
}),
|
|
19
|
+
};
|
|
20
|
+
static flags = {
|
|
21
|
+
name: core_1.Flags.string({
|
|
22
|
+
char: 'n',
|
|
23
|
+
description: 'Test name to execute',
|
|
24
|
+
}),
|
|
25
|
+
environment: core_1.Flags.string({
|
|
26
|
+
char: 'e',
|
|
27
|
+
description: 'Environment context (dev, staging, prod)',
|
|
28
|
+
}),
|
|
29
|
+
format: core_1.Flags.string({
|
|
30
|
+
char: 'f',
|
|
31
|
+
description: 'Output format',
|
|
32
|
+
options: ['console', 'json', 'markdown'],
|
|
33
|
+
default: 'console',
|
|
34
|
+
}),
|
|
35
|
+
output: core_1.Flags.string({
|
|
36
|
+
char: 'o',
|
|
37
|
+
description: 'Output file path',
|
|
38
|
+
}),
|
|
39
|
+
'dry-run': core_1.Flags.boolean({
|
|
40
|
+
description: 'Validate without executing',
|
|
41
|
+
default: false,
|
|
42
|
+
}),
|
|
43
|
+
verbose: core_1.Flags.boolean({
|
|
44
|
+
char: 'v',
|
|
45
|
+
description: 'Show detailed execution information',
|
|
46
|
+
default: false,
|
|
47
|
+
}),
|
|
48
|
+
};
|
|
49
|
+
async run() {
|
|
50
|
+
const { args, flags } = await this.parse(TestRun);
|
|
51
|
+
try {
|
|
52
|
+
// Create RunCommand instance and execute
|
|
53
|
+
// Context user will be fetched internally after MJ provider initialization
|
|
54
|
+
const runCommand = new testing_cli_1.RunCommand();
|
|
55
|
+
await runCommand.execute(args.testId, {
|
|
56
|
+
name: flags.name,
|
|
57
|
+
environment: flags.environment,
|
|
58
|
+
format: flags.format,
|
|
59
|
+
output: flags.output,
|
|
60
|
+
dryRun: flags['dry-run'],
|
|
61
|
+
verbose: flags.verbose,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
catch (error) {
|
|
65
|
+
this.error(error);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
exports.default = TestRun;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class TestSuite extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static args: {
|
|
6
|
+
suiteId: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
static flags: {
|
|
9
|
+
name: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
+
format: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
output: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
+
verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
};
|
|
14
|
+
run(): Promise<void>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const testing_cli_1 = require("@memberjunction/testing-cli");
|
|
5
|
+
class TestSuite extends core_1.Command {
|
|
6
|
+
static description = 'Execute a test suite';
|
|
7
|
+
static examples = [
|
|
8
|
+
'<%= config.bin %> <%= command.id %> <suite-id>',
|
|
9
|
+
'<%= config.bin %> <%= command.id %> --name="Agent Quality Suite"',
|
|
10
|
+
'<%= config.bin %> <%= command.id %> <suite-id> --format=json',
|
|
11
|
+
'<%= config.bin %> <%= command.id %> <suite-id> --output=suite-results.json',
|
|
12
|
+
];
|
|
13
|
+
static args = {
|
|
14
|
+
suiteId: core_1.Args.string({
|
|
15
|
+
description: 'Test suite ID to execute',
|
|
16
|
+
required: false,
|
|
17
|
+
}),
|
|
18
|
+
};
|
|
19
|
+
static flags = {
|
|
20
|
+
name: core_1.Flags.string({
|
|
21
|
+
char: 'n',
|
|
22
|
+
description: 'Test suite name to execute',
|
|
23
|
+
}),
|
|
24
|
+
format: core_1.Flags.string({
|
|
25
|
+
char: 'f',
|
|
26
|
+
description: 'Output format',
|
|
27
|
+
options: ['console', 'json', 'markdown'],
|
|
28
|
+
default: 'console',
|
|
29
|
+
}),
|
|
30
|
+
output: core_1.Flags.string({
|
|
31
|
+
char: 'o',
|
|
32
|
+
description: 'Output file path',
|
|
33
|
+
}),
|
|
34
|
+
verbose: core_1.Flags.boolean({
|
|
35
|
+
char: 'v',
|
|
36
|
+
description: 'Show detailed execution information',
|
|
37
|
+
default: false,
|
|
38
|
+
}),
|
|
39
|
+
};
|
|
40
|
+
async run() {
|
|
41
|
+
const { args, flags } = await this.parse(TestSuite);
|
|
42
|
+
try {
|
|
43
|
+
// Create SuiteCommand instance and execute
|
|
44
|
+
// Context user will be fetched internally after MJ provider initialization
|
|
45
|
+
const suiteCommand = new testing_cli_1.SuiteCommand();
|
|
46
|
+
await suiteCommand.execute(args.suiteId, {
|
|
47
|
+
name: flags.name,
|
|
48
|
+
format: flags.format,
|
|
49
|
+
output: flags.output,
|
|
50
|
+
verbose: flags.verbose,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
this.error(error);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.default = TestSuite;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class TestValidate extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static args: {
|
|
6
|
+
testId: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
static flags: {
|
|
9
|
+
all: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
type: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
'save-report': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
format: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
|
+
output: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
14
|
+
verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
15
|
+
};
|
|
16
|
+
run(): Promise<void>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const testing_cli_1 = require("@memberjunction/testing-cli");
|
|
5
|
+
class TestValidate extends core_1.Command {
|
|
6
|
+
static description = 'Validate test definitions without executing';
|
|
7
|
+
static examples = [
|
|
8
|
+
'<%= config.bin %> <%= command.id %> <test-id>',
|
|
9
|
+
'<%= config.bin %> <%= command.id %> --all',
|
|
10
|
+
'<%= config.bin %> <%= command.id %> --type=agent-eval',
|
|
11
|
+
'<%= config.bin %> <%= command.id %> --all --save-report',
|
|
12
|
+
'<%= config.bin %> <%= command.id %> --all --output=validation-report.md',
|
|
13
|
+
];
|
|
14
|
+
static args = {
|
|
15
|
+
testId: core_1.Args.string({
|
|
16
|
+
description: 'Test ID to validate',
|
|
17
|
+
required: false,
|
|
18
|
+
}),
|
|
19
|
+
};
|
|
20
|
+
static flags = {
|
|
21
|
+
all: core_1.Flags.boolean({
|
|
22
|
+
char: 'a',
|
|
23
|
+
description: 'Validate all tests',
|
|
24
|
+
default: false,
|
|
25
|
+
}),
|
|
26
|
+
type: core_1.Flags.string({
|
|
27
|
+
char: 't',
|
|
28
|
+
description: 'Validate tests by type',
|
|
29
|
+
}),
|
|
30
|
+
'save-report': core_1.Flags.boolean({
|
|
31
|
+
description: 'Save validation report to file',
|
|
32
|
+
default: false,
|
|
33
|
+
}),
|
|
34
|
+
format: core_1.Flags.string({
|
|
35
|
+
char: 'f',
|
|
36
|
+
description: 'Output format',
|
|
37
|
+
options: ['console', 'json', 'markdown'],
|
|
38
|
+
default: 'console',
|
|
39
|
+
}),
|
|
40
|
+
output: core_1.Flags.string({
|
|
41
|
+
char: 'o',
|
|
42
|
+
description: 'Output file path',
|
|
43
|
+
}),
|
|
44
|
+
verbose: core_1.Flags.boolean({
|
|
45
|
+
char: 'v',
|
|
46
|
+
description: 'Show detailed information',
|
|
47
|
+
default: false,
|
|
48
|
+
}),
|
|
49
|
+
};
|
|
50
|
+
async run() {
|
|
51
|
+
const { args, flags } = await this.parse(TestValidate);
|
|
52
|
+
try {
|
|
53
|
+
// Create ValidateCommand instance and execute
|
|
54
|
+
// Context user will be fetched internally after MJ provider initialization
|
|
55
|
+
const validateCommand = new testing_cli_1.ValidateCommand();
|
|
56
|
+
await validateCommand.execute(args.testId, {
|
|
57
|
+
all: flags.all,
|
|
58
|
+
type: flags.type,
|
|
59
|
+
saveReport: flags['save-report'],
|
|
60
|
+
format: flags.format,
|
|
61
|
+
output: flags.output,
|
|
62
|
+
verbose: flags.verbose,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
this.error(error);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
exports.default = TestValidate;
|
package/dist/config.d.ts
CHANGED
|
@@ -47,18 +47,22 @@ export declare const config: {
|
|
|
47
47
|
coreSchema: string;
|
|
48
48
|
mjRepoUrl: string;
|
|
49
49
|
} | undefined;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
50
|
+
/**
|
|
51
|
+
* Get validated config for commands that require database connection.
|
|
52
|
+
* Throws error if config is invalid.
|
|
53
|
+
*/
|
|
54
|
+
export declare const getValidatedConfig: () => MJConfig;
|
|
55
|
+
/**
|
|
56
|
+
* Get optional config for commands that don't require database connection.
|
|
57
|
+
* Returns undefined if no config exists, or partial config if it exists.
|
|
58
|
+
*/
|
|
59
|
+
export declare const getOptionalConfig: () => Partial<MJConfig> | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* Legacy function for backward compatibility with codegen.
|
|
62
|
+
* Validates and returns updated config.
|
|
63
|
+
* Returns undefined silently if config is invalid (command will handle the error).
|
|
64
|
+
*/
|
|
65
|
+
export declare const updatedConfig: () => MJConfig | undefined;
|
|
62
66
|
export declare const createFlywayUrl: (mjConfig: MJConfig) => string;
|
|
63
67
|
export declare const getFlywayConfig: (mjConfig: MJConfig, tag?: string) => Promise<FlywayConfig>;
|
|
64
68
|
export {};
|