testeranto 0.219.11 → 0.219.13
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/dist/common/src/Types.js +61 -0
- package/dist/common/src/esbuildConfigs/index.js +2 -1
- package/dist/common/src/server/runtimes/node/docker.js +7 -6
- package/dist/common/src/server/runtimes/node/esbuild.js +18 -18
- package/dist/common/src/server/runtimes/node/node.js +12 -8
- package/dist/common/src/server/serverClasees/Server_Base.js +2 -1
- package/dist/common/src/server/serverClasees/Server_Docker.js +81 -99
- package/dist/common/src/testeranto.js +29 -31
- package/dist/common/testeranto/runtimes/node/node.js +2 -1
- package/dist/common/testeranto/testeranto.js +70 -0
- package/dist/common/tsconfig.common.tsbuildinfo +1 -1
- package/dist/module/src/Types.js +61 -0
- package/dist/module/src/esbuildConfigs/index.js +2 -1
- package/dist/module/src/server/runtimes/node/docker.js +7 -6
- package/dist/module/src/server/runtimes/node/esbuild.js +18 -18
- package/dist/module/src/server/runtimes/node/node.js +12 -8
- package/dist/module/src/server/serverClasees/Server_Base.js +2 -1
- package/dist/module/src/server/serverClasees/Server_Docker.js +81 -99
- package/dist/module/src/testeranto.js +29 -28
- package/dist/module/testeranto/runtimes/node/node.js +2 -1
- package/dist/module/testeranto/testeranto.js +68 -0
- package/dist/module/tsconfig.module.tsbuildinfo +1 -1
- package/dist/prebuild/{chunk-MU5PJQAO.mjs → chunk-QLT7PNPK.mjs} +3 -3
- package/dist/prebuild/server/runtimes/node/node.mjs +20 -21
- package/dist/prebuild/server/runtimes/web/web.mjs +1 -1
- package/dist/prebuild/testeranto-6SAYRVSE.mjs +72 -0
- package/dist/prebuild/testeranto.mjs +75 -108
- package/dist/types/{Types.d.ts → src/Types.d.ts} +14 -79
- package/dist/types/src/esbuildConfigs/index.d.ts +3 -0
- package/dist/types/{server → src/server}/runtimes/golang/docker.d.ts +2 -2
- package/dist/types/src/server/runtimes/node/docker.d.ts +14 -0
- package/dist/types/src/server/runtimes/node/esbuild.d.ts +4 -0
- package/dist/types/{server → src/server}/serverClasees/Server.d.ts +2 -2
- package/dist/types/{server → src/server}/serverClasees/Server_Base.d.ts +3 -3
- package/dist/types/{server → src/server}/serverClasees/Server_Docker.d.ts +2 -2
- package/dist/types/{server → src/server}/serverClasees/Server_HTTP.d.ts +2 -2
- package/dist/types/{server → src/server}/serverClasees/Server_WS.d.ts +2 -2
- package/dist/types/testeranto/testeranto.d.ts +3 -0
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/Types.ts +132 -69
- package/src/esbuildConfigs/index.ts +4 -3
- package/src/lib/pitono/pyproject.toml +1 -1
- package/src/server/runtimes/golang/docker.ts +2 -2
- package/src/server/runtimes/node/docker.ts +10 -7
- package/src/server/runtimes/node/esbuild.ts +21 -19
- package/src/server/runtimes/node/node.ts +14 -9
- package/src/server/serverClasees/Server.ts +3 -2
- package/src/server/serverClasees/Server_Base.ts +7 -6
- package/src/server/serverClasees/Server_Docker.ts +105 -111
- package/src/server/serverClasees/Server_HTTP.ts +2 -2
- package/src/server/serverClasees/Server_WS.ts +2 -2
- package/src/testeranto.ts +37 -32
- package/testeranto/bundles/allTests/node/{Node-JOOBJDHW.mjs → Node-MSIIDKGC.mjs} +64 -28
- package/testeranto/docker-compose.yml +34 -74
- package/testeranto/runtimes/node/node.Dockerfile +0 -1
- package/testeranto/runtimes/node/node.ts +2 -1
- package/testeranto/testeranto.ts +90 -0
- package/tsconfig.json +1 -1
- package/allTests.ts +0 -52
- package/dist/common/allTests.js +0 -39
- package/dist/module/allTests.js +0 -37
- package/dist/types/esbuildConfigs/index.d.ts +0 -4
- package/dist/types/server/runtimes/node/docker.d.ts +0 -14
- package/dist/types/server/runtimes/node/esbuild.d.ts +0 -4
- /package/dist/types/{Init.d.ts → src/Init.d.ts} +0 -0
- /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/consoleDetectorPlugin.d.ts +0 -0
- /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/eslint-formatter-testeranto.d.ts +0 -0
- /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/featuresPlugin.d.ts +0 -0
- /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/inputFilesPlugin.d.ts +0 -0
- /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/nativeImportDetectorPlugin.d.ts +0 -0
- /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/rebuildPlugin.d.ts +0 -0
- /package/dist/types/{init-docs.d.ts → src/init-docs.d.ts} +0 -0
- /package/dist/types/{lib → src/lib}/tiposkripto/BaseGiven.d.ts +0 -0
- /package/dist/types/{lib → src/lib}/tiposkripto/BaseSuite.d.ts +0 -0
- /package/dist/types/{lib → src/lib}/tiposkripto/BaseThen.d.ts +0 -0
- /package/dist/types/{lib → src/lib}/tiposkripto/BaseTiposkripto.d.ts +0 -0
- /package/dist/types/{lib → src/lib}/tiposkripto/BaseWhen.d.ts +0 -0
- /package/dist/types/{lib → src/lib}/tiposkripto/CoreTypes.d.ts +0 -0
- /package/dist/types/{lib → src/lib}/tiposkripto/Node.d.ts +0 -0
- /package/dist/types/{lib → src/lib}/tiposkripto/Tiposkripto.d.ts +0 -0
- /package/dist/types/{lib → src/lib}/tiposkripto/Types.d.ts +0 -0
- /package/dist/types/{lib → src/lib}/tiposkripto/Web.d.ts +0 -0
- /package/dist/types/{lib → src/lib}/tiposkripto/abstractBase.test/MockGiven.d.ts +0 -0
- /package/dist/types/{lib → src/lib}/tiposkripto/abstractBase.test/MockThen.d.ts +0 -0
- /package/dist/types/{lib → src/lib}/tiposkripto/abstractBase.test/MockWhen.d.ts +0 -0
- /package/dist/types/{lib → src/lib}/tiposkripto/abstractBase.test/adapter.d.ts +0 -0
- /package/dist/types/{lib → src/lib}/tiposkripto/abstractBase.test/implementation.d.ts +0 -0
- /package/dist/types/{lib → src/lib}/tiposkripto/abstractBase.test/index.d.ts +0 -0
- /package/dist/types/{lib → src/lib}/tiposkripto/abstractBase.test/specification.d.ts +0 -0
- /package/dist/types/{lib → src/lib}/tiposkripto/abstractBase.test/types.d.ts +0 -0
- /package/dist/types/{lib → src/lib}/tiposkripto/index.d.ts +0 -0
- /package/dist/types/{runtimes.d.ts → src/runtimes.d.ts} +0 -0
- /package/dist/types/{server → src/server}/aider/configParser.d.ts +0 -0
- /package/dist/types/{server → src/server}/aider/docker.d.ts +0 -0
- /package/dist/types/{server → src/server}/getRunnables.d.ts +0 -0
- /package/dist/types/{server → src/server}/htmlTemplate.d.ts +0 -0
- /package/dist/types/{server → src/server}/nodeVersion.d.ts +0 -0
- /package/dist/types/{server → src/server}/runtimes/common.d.ts +0 -0
- /package/dist/types/{server → src/server}/runtimes/java/docker.d.ts +0 -0
- /package/dist/types/{server → src/server}/runtimes/node/node.d.ts +0 -0
- /package/dist/types/{server → src/server}/runtimes/python/docker.d.ts +0 -0
- /package/dist/types/{server → src/server}/runtimes/ruby/docker.d.ts +0 -0
- /package/dist/types/{server → src/server}/runtimes/rust/docker.d.ts +0 -0
- /package/dist/types/{server → src/server}/runtimes/web/docker.d.ts +0 -0
- /package/dist/types/{server → src/server}/runtimes/web/esbuild.d.ts +0 -0
- /package/dist/types/{server → src/server}/runtimes/web/hoist.d.ts +0 -0
- /package/dist/types/{server → src/server}/runtimes/web/web.d.ts +0 -0
- /package/dist/types/{server → src/server}/serverClasees/Server_FS.d.ts +0 -0
- /package/dist/types/{server → src/server}/serverManagers/DockerManager.d.ts +0 -0
- /package/dist/types/{server → src/server}/serverManagers/HttpManager.d.ts +0 -0
- /package/dist/types/{server → src/server}/serverManagers/WsManager.d.ts +0 -0
- /package/dist/types/{server → src/server}/serverManagers/fs.d.ts +0 -0
- /package/dist/types/{server → src/server}/serverManagers/tcp.d.ts +0 -0
- /package/dist/types/{server → src/server}/types.d.ts +0 -0
- /package/dist/types/{testeranto.d.ts → src/testeranto.d.ts} +0 -0
- /package/dist/types/{vscode → src/vscode}/TerminalManager.d.ts +0 -0
- /package/dist/types/{vscode → src/vscode}/TestTreeItem.d.ts +0 -0
- /package/dist/types/{vscode → src/vscode}/extension.d.ts +0 -0
- /package/dist/types/{vscode → src/vscode}/providers/FeaturesTreeDataProvider.d.ts +0 -0
- /package/dist/types/{vscode → src/vscode}/providers/FileTreeDataProvider.d.ts +0 -0
- /package/dist/types/{vscode → src/vscode}/providers/ProcessesTreeDataProvider.d.ts +0 -0
- /package/dist/types/{vscode → src/vscode}/providers/ResultsTreeDataProvider.d.ts +0 -0
- /package/dist/types/{vscode → src/vscode}/providers/TestTreeDataProvider.d.ts +0 -0
- /package/dist/types/{vscode → src/vscode}/types.d.ts +0 -0
- /package/testeranto/{testeranto.yml → testeranto-deprecateed.yml} +0 -0
package/dist/common/src/Types.js
CHANGED
|
@@ -1,2 +1,63 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// export type ITestconfig = {
|
|
4
|
+
// httpPort: number;
|
|
5
|
+
// featureIngestor: (s: string) => Promise<string>;
|
|
6
|
+
// importPlugins: IPluginFactory[];
|
|
7
|
+
// ports: string[];
|
|
8
|
+
// src: string;
|
|
9
|
+
// check: string;
|
|
10
|
+
// java: {
|
|
11
|
+
// plugins: any[];
|
|
12
|
+
// tests: Record<string, { ports: number }>;
|
|
13
|
+
// loaders: Record<string, string>;
|
|
14
|
+
// checks: IChecks;
|
|
15
|
+
// dockerfile: string;
|
|
16
|
+
// };
|
|
17
|
+
// rust: {
|
|
18
|
+
// plugins: any[];
|
|
19
|
+
// tests: Record<string, { ports: number }>;
|
|
20
|
+
// loaders: Record<string, string>;
|
|
21
|
+
// checks: IChecks;
|
|
22
|
+
// dockerfile: string;
|
|
23
|
+
// };
|
|
24
|
+
// ruby: {
|
|
25
|
+
// plugins: any[];
|
|
26
|
+
// tests: Record<string, { ports: number }>;
|
|
27
|
+
// loaders: Record<string, string>;
|
|
28
|
+
// checks: IChecks;
|
|
29
|
+
// dockerfile: string;
|
|
30
|
+
// };
|
|
31
|
+
// golang: {
|
|
32
|
+
// plugins: any[];
|
|
33
|
+
// tests: Record<string, { ports: number }>;
|
|
34
|
+
// loaders: Record<string, string>;
|
|
35
|
+
// checks: IChecks;
|
|
36
|
+
// dockerfile: string;
|
|
37
|
+
// };
|
|
38
|
+
// python: {
|
|
39
|
+
// plugins: any[];
|
|
40
|
+
// tests: Record<string, { ports: number }>;
|
|
41
|
+
// loaders: Record<string, string>;
|
|
42
|
+
// checks: IChecks;
|
|
43
|
+
// dockerfile: string;
|
|
44
|
+
// };
|
|
45
|
+
// node: {
|
|
46
|
+
// plugins: any[];
|
|
47
|
+
// tests: Record<string, { ports: number }>;
|
|
48
|
+
// loaders: Record<string, string>;
|
|
49
|
+
// externals: string[];
|
|
50
|
+
// checks: IChecks;
|
|
51
|
+
// dockerfile: string;
|
|
52
|
+
// };
|
|
53
|
+
// web: {
|
|
54
|
+
// plugins: any[];
|
|
55
|
+
// tests: Record<string, { ports: number }>;
|
|
56
|
+
// loaders: Record<string, string>;
|
|
57
|
+
// externals: string[];
|
|
58
|
+
// checks: IChecks;
|
|
59
|
+
// dockerfile: string;
|
|
60
|
+
// };
|
|
61
|
+
// };
|
|
62
|
+
// export type IBuiltConfig = { buildDir: string } & ITestconfig;
|
|
63
|
+
// export type IConfig = Map<string, [IRunTime, string, string, { tests: string[] }]>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// import { ITestconfig } from "../Types";
|
|
3
4
|
exports.default = (config) => {
|
|
4
5
|
return {
|
|
5
6
|
// packages: "external",
|
|
@@ -10,7 +11,7 @@ exports.default = (config) => {
|
|
|
10
11
|
outbase: ".",
|
|
11
12
|
jsx: "transform",
|
|
12
13
|
bundle: true,
|
|
13
|
-
minify: config.minify === true,
|
|
14
|
+
// minify: config.minify === true,
|
|
14
15
|
write: true,
|
|
15
16
|
loader: {
|
|
16
17
|
".js": "jsx",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.nodeBddCommand = exports.nodeBuildCommand = exports.nodeDockerComposeFile = void 0;
|
|
4
|
-
const nodeDockerComposeFile = (config, container_name,
|
|
4
|
+
const nodeDockerComposeFile = (config, container_name, projectConfigPath, nodeConfigPath, testName) => {
|
|
5
5
|
return {
|
|
6
6
|
build: {
|
|
7
7
|
context: process.cwd(),
|
|
@@ -16,22 +16,23 @@ const nodeDockerComposeFile = (config, container_name, fpath) => {
|
|
|
16
16
|
`${process.cwd()}/dist:/workspace/dist`,
|
|
17
17
|
`${process.cwd()}/testeranto:/workspace/testeranto`,
|
|
18
18
|
],
|
|
19
|
-
command: (0, exports.nodeBuildCommand)(
|
|
19
|
+
command: (0, exports.nodeBuildCommand)(projectConfigPath, nodeConfigPath, testName),
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
22
|
exports.nodeDockerComposeFile = nodeDockerComposeFile;
|
|
23
23
|
const externalTests = true;
|
|
24
|
-
const nodeBuildCommand = (
|
|
24
|
+
const nodeBuildCommand = (projectConfigPath, nodeConfigPath, testName) => {
|
|
25
25
|
if (externalTests) {
|
|
26
|
-
console.log("external tests",
|
|
26
|
+
console.log("external tests", testName);
|
|
27
27
|
// return `cat node_modules/testeranto/src/server/runtimes/node/esbuild.ts`
|
|
28
|
-
return `yarn tsx node_modules/testeranto/src/server/runtimes/node/node.ts ${
|
|
28
|
+
return `yarn tsx node_modules/testeranto/src/server/runtimes/node/node.ts /workspace/testeranto/testeranto.ts ${nodeConfigPath} ${testName}`;
|
|
29
29
|
// return `cat node_modules/testeranto/src/server/runtimes/node/node.ts`
|
|
30
30
|
// return ["sh", "-c", "cd /workspace && javac -cp \".:lib/*\" src/server/runtimes/java/main.java && java -cp \"src/server/runtimes/java:.\" main"]
|
|
31
31
|
}
|
|
32
32
|
else {
|
|
33
33
|
console.log("not external tests");
|
|
34
|
-
return `yarn tsx src/server/runtimes/node/node.ts /workspace/${fpath}`;
|
|
34
|
+
// return `yarn tsx src/server/runtimes/node/node.ts /workspace/${fpath}`;
|
|
35
|
+
return `yarn tsx src/server/runtimes/node/node.ts /workspace/testeranto/testeranto.ts /workspace/${nodeConfigPath} ${testName}`;
|
|
35
36
|
}
|
|
36
37
|
};
|
|
37
38
|
exports.nodeBuildCommand = nodeBuildCommand;
|
|
@@ -7,34 +7,34 @@ const featuresPlugin_js_1 = __importDefault(require("../../../esbuildConfigs/fea
|
|
|
7
7
|
const index_js_1 = __importDefault(require("../../../esbuildConfigs/index.js"));
|
|
8
8
|
const inputFilesPlugin_js_1 = __importDefault(require("../../../esbuildConfigs/inputFilesPlugin.js"));
|
|
9
9
|
const rebuildPlugin_js_1 = __importDefault(require("../../../esbuildConfigs/rebuildPlugin.js"));
|
|
10
|
-
const absoluteBundlesDir = (
|
|
10
|
+
const absoluteBundlesDir = () => {
|
|
11
11
|
return "./testeranto/bundles/allTests/node/";
|
|
12
12
|
};
|
|
13
|
-
exports.default = (
|
|
14
|
-
var _a
|
|
15
|
-
console.log("
|
|
13
|
+
exports.default = (nodeConfig, testName, projectConfig) => {
|
|
14
|
+
var _a;
|
|
15
|
+
console.log("esbuild", testName, projectConfig);
|
|
16
|
+
const entryPoints = projectConfig.runtimes[testName].tests;
|
|
16
17
|
// Get entry points from config, or use a default
|
|
17
|
-
let entrypoints = [];
|
|
18
|
-
if (
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
18
|
+
// let entrypoints: string[] = [];
|
|
19
|
+
// if (nodeConfig) {
|
|
20
|
+
// entrypoints = (projectConfig.tests);
|
|
21
|
+
// } else {
|
|
22
|
+
// // console.log(projectConfig)
|
|
23
|
+
// throw "projectConfig.node.tests should exist"
|
|
24
|
+
// // Fallback to a reasonable default
|
|
25
|
+
// // entrypoints = ["./example/Calculator.test.ts"];
|
|
26
|
+
// // console.warn(`No node.tests found in config, using default entry point: ${entrypoints[0]}`);
|
|
27
|
+
// }
|
|
28
28
|
const { inputFilesPluginFactory, register } = (0, inputFilesPlugin_js_1.default)("node", testName);
|
|
29
|
-
return Object.assign(Object.assign({}, (0, index_js_1.default)(
|
|
29
|
+
return Object.assign(Object.assign({}, (0, index_js_1.default)(nodeConfig)), { outdir: absoluteBundlesDir(), outbase: ".", metafile: true, supported: {
|
|
30
30
|
"dynamic-import": true,
|
|
31
31
|
}, define: {
|
|
32
32
|
"process.env.FLUENTFFMPEG_COV": "0",
|
|
33
33
|
ENV: `"node"`,
|
|
34
|
-
}, bundle: true, format: "esm", absWorkingDir: process.cwd(), platform: "node", packages: "external", entryPoints
|
|
34
|
+
}, bundle: true, format: "esm", absWorkingDir: process.cwd(), platform: "node", packages: "external", entryPoints, plugins: [
|
|
35
35
|
featuresPlugin_js_1.default,
|
|
36
36
|
inputFilesPluginFactory,
|
|
37
37
|
(0, rebuildPlugin_js_1.default)("node"),
|
|
38
|
-
...(((
|
|
38
|
+
...(((_a = nodeConfig.plugins) === null || _a === void 0 ? void 0 : _a.map((p) => p(register, entryPoints))) || []),
|
|
39
39
|
] });
|
|
40
40
|
};
|
|
@@ -37,21 +37,24 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
const esbuild_1 = __importDefault(require("esbuild"));
|
|
40
|
-
const esbuild_2 = __importDefault(require("./esbuild"));
|
|
41
40
|
const common_1 = require("../common");
|
|
41
|
+
const esbuild_2 = __importDefault(require("./esbuild"));
|
|
42
42
|
console.log(`[NODE BUILDER] hello: ${process.argv}`);
|
|
43
|
-
const
|
|
44
|
-
const
|
|
43
|
+
const projectConfigPath = process.argv[2];
|
|
44
|
+
const nodeConfigPath = process.argv[3];
|
|
45
|
+
const testName = process.argv[4];
|
|
46
|
+
console.log(`[NODE BUILDER] projectConfigPath: ${projectConfigPath}`);
|
|
45
47
|
console.log(`[NODE BUILDER] nodeConfig: ${nodeConfigPath}`);
|
|
48
|
+
console.log(`[NODE BUILDER] testName: ${testName}`);
|
|
46
49
|
// run esbuild in watch mode using esbuildConfigs. Write to fs the bundle and metafile
|
|
47
|
-
async function startBundling(
|
|
50
|
+
async function startBundling(nodeConfigs, projectConfig) {
|
|
48
51
|
console.log(`[NODE BUILDER] is now bundling: ${testName}`);
|
|
49
|
-
const n = (0, esbuild_2.default)(
|
|
52
|
+
const n = (0, esbuild_2.default)(nodeConfigs, testName, projectConfig);
|
|
50
53
|
const buildResult = await esbuild_1.default.build(n);
|
|
51
54
|
// const metafilesDir =
|
|
52
55
|
// process.env.METAFILES_DIR || "/workspace/testeranto/metafiles/node";
|
|
53
56
|
if (buildResult.metafile) {
|
|
54
|
-
await (0, common_1.processMetafile)(
|
|
57
|
+
await (0, common_1.processMetafile)(projectConfig, buildResult.metafile, 'node');
|
|
55
58
|
}
|
|
56
59
|
else {
|
|
57
60
|
console.warn("No metafile generated by esbuild");
|
|
@@ -59,8 +62,9 @@ async function startBundling(config) {
|
|
|
59
62
|
}
|
|
60
63
|
async function main() {
|
|
61
64
|
try {
|
|
62
|
-
const
|
|
63
|
-
await
|
|
65
|
+
const nodeConfigs = (await Promise.resolve(`${nodeConfigPath}`).then(s => __importStar(require(s)))).default;
|
|
66
|
+
const projectConfigs = (await Promise.resolve(`${projectConfigPath}`).then(s => __importStar(require(s)))).default;
|
|
67
|
+
await startBundling(nodeConfigs, projectConfigs);
|
|
64
68
|
}
|
|
65
69
|
catch (error) {
|
|
66
70
|
console.error("NODE BUILDER: Error importing config:", nodeConfigPath, error);
|
|
@@ -5,9 +5,10 @@ class Server_Base {
|
|
|
5
5
|
constructor(configs, mode) {
|
|
6
6
|
this.configs = configs;
|
|
7
7
|
this.mode = mode;
|
|
8
|
+
console.log(`[Base] ${this.configs}`);
|
|
8
9
|
}
|
|
9
10
|
async start() {
|
|
10
|
-
console.log(`[Server_Base] start()`)
|
|
11
|
+
// console.log(`[Server_Base] start()`)
|
|
11
12
|
}
|
|
12
13
|
async stop() {
|
|
13
14
|
console.log(`[Server_Base] stop()`);
|
|
@@ -42,15 +42,15 @@ class Server_Docker extends Server_WS_1.Server_WS {
|
|
|
42
42
|
staticTestDockerComposeFile(runtime, container_name, command) {
|
|
43
43
|
// Find the dockerfile path from configs
|
|
44
44
|
let dockerfilePath = '';
|
|
45
|
-
for (const [key, value] of this.configs.
|
|
46
|
-
if (value
|
|
47
|
-
dockerfilePath = value
|
|
45
|
+
for (const [key, value] of Object.entries(this.configs.runtimes)) {
|
|
46
|
+
if (value.runtime === runtime) {
|
|
47
|
+
dockerfilePath = value.dockerfile;
|
|
48
48
|
break;
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
// If no dockerfile found, use a default based on runtime
|
|
52
52
|
if (!dockerfilePath) {
|
|
53
|
-
throw (`no dockerfile found for ${dockerfilePath}`);
|
|
53
|
+
throw (`[Docker] [staticTestDockerComposeFile] no dockerfile found for ${dockerfilePath}, ${Object.entries(this.configs)}`);
|
|
54
54
|
}
|
|
55
55
|
return {
|
|
56
56
|
build: {
|
|
@@ -71,15 +71,15 @@ class Server_Docker extends Server_WS_1.Server_WS {
|
|
|
71
71
|
bddTestDockerComposeFile(runtime, container_name, command) {
|
|
72
72
|
// Find the dockerfile path from configs
|
|
73
73
|
let dockerfilePath = '';
|
|
74
|
-
for (const [key, value] of this.configs.
|
|
75
|
-
if (value
|
|
76
|
-
dockerfilePath = value
|
|
74
|
+
for (const [key, value] of Object.entries(this.configs.runtimes)) {
|
|
75
|
+
if (value.runtime === runtime) {
|
|
76
|
+
dockerfilePath = value.dockerfile;
|
|
77
77
|
break;
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
// If no dockerfile found, use a default based on runtime
|
|
81
81
|
if (!dockerfilePath) {
|
|
82
|
-
throw (`no dockerfile found for ${dockerfilePath}`);
|
|
82
|
+
throw (`[Docker] [bddTestDockerComposeFile] no dockerfile found for ${dockerfilePath}, ${Object.entries(this.configs)}`);
|
|
83
83
|
}
|
|
84
84
|
const service = {
|
|
85
85
|
build: {
|
|
@@ -125,6 +125,7 @@ class Server_Docker extends Server_WS_1.Server_WS {
|
|
|
125
125
|
// config: IBuiltConfig,
|
|
126
126
|
) {
|
|
127
127
|
const services = {};
|
|
128
|
+
console.log("mark1");
|
|
128
129
|
// // Add browser service
|
|
129
130
|
// services['browser'] = {
|
|
130
131
|
// build:
|
|
@@ -159,89 +160,66 @@ class Server_Docker extends Server_WS_1.Server_WS {
|
|
|
159
160
|
"java": [docker_2.javaDockerComposeFile, docker_2.javaBuildCommand, docker_2.javaBddCommand]
|
|
160
161
|
};
|
|
161
162
|
// Iterate through each entry in the config Map
|
|
162
|
-
for (const [runtimeTestsName, runtimeTests] of this.configs.
|
|
163
|
-
const runtime = runtimeTests
|
|
164
|
-
const dockerfile = runtimeTests
|
|
165
|
-
const
|
|
166
|
-
const testsObj = runtimeTests
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
const uid = `${runtimeTestsName}-${cleanTestName}`;
|
|
222
|
-
// Add BDD service for this test
|
|
223
|
-
const bddCommandFunc = runTimeToCompose[runtime][2];
|
|
224
|
-
// TODO find filepath
|
|
225
|
-
// const filePath = "testeranto/bundles/allTests/ruby/example/Calculator.test.rb"
|
|
226
|
-
console.log("mark8", testName);
|
|
227
|
-
const filePath = `testeranto/bundles/allTests/${runtime}/${testName}`;
|
|
228
|
-
console.log("mark4", filePath);
|
|
229
|
-
const command = bddCommandFunc(filePath);
|
|
230
|
-
// // Determine the file path to pass to bddCommandFunc
|
|
231
|
-
// let filePath = "";
|
|
232
|
-
// if (typeof testConfig === 'string') {
|
|
233
|
-
// filePath = testConfig;
|
|
234
|
-
// } else if (testConfig && typeof testConfig === 'object') {
|
|
235
|
-
// // Try to get path or entryPoint from test config
|
|
236
|
-
// filePath = testConfig.path || testConfig.entryPoint || "";
|
|
237
|
-
// }
|
|
238
|
-
// const command = bddCommandFunc ? bddCommandFunc(filePath) : "";
|
|
239
|
-
// Only add BDD service if we have a command
|
|
240
|
-
if (command) {
|
|
241
|
-
services[`${uid}-bdd`] = this.bddTestDockerComposeFile(runtime, `${uid}-bdd`, command);
|
|
163
|
+
for (const [runtimeTestsName, runtimeTests] of Object.entries(this.configs.runtimes)) {
|
|
164
|
+
const runtime = runtimeTests.runtime;
|
|
165
|
+
const dockerfile = runtimeTests.dockerfile;
|
|
166
|
+
const buildOptions = runtimeTests.buildOptions;
|
|
167
|
+
const testsObj = runtimeTests.tests;
|
|
168
|
+
// loop over all suites which are of the right runtime
|
|
169
|
+
for (const [t, c] of Object.entries(this.configs.runtimes)) {
|
|
170
|
+
if (c.runtime === runtime) {
|
|
171
|
+
if (runtimes_1.RUN_TIMES.includes(runtime)) {
|
|
172
|
+
const buildCommand = runTimeToCompose[runtime][1](buildOptions, c.buildOptions, runtimeTestsName);
|
|
173
|
+
// Add builder service for this runtime
|
|
174
|
+
const builderServiceName = `${runtime}-builder`;
|
|
175
|
+
// Ensure dockerfile path is valid and exists
|
|
176
|
+
let dockerfilePath = dockerfile;
|
|
177
|
+
const fullDockerfilePath = path_1.default.join(process.cwd(), dockerfilePath);
|
|
178
|
+
if (!fs_1.default.existsSync(fullDockerfilePath)) {
|
|
179
|
+
throw (`[Server_Docker] Dockerfile not found at ${fullDockerfilePath}`);
|
|
180
|
+
}
|
|
181
|
+
services[builderServiceName] = {
|
|
182
|
+
build: {
|
|
183
|
+
context: process.cwd(),
|
|
184
|
+
dockerfile: dockerfilePath,
|
|
185
|
+
},
|
|
186
|
+
container_name: builderServiceName,
|
|
187
|
+
environment: {},
|
|
188
|
+
working_dir: "/workspace",
|
|
189
|
+
volumes: [
|
|
190
|
+
`${process.cwd()}/src:/workspace/src`,
|
|
191
|
+
`${process.cwd()}/example:/workspace/example`,
|
|
192
|
+
`${process.cwd()}/dist:/workspace/dist`,
|
|
193
|
+
`${process.cwd()}/testeranto:/workspace/testeranto`,
|
|
194
|
+
],
|
|
195
|
+
command: buildCommand,
|
|
196
|
+
networks: ["allTests_network"],
|
|
197
|
+
};
|
|
198
|
+
for (const tName of testsObj) {
|
|
199
|
+
// Clean the test name for use in container names
|
|
200
|
+
// Handle numeric test names (like '0') by converting to string
|
|
201
|
+
// const testNameStr = String(testName);
|
|
202
|
+
const cleanTestName = tName.toLowerCase()
|
|
203
|
+
.replaceAll("/", "_")
|
|
204
|
+
.replaceAll(".", "-")
|
|
205
|
+
.replace(/[^a-z0-9_-]/g, '');
|
|
206
|
+
// Generate UID using the runtimeTestsName (e.g., 'nodeTests') and clean test name
|
|
207
|
+
const uid = `${runtimeTestsName.toLowerCase()}-${cleanTestName}`;
|
|
208
|
+
// Add BDD service for this test
|
|
209
|
+
const bddCommandFunc = runTimeToCompose[runtime][2];
|
|
210
|
+
// TODO find filepath
|
|
211
|
+
// const filePath = "testeranto/bundles/allTests/ruby/example/Calculator.test.rb"
|
|
212
|
+
const filePath = `testeranto/bundles/allTests/${runtime}/${tName}`;
|
|
213
|
+
const command = bddCommandFunc(filePath);
|
|
214
|
+
console.log("wtf command", command);
|
|
215
|
+
services[`${uid}-bdd`] = this.bddTestDockerComposeFile(runtime, `${uid}-bdd`, command);
|
|
216
|
+
services[`${uid}-aider`] = this.aiderDockerComposeFile(`${uid}-aider`);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
else {
|
|
220
|
+
throw `unknown runtime ${runtime}`;
|
|
221
|
+
}
|
|
242
222
|
}
|
|
243
|
-
// Always add aider service
|
|
244
|
-
services[`${uid}-aider`] = this.aiderDockerComposeFile(`${uid}-aider`);
|
|
245
223
|
}
|
|
246
224
|
}
|
|
247
225
|
// Ensure all services use the same network configuration
|
|
@@ -469,10 +447,10 @@ ${x}
|
|
|
469
447
|
console.log(`[Server_Docker] Waiting for browser container to be healthy...`);
|
|
470
448
|
await this.waitForContainerHealthy('browser-allTests', 60000); // 60 seconds max
|
|
471
449
|
// Start aider services
|
|
472
|
-
for (const [configKey, configValue] of this.configs.
|
|
473
|
-
const runtime = configValue
|
|
474
|
-
const testsObj = configValue[3];
|
|
475
|
-
const tests =
|
|
450
|
+
for (const [configKey, configValue] of Object.entries(this.configs.runtimes)) {
|
|
451
|
+
const runtime = configValue.runtime;
|
|
452
|
+
// const testsObj = configValue[3];
|
|
453
|
+
const tests = configValue.tests;
|
|
476
454
|
console.log(`[Server_Docker] Found tests for ${runtime}:`, (JSON.stringify(tests)));
|
|
477
455
|
for (const testName of tests) {
|
|
478
456
|
// Generate the UID exactly as DockerManager does
|
|
@@ -494,10 +472,14 @@ ${x}
|
|
|
494
472
|
}
|
|
495
473
|
// Start BDD test services
|
|
496
474
|
// TODO these logs from these services should be saved into reports
|
|
497
|
-
for (const [configKey, configValue] of this.configs.
|
|
498
|
-
const runtime = configValue
|
|
499
|
-
const testsObj = configValue[3];
|
|
500
|
-
const tests =
|
|
475
|
+
for (const [configKey, configValue] of Object.entries(this.configs.runtimes)) {
|
|
476
|
+
const runtime = configValue.runtime;
|
|
477
|
+
// const testsObj = configValue[3];
|
|
478
|
+
const tests = configValue.tests;
|
|
479
|
+
console.log(`[Server_Docker] Found tests for ${runtime}:`, (JSON.stringify(tests)));
|
|
480
|
+
// const runtime = configValue[0];
|
|
481
|
+
// const testsObj = configValue[3];
|
|
482
|
+
// const tests = testsObj?.tests || {};
|
|
501
483
|
for (const testName of tests) {
|
|
502
484
|
const uid = `${configKey}-${testName.toLowerCase().replaceAll("/", "_").replaceAll(".", "-")}`;
|
|
503
485
|
const bddServiceName = `${uid}-bdd`;
|
|
@@ -523,7 +505,7 @@ ${x}
|
|
|
523
505
|
}
|
|
524
506
|
// Start static test services
|
|
525
507
|
// TODO these logs from these services should be saved into reports
|
|
526
|
-
for (const [configKey, configValue] of this.configs
|
|
508
|
+
for (const [configKey, configValue] of Object.entries(this.configs)) {
|
|
527
509
|
const runtime = configValue[0];
|
|
528
510
|
const testsObj = configValue[3];
|
|
529
511
|
const tests = (testsObj === null || testsObj === void 0 ? void 0 : testsObj.tests) || {};
|
|
@@ -32,13 +32,10 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
32
32
|
return result;
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
36
|
const fs = await Promise.resolve().then(() => __importStar(require('fs/promises')));
|
|
40
|
-
const yaml = await
|
|
41
|
-
|
|
37
|
+
// const yaml = await import('yaml');
|
|
38
|
+
// import path from "path";
|
|
42
39
|
const Server_1 = require("./server/serverClasees/Server");
|
|
43
40
|
const mode = process.argv[3];
|
|
44
41
|
if (mode !== "once" && mode !== "dev") {
|
|
@@ -46,32 +43,33 @@ if (mode !== "once" && mode !== "dev") {
|
|
|
46
43
|
process.exit(-1);
|
|
47
44
|
}
|
|
48
45
|
const main = async () => {
|
|
49
|
-
const yamlPath =
|
|
50
|
-
const yamlContent = await fs.readFile(yamlPath, 'utf-8');
|
|
51
|
-
const parsed = yaml.parse(yamlContent);
|
|
52
|
-
const config = new Map();
|
|
53
|
-
for (const [key, value] of Object.entries(parsed)) {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
46
|
+
// const yamlPath = path.join(process.cwd(), 'testeranto/testeranto.yml');
|
|
47
|
+
// const yamlContent = await fs.readFile(yamlPath, 'utf-8');
|
|
48
|
+
// const parsed = yaml.parse(yamlContent);
|
|
49
|
+
// const config: ITestconfigV2 = new Map();
|
|
50
|
+
// for (const [key, value] of Object.entries(parsed)) {
|
|
51
|
+
// if (Array.isArray(value) && value.length >= 4) {
|
|
52
|
+
// // The first three elements are runtime, dockerfile, script
|
|
53
|
+
// const runtime = String(value[0]) as IRunTime;
|
|
54
|
+
// const dockerfile = String(value[1]);
|
|
55
|
+
// const script = String(value[2]);
|
|
56
|
+
// // The fourth element should be an object with tests
|
|
57
|
+
// let testsObj = { tests: [] as string[] };
|
|
58
|
+
// const fourth = value[3];
|
|
59
|
+
// if (fourth && typeof fourth === 'object' && fourth !== null) {
|
|
60
|
+
// const testsData = fourth as any;
|
|
61
|
+
// if (testsData.tests && Array.isArray(testsData.tests)) {
|
|
62
|
+
// testsObj.tests = testsData.tests.map((t: any) => String(t));
|
|
63
|
+
// }
|
|
64
|
+
// }
|
|
65
|
+
// config.set(key, [runtime, dockerfile, script, testsObj]);
|
|
66
|
+
// } else {
|
|
67
|
+
// console.warn(`Skipping entry ${key}: expected array with at least 4 elements, got`, value);
|
|
68
|
+
// }
|
|
69
|
+
// }
|
|
70
|
+
// console.log('Parsed config:', Array.from(config.entries()));
|
|
71
|
+
const config = (await Promise.resolve().then(() => __importStar(require('../testeranto/testeranto.ts')))).default;
|
|
72
|
+
console.log("mark123", config);
|
|
75
73
|
await new Server_1.Server(config, mode).start();
|
|
76
74
|
};
|
|
77
75
|
main();
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const config = {
|
|
4
|
+
featureIngestor: function (s) {
|
|
5
|
+
throw new Error("Function not implemented.");
|
|
6
|
+
},
|
|
7
|
+
runtimes: {
|
|
8
|
+
nodetests: ({
|
|
9
|
+
runtime: "node",
|
|
10
|
+
tests: ["example/Calculator.test.ts"],
|
|
11
|
+
checks: [
|
|
12
|
+
(x) => `yarn eslint`,
|
|
13
|
+
(x) => `yarn tsc --noEmit`,
|
|
14
|
+
],
|
|
15
|
+
dockerfile: `testeranto/runtimes/node/node.Dockerfile`,
|
|
16
|
+
buildOptions: `testeranto/runtimes/node/node.ts`
|
|
17
|
+
}),
|
|
18
|
+
webtests: ({
|
|
19
|
+
runtime: "web",
|
|
20
|
+
tests: ["example/Calculator.test.ts"],
|
|
21
|
+
checks: [
|
|
22
|
+
(x) => `yarn eslint`,
|
|
23
|
+
(x) => `yarn tsc --noEmit`,
|
|
24
|
+
],
|
|
25
|
+
dockerfile: `testeranto/runtimes/web/web.Dockerfile`,
|
|
26
|
+
buildOptions: `testeranto/runtimes/web/web.ts`
|
|
27
|
+
}),
|
|
28
|
+
pythontests: ({
|
|
29
|
+
runtime: "python",
|
|
30
|
+
tests: ["example/Calculator.test.py"],
|
|
31
|
+
checks: [
|
|
32
|
+
(x) => `yarn eslint`,
|
|
33
|
+
(x) => `yarn tsc --noEmit`,
|
|
34
|
+
],
|
|
35
|
+
dockerfile: `testeranto/runtimes/python/python.Dockerfile`,
|
|
36
|
+
buildOptions: `testeranto/runtimes/python/python.ts`
|
|
37
|
+
}),
|
|
38
|
+
golangtests: ({
|
|
39
|
+
runtime: "golang",
|
|
40
|
+
tests: ["example/Calculator.test.go"],
|
|
41
|
+
checks: [
|
|
42
|
+
(x) => `yarn eslint`,
|
|
43
|
+
(x) => `yarn tsc --noEmit`,
|
|
44
|
+
],
|
|
45
|
+
dockerfile: `testeranto/runtimes/golang/golang.Dockerfile`,
|
|
46
|
+
buildOptions: `testeranto/runtimes/golang/golang.ts`
|
|
47
|
+
}),
|
|
48
|
+
rusttests: ({
|
|
49
|
+
runtime: "rust",
|
|
50
|
+
tests: ["example/Calculator.test.rs"],
|
|
51
|
+
checks: [
|
|
52
|
+
(x) => `yarn eslint`,
|
|
53
|
+
(x) => `yarn tsc --noEmit`,
|
|
54
|
+
],
|
|
55
|
+
dockerfile: `testeranto/runtimes/rust/rust.Dockerfile`,
|
|
56
|
+
buildOptions: `testeranto/runtimes/rust/rust.ts`
|
|
57
|
+
}),
|
|
58
|
+
rubytests: ({
|
|
59
|
+
runtime: "ruby",
|
|
60
|
+
tests: ["example/Calculator.test.rb"],
|
|
61
|
+
checks: [
|
|
62
|
+
(x) => `yarn eslint`,
|
|
63
|
+
(x) => `yarn tsc --noEmit`,
|
|
64
|
+
],
|
|
65
|
+
dockerfile: `testeranto/runtimes/ruby/ruby.Dockerfile`,
|
|
66
|
+
buildOptions: `testeranto/runtimes/ruby/ruby.ts`
|
|
67
|
+
}),
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
exports.default = config;
|