@memberjunction/cli 5.37.0 → 5.38.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 +74 -0
- package/dist/baseline/cli-helpers.d.ts +12 -0
- package/dist/baseline/cli-helpers.d.ts.map +1 -0
- package/dist/baseline/cli-helpers.js +40 -0
- package/dist/baseline/cli-helpers.js.map +1 -0
- package/dist/baseline/comparator.d.ts +26 -0
- package/dist/baseline/comparator.d.ts.map +1 -0
- package/dist/baseline/comparator.js +527 -0
- package/dist/baseline/comparator.js.map +1 -0
- package/dist/baseline/connection.d.ts +39 -0
- package/dist/baseline/connection.d.ts.map +1 -0
- package/dist/baseline/connection.js +104 -0
- package/dist/baseline/connection.js.map +1 -0
- package/dist/baseline/data-dumper.d.ts +23 -0
- package/dist/baseline/data-dumper.d.ts.map +1 -0
- package/dist/baseline/data-dumper.js +94 -0
- package/dist/baseline/data-dumper.js.map +1 -0
- package/dist/baseline/emitter.d.ts +36 -0
- package/dist/baseline/emitter.d.ts.map +1 -0
- package/dist/baseline/emitter.js +512 -0
- package/dist/baseline/emitter.js.map +1 -0
- package/dist/baseline/index.d.ts +18 -0
- package/dist/baseline/index.d.ts.map +1 -0
- package/dist/baseline/index.js +14 -0
- package/dist/baseline/index.js.map +1 -0
- package/dist/baseline/introspector-mssql.d.ts +15 -0
- package/dist/baseline/introspector-mssql.d.ts.map +1 -0
- package/dist/baseline/introspector-mssql.js +673 -0
- package/dist/baseline/introspector-mssql.js.map +1 -0
- package/dist/baseline/introspector-postgres.d.ts +14 -0
- package/dist/baseline/introspector-postgres.d.ts.map +1 -0
- package/dist/baseline/introspector-postgres.js +277 -0
- package/dist/baseline/introspector-postgres.js.map +1 -0
- package/dist/baseline/report.d.ts +7 -0
- package/dist/baseline/report.d.ts.map +1 -0
- package/dist/baseline/report.js +105 -0
- package/dist/baseline/report.js.map +1 -0
- package/dist/baseline/types.d.ts +286 -0
- package/dist/baseline/types.d.ts.map +1 -0
- package/dist/baseline/types.js +10 -0
- package/dist/baseline/types.js.map +1 -0
- package/dist/baseline/util.d.ts +112 -0
- package/dist/baseline/util.d.ts.map +1 -0
- package/dist/baseline/util.js +325 -0
- package/dist/baseline/util.js.map +1 -0
- package/dist/commands/baseline/build.d.ts +29 -0
- package/dist/commands/baseline/build.d.ts.map +1 -0
- package/dist/commands/baseline/build.js +188 -0
- package/dist/commands/baseline/build.js.map +1 -0
- package/dist/commands/baseline/compare.d.ts +19 -0
- package/dist/commands/baseline/compare.d.ts.map +1 -0
- package/dist/commands/baseline/compare.js +133 -0
- package/dist/commands/baseline/compare.js.map +1 -0
- package/dist/commands/baseline/roundtrip.d.ts +23 -0
- package/dist/commands/baseline/roundtrip.d.ts.map +1 -0
- package/dist/commands/baseline/roundtrip.js +245 -0
- package/dist/commands/baseline/roundtrip.js.map +1 -0
- package/dist/commands/test/compare.d.ts +3 -0
- package/dist/commands/test/compare.d.ts.map +1 -1
- package/dist/commands/test/compare.js +23 -3
- package/dist/commands/test/compare.js.map +1 -1
- package/dist/commands/test/regression/build.d.ts +14 -0
- package/dist/commands/test/regression/build.d.ts.map +1 -0
- package/dist/commands/test/regression/build.js +48 -0
- package/dist/commands/test/regression/build.js.map +1 -0
- package/dist/commands/test/regression/compare.d.ts +15 -0
- package/dist/commands/test/regression/compare.d.ts.map +1 -0
- package/dist/commands/test/regression/compare.js +66 -0
- package/dist/commands/test/regression/compare.js.map +1 -0
- package/dist/commands/test/regression/down.d.ts +10 -0
- package/dist/commands/test/regression/down.d.ts.map +1 -0
- package/dist/commands/test/regression/down.js +29 -0
- package/dist/commands/test/regression/down.js.map +1 -0
- package/dist/commands/test/regression/export.d.ts +11 -0
- package/dist/commands/test/regression/export.d.ts.map +1 -0
- package/dist/commands/test/regression/export.js +56 -0
- package/dist/commands/test/regression/export.js.map +1 -0
- package/dist/commands/test/regression/gen-forms.d.ts +7 -0
- package/dist/commands/test/regression/gen-forms.d.ts.map +1 -0
- package/dist/commands/test/regression/gen-forms.js +18 -0
- package/dist/commands/test/regression/gen-forms.js.map +1 -0
- package/dist/commands/test/regression/index.d.ts +7 -0
- package/dist/commands/test/regression/index.d.ts.map +1 -0
- package/dist/commands/test/regression/index.js +33 -0
- package/dist/commands/test/regression/index.js.map +1 -0
- package/dist/commands/test/regression/init.d.ts +21 -0
- package/dist/commands/test/regression/init.d.ts.map +1 -0
- package/dist/commands/test/regression/init.js +111 -0
- package/dist/commands/test/regression/init.js.map +1 -0
- package/dist/commands/test/regression/remote.d.ts +23 -0
- package/dist/commands/test/regression/remote.d.ts.map +1 -0
- package/dist/commands/test/regression/remote.js +140 -0
- package/dist/commands/test/regression/remote.js.map +1 -0
- package/dist/commands/test/regression/up.d.ts +21 -0
- package/dist/commands/test/regression/up.d.ts.map +1 -0
- package/dist/commands/test/regression/up.js +111 -0
- package/dist/commands/test/regression/up.js.map +1 -0
- package/dist/commands/test/run.d.ts +1 -0
- package/dist/commands/test/run.d.ts.map +1 -1
- package/dist/commands/test/run.js +6 -0
- package/dist/commands/test/run.js.map +1 -1
- package/dist/commands/test/suite.d.ts +5 -0
- package/dist/commands/test/suite.d.ts.map +1 -1
- package/dist/commands/test/suite.js +27 -0
- package/dist/commands/test/suite.js.map +1 -1
- package/dist/commands/translate-sql/index.d.ts.map +1 -1
- package/dist/commands/translate-sql/index.js +3 -2
- package/dist/commands/translate-sql/index.js.map +1 -1
- package/dist/init-templates/bring-your-own-app/README.md +74 -0
- package/dist/init-templates/bring-your-own-app/byo-metadata/.mj-sync.json +10 -0
- package/dist/init-templates/bring-your-own-app/byo-metadata/test-suites/.byo-suite.json +51 -0
- package/dist/init-templates/bring-your-own-app/byo-metadata/test-suites/.mj-sync.json +12 -0
- package/dist/init-templates/bring-your-own-app/byo-metadata/tests/.T01-counter-increment.json +63 -0
- package/dist/init-templates/bring-your-own-app/byo-metadata/tests/.T02-contact-form-submit.json +63 -0
- package/dist/init-templates/bring-your-own-app/byo-metadata/tests/.mj-sync.json +12 -0
- package/dist/init-templates/bring-your-own-app/docker-compose.app.yml +76 -0
- package/dist/init-templates/bring-your-own-app/target.json +23 -0
- package/dist/init-templates/generic-web/README.md +115 -0
- package/dist/init-templates/generic-web/metadata/.mj-sync.json +10 -0
- package/dist/init-templates/generic-web/metadata/test-suites/.generic-web-suite.json +48 -0
- package/dist/init-templates/generic-web/metadata/test-suites/.mj-sync.json +12 -0
- package/dist/init-templates/generic-web/metadata/tests/.GW01-home-loads.json +74 -0
- package/dist/init-templates/generic-web/metadata/tests/.GW02-search-array-map.json +82 -0
- package/dist/init-templates/generic-web/metadata/tests/.mj-sync.json +12 -0
- package/dist/init-templates/generic-web/oracles/mdn-oracles.cjs +121 -0
- package/dist/init-templates/generic-web/target.json +25 -0
- package/dist/init-templates/github-actions/README.md +26 -0
- package/dist/init-templates/github-actions/regression.yml +52 -0
- package/dist/init-templates/remote-mj/README.md +95 -0
- package/dist/init-templates/remote-mj/target.json +22 -0
- package/dist/init-templates/static-file-server/Dockerfile +23 -0
- package/dist/init-templates/static-file-server/README.md +88 -0
- package/dist/init-templates/static-file-server/docker-compose.app.yml +44 -0
- package/dist/init-templates/static-file-server/metadata/.mj-sync.json +10 -0
- package/dist/init-templates/static-file-server/metadata/test-suites/.mj-sync.json +12 -0
- package/dist/init-templates/static-file-server/metadata/test-suites/.static-server-suite.json +27 -0
- package/dist/init-templates/static-file-server/metadata/tests/.SS01-home-loads.json +45 -0
- package/dist/init-templates/static-file-server/metadata/tests/.SS02-navigate-about.json +45 -0
- package/dist/init-templates/static-file-server/metadata/tests/.mj-sync.json +12 -0
- package/dist/init-templates/static-file-server/public/about.html +12 -0
- package/dist/init-templates/static-file-server/public/index.html +27 -0
- package/dist/init-templates/static-file-server/target.json +16 -0
- package/dist/lib/regression/docker-helpers.d.ts +98 -0
- package/dist/lib/regression/docker-helpers.d.ts.map +1 -0
- package/dist/lib/regression/docker-helpers.js +184 -0
- package/dist/lib/regression/docker-helpers.js.map +1 -0
- package/oclif.manifest.json +1356 -509
- package/package.json +22 -17
- package/regression-compose/docker-compose.bacpac-standalone.yml +109 -0
- package/regression-compose/docker-compose.standalone.yml +50 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Command, Flags } from '@oclif/core';
|
|
2
|
+
import { isInsideMonorepo, spawnInherit } from '../../../lib/regression/docker-helpers.js';
|
|
3
|
+
const REGRESSION_RESULTS_DIR = 'docker/regression/test-results';
|
|
4
|
+
const EXTERNAL_RESULTS_DIR = 'test-results';
|
|
5
|
+
export default class TestRegressionCompare extends Command {
|
|
6
|
+
static { this.description = 'Diff the two most recent regression runs from docker/regression/test-results/. ' +
|
|
7
|
+
'Thin alias for `mj test compare --from-json <dir>` that handles the path.'; }
|
|
8
|
+
static { this.examples = [
|
|
9
|
+
'<%= config.bin %> <%= command.id %>',
|
|
10
|
+
'<%= config.bin %> <%= command.id %> --diff-only',
|
|
11
|
+
'<%= config.bin %> <%= command.id %> --format=markdown --output=delta.md',
|
|
12
|
+
]; }
|
|
13
|
+
static { this.strict = false; }
|
|
14
|
+
static { this.flags = {
|
|
15
|
+
'diff-only': Flags.boolean({
|
|
16
|
+
description: 'Show only differences.',
|
|
17
|
+
default: false,
|
|
18
|
+
}),
|
|
19
|
+
format: Flags.string({
|
|
20
|
+
char: 'f',
|
|
21
|
+
description: 'Output format.',
|
|
22
|
+
options: ['console', 'json', 'markdown'],
|
|
23
|
+
default: 'console',
|
|
24
|
+
}),
|
|
25
|
+
output: Flags.string({
|
|
26
|
+
char: 'o',
|
|
27
|
+
description: 'Output file path.',
|
|
28
|
+
}),
|
|
29
|
+
verbose: Flags.boolean({
|
|
30
|
+
description: 'Show detailed information.',
|
|
31
|
+
default: false,
|
|
32
|
+
}),
|
|
33
|
+
tag: Flags.string({
|
|
34
|
+
description: 'Filter suite runs by tag. Compares the two most recent runs whose Tags array ' +
|
|
35
|
+
'contains the tag — useful when an archive MJ holds runs from multiple environments.',
|
|
36
|
+
}),
|
|
37
|
+
}; }
|
|
38
|
+
async run() {
|
|
39
|
+
const { flags } = await this.parse(TestRegressionCompare);
|
|
40
|
+
// Results live under docker/regression/test-results in the monorepo, or
|
|
41
|
+
// ./test-results when running externally (where remote/up wrote them).
|
|
42
|
+
const resultsDir = isInsideMonorepo() ? REGRESSION_RESULTS_DIR : EXTERNAL_RESULTS_DIR;
|
|
43
|
+
// --tag flips us to DB mode (results.json doesn't carry Tags), so drop
|
|
44
|
+
// --from-json when the user asks for tag filtering.
|
|
45
|
+
const args = ['test', 'compare'];
|
|
46
|
+
if (!flags.tag) {
|
|
47
|
+
args.push('--from-json', resultsDir);
|
|
48
|
+
}
|
|
49
|
+
if (flags.tag)
|
|
50
|
+
args.push('--tag', flags.tag);
|
|
51
|
+
if (flags['diff-only'])
|
|
52
|
+
args.push('--diff-only');
|
|
53
|
+
if (flags.format && flags.format !== 'console')
|
|
54
|
+
args.push('--format', flags.format);
|
|
55
|
+
if (flags.output)
|
|
56
|
+
args.push('--output', flags.output);
|
|
57
|
+
if (flags.verbose)
|
|
58
|
+
args.push('--verbose');
|
|
59
|
+
// Re-invoke the same `mj` binary. argv[1] is the entry script path.
|
|
60
|
+
const mjBin = process.argv[1] ?? 'mj';
|
|
61
|
+
const code = await spawnInherit(process.execPath, [mjBin, ...args]);
|
|
62
|
+
if (code !== 0)
|
|
63
|
+
this.exit(code);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=compare.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compare.js","sourceRoot":"","sources":["../../../../src/commands/test/regression/compare.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AAE3F,MAAM,sBAAsB,GAAG,gCAAgC,CAAC;AAChE,MAAM,oBAAoB,GAAG,cAAc,CAAC;AAE5C,MAAM,CAAC,OAAO,OAAO,qBA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,CAAC;QACD,IAAI,KAAK,CAAC,GAAG;YAAE,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;QAC7C,IAAI,KAAK,CAAC,WAAW,CAAC;YAAE,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACjD,IAAI,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,MAAM,KAAK,SAAS;YAAE,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QACpF,IAAI,KAAK,CAAC,MAAM;YAAE,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QACtD,IAAI,KAAK,CAAC,OAAO;YAAE,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAE1C,oEAAoE;QACpE,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;QACtC,MAAM,IAAI,GAAG,MAAM,YAAY,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC;QACpE,IAAI,IAAI,KAAK,CAAC;YAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class TestRegressionDown extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
'keep-volumes': import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
7
|
+
};
|
|
8
|
+
run(): Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=down.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"down.d.ts","sourceRoot":"","sources":["../../../../src/commands/test/regression/down.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAO7C,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,OAAO;IACrD,MAAM,CAAC,WAAW,SAC0D;IAE5E,MAAM,CAAC,QAAQ,WAGb;IAEF,MAAM,CAAC,KAAK;;MAKV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAa3B"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Command, Flags } from '@oclif/core';
|
|
2
|
+
import { dockerComposeArgs, requireMonorepoRoot, spawnInherit, } from '../../../lib/regression/docker-helpers.js';
|
|
3
|
+
export default class TestRegressionDown extends Command {
|
|
4
|
+
static { this.description = 'Stop the regression stack and wipe DB volumes (docker compose down -v).'; }
|
|
5
|
+
static { this.examples = [
|
|
6
|
+
'<%= config.bin %> <%= command.id %>',
|
|
7
|
+
'<%= config.bin %> <%= command.id %> --keep-volumes',
|
|
8
|
+
]; }
|
|
9
|
+
static { this.flags = {
|
|
10
|
+
'keep-volumes': Flags.boolean({
|
|
11
|
+
description: 'Skip the `-v` flag — preserves the ephemeral DB volume.',
|
|
12
|
+
default: false,
|
|
13
|
+
}),
|
|
14
|
+
}; }
|
|
15
|
+
async run() {
|
|
16
|
+
const { flags } = await this.parse(TestRegressionDown);
|
|
17
|
+
requireMonorepoRoot();
|
|
18
|
+
// Use `--profile *` so compose tears down services in every profile,
|
|
19
|
+
// not just the active one. Otherwise `down` leaves orphan containers
|
|
20
|
+
// from a profile we haven't named.
|
|
21
|
+
const composeArgs = dockerComposeArgs(undefined, ['--profile', '*', 'down']);
|
|
22
|
+
if (!flags['keep-volumes'])
|
|
23
|
+
composeArgs.push('-v');
|
|
24
|
+
const code = await spawnInherit('docker', composeArgs);
|
|
25
|
+
if (code !== 0)
|
|
26
|
+
this.exit(code);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=down.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"down.js","sourceRoot":"","sources":["../../../../src/commands/test/regression/down.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,YAAY,GACb,MAAM,2CAA2C,CAAC;AAEnD,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,OAAO;aAC9C,gBAAW,GAChB,yEAAyE,CAAC;aAErE,aAAQ,GAAG;QAChB,qCAAqC;QACrC,oDAAoD;KACrD,CAAC;aAEK,UAAK,GAAG;QACb,cAAc,EAAE,KAAK,CAAC,OAAO,CAAC;YAC5B,WAAW,EAAE,yDAAyD;YACtE,OAAO,EAAE,KAAK;SACf,CAAC;KACH,CAAC;IAEF,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;QACvD,mBAAmB,EAAE,CAAC;QAEtB,qEAAqE;QACrE,qEAAqE;QACrE,mCAAmC;QACnC,MAAM,WAAW,GAAG,iBAAiB,CAAC,SAAS,EAAE,CAAC,WAAW,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC;QAC7E,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC;YAAE,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEnD,MAAM,IAAI,GAAG,MAAM,YAAY,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;QACvD,IAAI,IAAI,KAAK,CAAC;YAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class TestRegressionExport extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
run: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
7
|
+
image: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
8
|
+
};
|
|
9
|
+
run(): Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=export.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export.d.ts","sourceRoot":"","sources":["../../../../src/commands/test/regression/export.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAY7C,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,OAAO;IACvD,MAAM,CAAC,WAAW,SAGsC;IAExD,MAAM,CAAC,QAAQ,WAIb;IAEF,MAAM,CAAC,KAAK;;;MAUV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAiC3B"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Command, Flags } from '@oclif/core';
|
|
2
|
+
import { existsSync } from 'node:fs';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { AGENTIC_TEST_RUNNER_IMAGE, dockerRunArgs, INLINE_REPORT_SCRIPT, isInsideMonorepo, RESULTS_DIR, spawnInherit, } from '../../../lib/regression/docker-helpers.js';
|
|
5
|
+
export default class TestRegressionExport extends Command {
|
|
6
|
+
static { this.description = 'Export a regression run\'s HTML report as a single self-contained file ' +
|
|
7
|
+
'(screenshots inlined as base64), producing report.standalone.html. ' +
|
|
8
|
+
'Portable for sharing or attaching as a CI artifact.'; }
|
|
9
|
+
static { this.examples = [
|
|
10
|
+
'<%= config.bin %> <%= command.id %>',
|
|
11
|
+
'<%= config.bin %> <%= command.id %> --run=run-20260526T220118Z',
|
|
12
|
+
'<%= config.bin %> <%= command.id %> --run=./some/other/run-dir',
|
|
13
|
+
]; }
|
|
14
|
+
static { this.flags = {
|
|
15
|
+
run: Flags.string({
|
|
16
|
+
char: 'r',
|
|
17
|
+
description: 'Which run to export. A folder name (under test-results/) or a path. Defaults to the latest run.',
|
|
18
|
+
}),
|
|
19
|
+
image: Flags.string({
|
|
20
|
+
description: '(external) Published image used to inline reports. Default: ' + AGENTIC_TEST_RUNNER_IMAGE + '.',
|
|
21
|
+
}),
|
|
22
|
+
}; }
|
|
23
|
+
async run() {
|
|
24
|
+
const { flags } = await this.parse(TestRegressionExport);
|
|
25
|
+
if (isInsideMonorepo()) {
|
|
26
|
+
// On-disk inline-report.cjs against docker/regression/test-results.
|
|
27
|
+
if (!existsSync(INLINE_REPORT_SCRIPT))
|
|
28
|
+
this.error(`✗ Exporter missing: ${INLINE_REPORT_SCRIPT}`);
|
|
29
|
+
const args = [INLINE_REPORT_SCRIPT];
|
|
30
|
+
if (flags.run) {
|
|
31
|
+
const runDir = flags.run.includes('/') || path.isAbsolute(flags.run)
|
|
32
|
+
? path.resolve(flags.run)
|
|
33
|
+
: path.resolve(RESULTS_DIR, flags.run);
|
|
34
|
+
if (!existsSync(runDir))
|
|
35
|
+
this.error(`✗ Run directory not found: ${runDir}`);
|
|
36
|
+
args.push(runDir);
|
|
37
|
+
}
|
|
38
|
+
const code = await spawnInherit(process.execPath, args);
|
|
39
|
+
if (code !== 0)
|
|
40
|
+
this.exit(code);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
// External: run the image's `export` subcommand against the mounted run dir.
|
|
44
|
+
// Results live under ./test-results; mount it and resolve the run inside the container.
|
|
45
|
+
const image = flags.image ?? AGENTIC_TEST_RUNNER_IMAGE;
|
|
46
|
+
const resultsDir = path.resolve('test-results');
|
|
47
|
+
if (!existsSync(resultsDir))
|
|
48
|
+
this.error(`✗ No ./test-results directory found to export from.`);
|
|
49
|
+
const runArg = flags.run ? `/app/test-results/${path.basename(flags.run)}` : '/app/test-results/latest';
|
|
50
|
+
this.log(`▶ docker run ${image} export ${runArg}`);
|
|
51
|
+
const code = await spawnInherit('docker', dockerRunArgs(image, ['export', runArg], { mounts: [[resultsDir, '/app/test-results']] }));
|
|
52
|
+
if (code !== 0)
|
|
53
|
+
this.exit(code);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=export.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export.js","sourceRoot":"","sources":["../../../../src/commands/test/regression/export.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EACL,yBAAyB,EACzB,aAAa,EACb,oBAAoB,EACpB,gBAAgB,EAChB,WAAW,EACX,YAAY,GACb,MAAM,2CAA2C,CAAC;AAEnD,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,OAAO;aAChD,gBAAW,GAChB,yEAAyE;QACzE,qEAAqE;QACrE,qDAAqD,CAAC;aAEjD,aAAQ,GAAG;QAChB,qCAAqC;QACrC,gEAAgE;QAChE,gEAAgE;KACjE,CAAC;aAEK,UAAK,GAAG;QACb,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC;YAChB,IAAI,EAAE,GAAG;YACT,WAAW,EACT,iGAAiG;SACpG,CAAC;QACF,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC;YAClB,WAAW,EACT,8DAA8D,GAAG,yBAAyB,GAAG,GAAG;SACnG,CAAC;KACH,CAAC;IAEF,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;QAEzD,IAAI,gBAAgB,EAAE,EAAE,CAAC;YACvB,oEAAoE;YACpE,IAAI,CAAC,UAAU,CAAC,oBAAoB,CAAC;gBAAE,IAAI,CAAC,KAAK,CAAC,uBAAuB,oBAAoB,EAAE,CAAC,CAAC;YACjG,MAAM,IAAI,GAAG,CAAC,oBAAoB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AAa,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,UAAU,EAAE,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAC1F,CAAC;QACF,IAAI,IAAI,KAAK,CAAC;YAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gen-forms.d.ts","sourceRoot":"","sources":["../../../../src/commands/test/regression/gen-forms.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAQtC,MAAM,CAAC,OAAO,OAAO,sBAAuB,SAAQ,OAAO;IACzD,MAAM,CAAC,WAAW,SAEiD;IAEnE,MAAM,CAAC,QAAQ,WAA2C;IAEpD,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAS3B"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
import { existsSync } from 'node:fs';
|
|
3
|
+
import { GEN_FORMS_SCRIPT, requireMonorepoRoot, spawnInherit, } from '../../../lib/regression/docker-helpers.js';
|
|
4
|
+
export default class TestRegressionGenForms extends Command {
|
|
5
|
+
static { this.description = 'Regenerate Angular entity forms used by the regression MJExplorer image. ' +
|
|
6
|
+
'Slow (~5 min) — only required after schema or codegen changes.'; }
|
|
7
|
+
static { this.examples = ['<%= config.bin %> <%= command.id %>']; }
|
|
8
|
+
async run() {
|
|
9
|
+
requireMonorepoRoot();
|
|
10
|
+
if (!existsSync(GEN_FORMS_SCRIPT)) {
|
|
11
|
+
this.error(`✗ ${GEN_FORMS_SCRIPT} not found. Verify the docker/regression/ directory is intact.`);
|
|
12
|
+
}
|
|
13
|
+
const code = await spawnInherit('bash', [GEN_FORMS_SCRIPT]);
|
|
14
|
+
if (code !== 0)
|
|
15
|
+
this.exit(code);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=gen-forms.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gen-forms.js","sourceRoot":"","sources":["../../../../src/commands/test/regression/gen-forms.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,YAAY,GACb,MAAM,2CAA2C,CAAC;AAEnD,MAAM,CAAC,OAAO,OAAO,sBAAuB,SAAQ,OAAO;aAClD,gBAAW,GAChB,2EAA2E;QAC3E,gEAAgE,CAAC;aAE5D,aAAQ,GAAG,CAAC,qCAAqC,CAAC,CAAC;IAE1D,KAAK,CAAC,GAAG;QACP,mBAAmB,EAAE,CAAC;QACtB,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE,CAAC;YAClC,IAAI,CAAC,KAAK,CAAC,KAAK,gBAAgB,gEAAgE,CAAC,CAAC;QACpG,CAAC;QAED,MAAM,IAAI,GAAG,MAAM,YAAY,CAAC,MAAM,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC;QAC5D,IAAI,IAAI,KAAK,CAAC;YAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/test/regression/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,OAAO;IACjD,MAAM,CAAC,WAAW,SAC4D;IAE9E,MAAM,CAAC,QAAQ,WASb;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAkB3B"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class TestRegression extends Command {
|
|
3
|
+
static { this.description = 'MJ Explorer regression test suite — Docker-based LLM-driven browser tests'; }
|
|
4
|
+
static { this.examples = [
|
|
5
|
+
'<%= config.bin %> <%= command.id %> build # Build images (incl. gen-forms on first run)',
|
|
6
|
+
'<%= config.bin %> <%= command.id %> up # Run the full self-contained MJ stack (Mode A)',
|
|
7
|
+
'<%= config.bin %> <%= command.id %> down # Tear down + wipe DB volumes',
|
|
8
|
+
'<%= config.bin %> <%= command.id %> gen-forms # Regenerate Angular entity forms',
|
|
9
|
+
'<%= config.bin %> <%= command.id %> compare # Diff the two most recent runs',
|
|
10
|
+
'<%= config.bin %> <%= command.id %> export # Export a run as a portable standalone HTML',
|
|
11
|
+
'<%= config.bin %> <%= command.id %> remote --target=staging-mj # Mode B/C/D against a remote URL',
|
|
12
|
+
'<%= config.bin %> <%= command.id %> init generic-web # Scaffold one of the example dirs',
|
|
13
|
+
]; }
|
|
14
|
+
async run() {
|
|
15
|
+
this.log('MJ Explorer Regression Test Suite\n');
|
|
16
|
+
this.log('Available subcommands:');
|
|
17
|
+
this.log(' mj test regression build Build Docker images for the regression stack');
|
|
18
|
+
this.log(' mj test regression up Run the self-contained MJ stack (Mode A)');
|
|
19
|
+
this.log(' mj test regression down Stop the stack and wipe DB volumes');
|
|
20
|
+
this.log(' mj test regression gen-forms One-shot: regenerate Angular entity forms');
|
|
21
|
+
this.log(' mj test regression compare Compare the two most recent run-*/results.json');
|
|
22
|
+
this.log(' mj test regression export Export a run as a portable standalone HTML report');
|
|
23
|
+
this.log(' mj test regression remote --target=X Run against a remote URL (Mode B/C/D)');
|
|
24
|
+
this.log(' mj test regression init <name> Scaffold a starter example into the cwd');
|
|
25
|
+
this.log('');
|
|
26
|
+
this.log('Most subcommands shell out to docker compose using the regression stack at');
|
|
27
|
+
this.log('docker/regression/. `init` works both inside the monorepo (copies locally) and');
|
|
28
|
+
this.log('outside (shells out to the published memberjunction/agentic-test-runner image).');
|
|
29
|
+
this.log('');
|
|
30
|
+
this.log('Run "mj test regression COMMAND --help" for details on each subcommand.');
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/commands/test/regression/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,OAAO;aAC1C,gBAAW,GAChB,2EAA2E,CAAC;aAEvE,aAAQ,GAAG;QAChB,8FAA8F;QAC9F,gGAAgG;QAChG,8EAA8E;QAC9E,kFAAkF;QAClF,gFAAgF;QAChF,6FAA6F;QAC7F,mGAAmG;QACnG,oGAAoG;KACrG,CAAC;IAEF,KAAK,CAAC,GAAG;QACP,IAAI,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAC;QAChD,IAAI,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;QACnC,IAAI,CAAC,GAAG,CAAC,sFAAsF,CAAC,CAAC;QACjG,IAAI,CAAC,GAAG,CAAC,kFAAkF,CAAC,CAAC;QAC7F,IAAI,CAAC,GAAG,CAAC,4EAA4E,CAAC,CAAC;QACvF,IAAI,CAAC,GAAG,CAAC,mFAAmF,CAAC,CAAC;QAC9F,IAAI,CAAC,GAAG,CAAC,wFAAwF,CAAC,CAAC;QACnG,IAAI,CAAC,GAAG,CAAC,2FAA2F,CAAC,CAAC;QACtG,IAAI,CAAC,GAAG,CAAC,+EAA+E,CAAC,CAAC;QAC1F,IAAI,CAAC,GAAG,CAAC,iFAAiF,CAAC,CAAC;QAC5F,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACb,IAAI,CAAC,GAAG,CAAC,4EAA4E,CAAC,CAAC;QACvF,IAAI,CAAC,GAAG,CAAC,gFAAgF,CAAC,CAAC;QAC3F,IAAI,CAAC,GAAG,CAAC,iFAAiF,CAAC,CAAC;QAC5F,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACb,IAAI,CAAC,GAAG,CAAC,yEAAyE,CAAC,CAAC;IACtF,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class TestRegressionInit extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static args: {
|
|
6
|
+
name: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
7
|
+
};
|
|
8
|
+
static flags: {
|
|
9
|
+
list: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
};
|
|
11
|
+
run(): Promise<void>;
|
|
12
|
+
private listTemplates;
|
|
13
|
+
/**
|
|
14
|
+
* Pluck the first non-heading line from a README.md to use as a one-line
|
|
15
|
+
* description in the inventory. Returns undefined when the README is
|
|
16
|
+
* missing or only contains headings.
|
|
17
|
+
*/
|
|
18
|
+
private firstNonHeadingLine;
|
|
19
|
+
private scaffold;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=init.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../src/commands/test/regression/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,OAAO,EAAS,MAAM,aAAa,CAAC;AAcnD,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,OAAO;IACrD,MAAM,CAAC,WAAW,SAG+E;IAEjG,MAAM,CAAC,QAAQ,WAMb;IAEF,MAAM,CAAC,IAAI;;MAKT;IAEF,MAAM,CAAC,KAAK;;MAKV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IAe1B,OAAO,CAAC,aAAa;IAqBrB;;;;OAIG;IACH,OAAO,CAAC,mBAAmB;IAe3B,OAAO,CAAC,QAAQ;CA+BjB"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { Args, Command, Flags } from '@oclif/core';
|
|
2
|
+
import { existsSync, readdirSync, readFileSync, statSync, mkdirSync, cpSync } from 'node:fs';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
// Templates live at the package root (not under src/commands/, which oclif
|
|
6
|
+
// recursively scans as commands).
|
|
7
|
+
// dev: packages/MJCLI/src/init-templates/<name>/
|
|
8
|
+
// dist: packages/MJCLI/dist/init-templates/<name>/ (copy-regression-assets.mjs)
|
|
9
|
+
// From this command file at <pkg>/{src,dist}/commands/test/regression/init.{ts,js},
|
|
10
|
+
// the package's {src,dist}/ root is three directories up.
|
|
11
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
12
|
+
const TEMPLATES_DIR = path.join(__dirname, '..', '..', '..', 'init-templates');
|
|
13
|
+
export default class TestRegressionInit extends Command {
|
|
14
|
+
static { this.description = 'Scaffold one of the bundled regression-suite mode templates into the current directory. ' +
|
|
15
|
+
'Adapt the generated files (target profile + optional compose overlay + tests) to point at ' +
|
|
16
|
+
'your app, then run `mj test regression remote --target=...` to execute the suite against it.'; }
|
|
17
|
+
static { this.examples = [
|
|
18
|
+
'<%= config.bin %> <%= command.id %> generic-web',
|
|
19
|
+
'<%= config.bin %> <%= command.id %> static-file-server',
|
|
20
|
+
'<%= config.bin %> <%= command.id %> remote-mj',
|
|
21
|
+
'<%= config.bin %> <%= command.id %> bring-your-own-app',
|
|
22
|
+
'<%= config.bin %> <%= command.id %> --list',
|
|
23
|
+
]; }
|
|
24
|
+
static { this.args = {
|
|
25
|
+
name: Args.string({
|
|
26
|
+
description: 'Template name to scaffold (run with --list to see available).',
|
|
27
|
+
required: false,
|
|
28
|
+
}),
|
|
29
|
+
}; }
|
|
30
|
+
static { this.flags = {
|
|
31
|
+
list: Flags.boolean({
|
|
32
|
+
description: 'List available templates and exit.',
|
|
33
|
+
default: false,
|
|
34
|
+
}),
|
|
35
|
+
}; }
|
|
36
|
+
async run() {
|
|
37
|
+
const { args, flags } = await this.parse(TestRegressionInit);
|
|
38
|
+
if (flags.list) {
|
|
39
|
+
this.listTemplates();
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
if (!args.name) {
|
|
43
|
+
this.error('✗ Missing template name. Run with --list to see available templates.');
|
|
44
|
+
}
|
|
45
|
+
this.scaffold(args.name);
|
|
46
|
+
}
|
|
47
|
+
listTemplates() {
|
|
48
|
+
if (!existsSync(TEMPLATES_DIR)) {
|
|
49
|
+
this.error(`✗ Templates directory missing at ${TEMPLATES_DIR}. ` +
|
|
50
|
+
`Reinstall @memberjunction/cli — published bundles include init-templates/.`);
|
|
51
|
+
}
|
|
52
|
+
const entries = readdirSync(TEMPLATES_DIR, { withFileTypes: true })
|
|
53
|
+
.filter((d) => d.isDirectory())
|
|
54
|
+
.map((d) => d.name)
|
|
55
|
+
.sort();
|
|
56
|
+
this.log(`Available templates (${entries.length}):`);
|
|
57
|
+
for (const name of entries) {
|
|
58
|
+
const readme = path.join(TEMPLATES_DIR, name, 'README.md');
|
|
59
|
+
const oneLiner = this.firstNonHeadingLine(readme);
|
|
60
|
+
this.log(` ${name.padEnd(24)} ${oneLiner ?? ''}`);
|
|
61
|
+
}
|
|
62
|
+
this.log('');
|
|
63
|
+
this.log(`Scaffold one with: mj test regression init <name>`);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Pluck the first non-heading line from a README.md to use as a one-line
|
|
67
|
+
* description in the inventory. Returns undefined when the README is
|
|
68
|
+
* missing or only contains headings.
|
|
69
|
+
*/
|
|
70
|
+
firstNonHeadingLine(readmePath) {
|
|
71
|
+
if (!existsSync(readmePath))
|
|
72
|
+
return undefined;
|
|
73
|
+
try {
|
|
74
|
+
const content = readFileSync(readmePath, 'utf8');
|
|
75
|
+
for (const raw of content.split('\n')) {
|
|
76
|
+
const line = raw.trim();
|
|
77
|
+
if (!line || line.startsWith('#') || line.startsWith('```'))
|
|
78
|
+
continue;
|
|
79
|
+
return line.replace(/[*_`]/g, '').slice(0, 80);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
catch {
|
|
83
|
+
// ignore
|
|
84
|
+
}
|
|
85
|
+
return undefined;
|
|
86
|
+
}
|
|
87
|
+
scaffold(name) {
|
|
88
|
+
const src = path.join(TEMPLATES_DIR, name);
|
|
89
|
+
if (!existsSync(src) || !statSync(src).isDirectory()) {
|
|
90
|
+
this.error(`✗ Template '${name}' not found at ${src}. Run with --list to see available templates.`);
|
|
91
|
+
}
|
|
92
|
+
const dest = path.resolve(name);
|
|
93
|
+
if (existsSync(dest)) {
|
|
94
|
+
this.error(`✗ Destination already exists: ${dest}\n Remove or rename it first.`);
|
|
95
|
+
}
|
|
96
|
+
mkdirSync(path.dirname(dest), { recursive: true });
|
|
97
|
+
cpSync(src, dest, { recursive: true });
|
|
98
|
+
this.log(`✓ Scaffolded ./${name}/ from bundled '${name}' template`);
|
|
99
|
+
this.log('');
|
|
100
|
+
this.log('Next steps:');
|
|
101
|
+
this.log(` 1. Edit ${name}/target.json — point baseUrl + auth at your app.`);
|
|
102
|
+
const hasMeta = existsSync(path.join(src, 'byo-metadata')) || existsSync(path.join(src, 'metadata'));
|
|
103
|
+
if (hasMeta) {
|
|
104
|
+
this.log(` 2. Adjust the tests + suite under ${name}/ to match your app's workflows.`);
|
|
105
|
+
}
|
|
106
|
+
const hasOverlay = existsSync(path.join(src, 'docker-compose.app.yml'));
|
|
107
|
+
this.log(` 3. Run: mj test regression remote --target=./${name}/target.json` +
|
|
108
|
+
(hasOverlay ? ` --overlay=./${name}/docker-compose.app.yml` : ''));
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=init.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../../src/commands/test/regression/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO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CAAC,kBAAkB,IAAI,mBAAmB,IAAI,YAAY,CAAC,CAAC;QACpE,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACb,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QACxB,IAAI,CAAC,GAAG,CAAC,aAAa,IAAI,kDAAkD,CAAC,CAAC;QAC9E,MAAM,OAAO,GACX,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC,CAAC;QACvF,IAAI,OAAO,EAAE,CAAC;YACZ,IAAI,CAAC,GAAG,CAAC,uCAAuC,IAAI,kCAAkC,CAAC,CAAC;QAC1F,CAAC;QACD,MAAM,UAAU,GAAG,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,wBAAwB,CAAC,CAAC,CAAC;QACxE,IAAI,CAAC,GAAG,CACN,kDAAkD,IAAI,cAAc;YAClE,CAAC,UAAU,CAAC,CAAC,CAAC,gBAAgB,IAAI,yBAAyB,CAAC,CAAC,CAAC,EAAE,CAAC,CACpE,CAAC;IACJ,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class TestRegressionRemote extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
target: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
7
|
+
'no-local-stack': import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
8
|
+
overlay: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string[], import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
9
|
+
image: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
10
|
+
'env-file': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
11
|
+
detach: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
12
|
+
};
|
|
13
|
+
run(): Promise<void>;
|
|
14
|
+
/** Inside the monorepo: load the target host-side, drive the compose stack. */
|
|
15
|
+
private runInMonorepo;
|
|
16
|
+
/**
|
|
17
|
+
* Outside the monorepo: run the published image. Mode B/C → `docker run`
|
|
18
|
+
* (the image loads --target itself). Mode D (--overlay) → `docker compose`
|
|
19
|
+
* with the bundled standalone compose + the user's app overlay.
|
|
20
|
+
*/
|
|
21
|
+
private runExternal;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=remote.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote.d.ts","sourceRoot":"","sources":["../../../../src/commands/test/regression/remote.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAC;AAgB7C,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,OAAO;IACvD,MAAM,CAAC,WAAW,SAGkC;IAEpD,MAAM,CAAC,QAAQ,WAKb;IAEF,MAAM,CAAC,KAAK;;;;;;;MA8BV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IAS1B,+EAA+E;YACjE,aAAa;IAoC3B;;;;OAIG;YACW,WAAW;CAgD1B"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { Command, Flags } from '@oclif/core';
|
|
2
|
+
import { existsSync } from 'node:fs';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { AGENTIC_TEST_RUNNER_IMAGE, dockerComposeArgs, dockerRunArgs, isInsideMonorepo, LOAD_TARGET_SCRIPT, resolveStandaloneCompose, resolveTargetPath, spawnCapture, spawnInherit, STANDALONE_COMPOSE, } from '../../../lib/regression/docker-helpers.js';
|
|
5
|
+
export default class TestRegressionRemote extends Command {
|
|
6
|
+
static { this.description = 'Run the regression suite against a remote URL (Mode B/C/D). Inside the MJ ' +
|
|
7
|
+
'monorepo it drives the local compose stack; outside it runs the published ' +
|
|
8
|
+
'agentic-test-runner image (no monorepo needed).'; }
|
|
9
|
+
static { this.examples = [
|
|
10
|
+
'<%= config.bin %> <%= command.id %> --target=staging-mj',
|
|
11
|
+
'<%= config.bin %> <%= command.id %> --target=./my/custom.target.json',
|
|
12
|
+
'<%= config.bin %> <%= command.id %> --target=./app/target.json --overlay=./app/docker-compose.app.yml',
|
|
13
|
+
'<%= config.bin %> <%= command.id %> --target=./t.json --image=memberjunction/agentic-test-runner:v5.30.0 --env-file=./.env',
|
|
14
|
+
]; }
|
|
15
|
+
static { this.flags = {
|
|
16
|
+
target: Flags.string({
|
|
17
|
+
char: 't',
|
|
18
|
+
description: 'Target profile. Bare name (monorepo: docker/regression/targets/<name>.target.json) or a path.',
|
|
19
|
+
required: true,
|
|
20
|
+
}),
|
|
21
|
+
'no-local-stack': Flags.boolean({
|
|
22
|
+
description: '(monorepo only) Use the lean `remote-target` profile (test-runner only) instead of the full local stack.',
|
|
23
|
+
default: false,
|
|
24
|
+
}),
|
|
25
|
+
overlay: Flags.string({
|
|
26
|
+
description: 'docker-compose overlay (Mode D) that boots your app alongside the runner on the same network. May repeat.',
|
|
27
|
+
multiple: true,
|
|
28
|
+
}),
|
|
29
|
+
image: Flags.string({
|
|
30
|
+
description: '(external) Published image tag to run. Default: ' + AGENTIC_TEST_RUNNER_IMAGE + '. Pin for reproducibility.',
|
|
31
|
+
}),
|
|
32
|
+
'env-file': Flags.string({
|
|
33
|
+
description: '(external) Path to a .env injected into the runner (DB_*, AI_VENDOR_API_KEY__GeminiLLM, auth env: refs).',
|
|
34
|
+
}),
|
|
35
|
+
detach: Flags.boolean({
|
|
36
|
+
char: 'd',
|
|
37
|
+
description: '(monorepo) Run in the background (docker compose up -d).',
|
|
38
|
+
default: false,
|
|
39
|
+
}),
|
|
40
|
+
}; }
|
|
41
|
+
async run() {
|
|
42
|
+
const { flags } = await this.parse(TestRegressionRemote);
|
|
43
|
+
if (isInsideMonorepo()) {
|
|
44
|
+
await this.runInMonorepo(flags);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
await this.runExternal(flags);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/** Inside the monorepo: load the target host-side, drive the compose stack. */
|
|
51
|
+
async runInMonorepo(flags) {
|
|
52
|
+
if (!existsSync(LOAD_TARGET_SCRIPT))
|
|
53
|
+
this.error(`✗ Loader missing: ${LOAD_TARGET_SCRIPT}`);
|
|
54
|
+
const targetPath = resolveTargetPath(flags.target);
|
|
55
|
+
if (!existsSync(targetPath))
|
|
56
|
+
this.error(`✗ Target profile not found: ${targetPath}`);
|
|
57
|
+
this.log(`▶ Loading target profile: ${targetPath}`);
|
|
58
|
+
const loaded = await spawnCapture(process.execPath, [LOAD_TARGET_SCRIPT, '--format=json', targetPath]);
|
|
59
|
+
if (loaded.code !== 0)
|
|
60
|
+
this.error(`✗ Target profile loader failed (exit ${loaded.code})`);
|
|
61
|
+
let envFromProfile;
|
|
62
|
+
try {
|
|
63
|
+
envFromProfile = JSON.parse(loaded.stdout);
|
|
64
|
+
}
|
|
65
|
+
catch (err) {
|
|
66
|
+
this.error(`✗ Target loader returned malformed JSON: ${err.message}`);
|
|
67
|
+
}
|
|
68
|
+
this.log(` Profile: ${envFromProfile.TARGET_PROFILE_NAME ?? '(unnamed)'} (${envFromProfile.TARGET_PROFILE_KIND ?? 'unknown'})`);
|
|
69
|
+
this.log(` Base URL: ${envFromProfile.MJ_TEST_VAR_baseUrl ?? '(not set)'}`);
|
|
70
|
+
const childEnv = { ...process.env, ...envFromProfile };
|
|
71
|
+
const composeProfile = flags['no-local-stack'] ? 'remote-target' : 'full';
|
|
72
|
+
const overlays = (flags.overlay ?? []).map((p) => {
|
|
73
|
+
if (!existsSync(p))
|
|
74
|
+
this.error(`✗ Overlay file not found: ${p}`);
|
|
75
|
+
return p;
|
|
76
|
+
});
|
|
77
|
+
if (overlays.length > 0)
|
|
78
|
+
this.log(` Overlays: ${overlays.join(', ')}`);
|
|
79
|
+
const composeArgs = dockerComposeArgs(composeProfile, ['up'], overlays);
|
|
80
|
+
if (flags.detach)
|
|
81
|
+
composeArgs.push('-d');
|
|
82
|
+
this.log(`▶ docker compose --profile ${composeProfile} up`);
|
|
83
|
+
const code = await spawnInherit('docker', composeArgs, { env: childEnv });
|
|
84
|
+
if (code !== 0)
|
|
85
|
+
this.exit(code);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Outside the monorepo: run the published image. Mode B/C → `docker run`
|
|
89
|
+
* (the image loads --target itself). Mode D (--overlay) → `docker compose`
|
|
90
|
+
* with the bundled standalone compose + the user's app overlay.
|
|
91
|
+
*/
|
|
92
|
+
async runExternal(flags) {
|
|
93
|
+
const targetPath = resolveTargetPath(flags.target);
|
|
94
|
+
if (!existsSync(targetPath)) {
|
|
95
|
+
this.error(`✗ Target profile not found: ${targetPath}\n Outside the monorepo, pass a path (e.g. --target=./my-suite/target.json).`);
|
|
96
|
+
}
|
|
97
|
+
const image = flags.image ?? AGENTIC_TEST_RUNNER_IMAGE;
|
|
98
|
+
const envFile = flags['env-file'] ? path.resolve(flags['env-file']) : undefined;
|
|
99
|
+
const targetDir = path.dirname(targetPath);
|
|
100
|
+
const targetFile = path.basename(targetPath);
|
|
101
|
+
const resultsDir = path.resolve('test-results');
|
|
102
|
+
const overlays = (flags.overlay ?? []).map((p) => {
|
|
103
|
+
if (!existsSync(p))
|
|
104
|
+
this.error(`✗ Overlay file not found: ${p}`);
|
|
105
|
+
return path.resolve(p);
|
|
106
|
+
});
|
|
107
|
+
if (overlays.length > 0) {
|
|
108
|
+
// Mode D — boot the app overlay alongside the runner via the standalone compose.
|
|
109
|
+
const standalone = resolveStandaloneCompose(STANDALONE_COMPOSE);
|
|
110
|
+
if (!existsSync(standalone)) {
|
|
111
|
+
this.error(`✗ Standalone compose not found (${standalone}). Reinstall @memberjunction/cli or run from the monorepo.`);
|
|
112
|
+
}
|
|
113
|
+
const childEnv = {
|
|
114
|
+
...process.env,
|
|
115
|
+
MJ_IMAGE: image,
|
|
116
|
+
TARGET_DIR: targetDir,
|
|
117
|
+
TARGET_FILE: targetFile,
|
|
118
|
+
USER_ENV_FILE: envFile ?? '/dev/null',
|
|
119
|
+
};
|
|
120
|
+
const args = ['compose', '-f', standalone];
|
|
121
|
+
for (const o of overlays)
|
|
122
|
+
args.push('-f', o);
|
|
123
|
+
args.push('up', '--abort-on-container-exit', '--exit-code-from', 'test-runner');
|
|
124
|
+
this.log(`▶ docker compose (standalone + ${overlays.length} overlay) — image ${image}`);
|
|
125
|
+
const code = await spawnInherit('docker', args, { env: childEnv });
|
|
126
|
+
if (code !== 0)
|
|
127
|
+
this.exit(code);
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
// Mode B/C — single `docker run` against the published image.
|
|
131
|
+
this.log(`▶ docker run ${image} run --target=/work/${targetFile}`);
|
|
132
|
+
const code = await spawnInherit('docker', dockerRunArgs(image, ['run', `--target=/work/${targetFile}`], {
|
|
133
|
+
mounts: [[targetDir, '/work'], [resultsDir, '/app/test-results']],
|
|
134
|
+
envFile,
|
|
135
|
+
}));
|
|
136
|
+
if (code !== 0)
|
|
137
|
+
this.exit(code);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
//# sourceMappingURL=remote.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote.js","sourceRoot":"","sources":["../../../../src/commands/test/regression/remote.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EACL,yBAAyB,EACzB,iBAAiB,EACjB,aAAa,EACb,gBAA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