testeranto 0.219.12 → 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 -9
- 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 -9
- 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 -22
- 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 -10
- 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/module/src/Types.js
CHANGED
|
@@ -1 +1,62 @@
|
|
|
1
1
|
export {};
|
|
2
|
+
// export type ITestconfig = {
|
|
3
|
+
// httpPort: number;
|
|
4
|
+
// featureIngestor: (s: string) => Promise<string>;
|
|
5
|
+
// importPlugins: IPluginFactory[];
|
|
6
|
+
// ports: string[];
|
|
7
|
+
// src: string;
|
|
8
|
+
// check: string;
|
|
9
|
+
// java: {
|
|
10
|
+
// plugins: any[];
|
|
11
|
+
// tests: Record<string, { ports: number }>;
|
|
12
|
+
// loaders: Record<string, string>;
|
|
13
|
+
// checks: IChecks;
|
|
14
|
+
// dockerfile: string;
|
|
15
|
+
// };
|
|
16
|
+
// rust: {
|
|
17
|
+
// plugins: any[];
|
|
18
|
+
// tests: Record<string, { ports: number }>;
|
|
19
|
+
// loaders: Record<string, string>;
|
|
20
|
+
// checks: IChecks;
|
|
21
|
+
// dockerfile: string;
|
|
22
|
+
// };
|
|
23
|
+
// ruby: {
|
|
24
|
+
// plugins: any[];
|
|
25
|
+
// tests: Record<string, { ports: number }>;
|
|
26
|
+
// loaders: Record<string, string>;
|
|
27
|
+
// checks: IChecks;
|
|
28
|
+
// dockerfile: string;
|
|
29
|
+
// };
|
|
30
|
+
// golang: {
|
|
31
|
+
// plugins: any[];
|
|
32
|
+
// tests: Record<string, { ports: number }>;
|
|
33
|
+
// loaders: Record<string, string>;
|
|
34
|
+
// checks: IChecks;
|
|
35
|
+
// dockerfile: string;
|
|
36
|
+
// };
|
|
37
|
+
// python: {
|
|
38
|
+
// plugins: any[];
|
|
39
|
+
// tests: Record<string, { ports: number }>;
|
|
40
|
+
// loaders: Record<string, string>;
|
|
41
|
+
// checks: IChecks;
|
|
42
|
+
// dockerfile: string;
|
|
43
|
+
// };
|
|
44
|
+
// node: {
|
|
45
|
+
// plugins: any[];
|
|
46
|
+
// tests: Record<string, { ports: number }>;
|
|
47
|
+
// loaders: Record<string, string>;
|
|
48
|
+
// externals: string[];
|
|
49
|
+
// checks: IChecks;
|
|
50
|
+
// dockerfile: string;
|
|
51
|
+
// };
|
|
52
|
+
// web: {
|
|
53
|
+
// plugins: any[];
|
|
54
|
+
// tests: Record<string, { ports: number }>;
|
|
55
|
+
// loaders: Record<string, string>;
|
|
56
|
+
// externals: string[];
|
|
57
|
+
// checks: IChecks;
|
|
58
|
+
// dockerfile: string;
|
|
59
|
+
// };
|
|
60
|
+
// };
|
|
61
|
+
// export type IBuiltConfig = { buildDir: string } & ITestconfig;
|
|
62
|
+
// export type IConfig = Map<string, [IRunTime, string, string, { tests: string[] }]>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// import { ITestconfig } from "../Types";
|
|
1
2
|
export default (config) => {
|
|
2
3
|
return {
|
|
3
4
|
// packages: "external",
|
|
@@ -8,7 +9,7 @@ export default (config) => {
|
|
|
8
9
|
outbase: ".",
|
|
9
10
|
jsx: "transform",
|
|
10
11
|
bundle: true,
|
|
11
|
-
minify: config.minify === true,
|
|
12
|
+
// minify: config.minify === true,
|
|
12
13
|
write: true,
|
|
13
14
|
loader: {
|
|
14
15
|
".js": "jsx",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const nodeDockerComposeFile = (config, container_name,
|
|
1
|
+
export const nodeDockerComposeFile = (config, container_name, projectConfigPath, nodeConfigPath, testName) => {
|
|
2
2
|
return {
|
|
3
3
|
build: {
|
|
4
4
|
context: process.cwd(),
|
|
@@ -13,21 +13,22 @@ export const nodeDockerComposeFile = (config, container_name, fpath) => {
|
|
|
13
13
|
`${process.cwd()}/dist:/workspace/dist`,
|
|
14
14
|
`${process.cwd()}/testeranto:/workspace/testeranto`,
|
|
15
15
|
],
|
|
16
|
-
command: nodeBuildCommand(
|
|
16
|
+
command: nodeBuildCommand(projectConfigPath, nodeConfigPath, testName),
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
19
|
const externalTests = true;
|
|
20
|
-
export const nodeBuildCommand = (
|
|
20
|
+
export const nodeBuildCommand = (projectConfigPath, nodeConfigPath, testName) => {
|
|
21
21
|
if (externalTests) {
|
|
22
|
-
console.log("external tests",
|
|
22
|
+
console.log("external tests", testName);
|
|
23
23
|
// return `cat node_modules/testeranto/src/server/runtimes/node/esbuild.ts`
|
|
24
|
-
return `yarn tsx node_modules/testeranto/src/server/runtimes/node/node.ts ${
|
|
24
|
+
return `yarn tsx node_modules/testeranto/src/server/runtimes/node/node.ts /workspace/testeranto/testeranto.ts ${nodeConfigPath} ${testName}`;
|
|
25
25
|
// return `cat node_modules/testeranto/src/server/runtimes/node/node.ts`
|
|
26
26
|
// return ["sh", "-c", "cd /workspace && javac -cp \".:lib/*\" src/server/runtimes/java/main.java && java -cp \"src/server/runtimes/java:.\" main"]
|
|
27
27
|
}
|
|
28
28
|
else {
|
|
29
29
|
console.log("not external tests");
|
|
30
|
-
return `yarn tsx src/server/runtimes/node/node.ts /workspace/${fpath}`;
|
|
30
|
+
// return `yarn tsx src/server/runtimes/node/node.ts /workspace/${fpath}`;
|
|
31
|
+
return `yarn tsx src/server/runtimes/node/node.ts /workspace/testeranto/testeranto.ts /workspace/${nodeConfigPath} ${testName}`;
|
|
31
32
|
}
|
|
32
33
|
};
|
|
33
34
|
export const nodeBddCommand = (fpath) => {
|
|
@@ -2,34 +2,34 @@ import featuresPlugin from "../../../esbuildConfigs/featuresPlugin.js";
|
|
|
2
2
|
import baseEsBuildConfig from "../../../esbuildConfigs/index.js";
|
|
3
3
|
import inputFilesPlugin from "../../../esbuildConfigs/inputFilesPlugin.js";
|
|
4
4
|
import rebuildPlugin from "../../../esbuildConfigs/rebuildPlugin.js";
|
|
5
|
-
const absoluteBundlesDir = (
|
|
5
|
+
const absoluteBundlesDir = () => {
|
|
6
6
|
return "./testeranto/bundles/allTests/node/";
|
|
7
7
|
};
|
|
8
|
-
export default (
|
|
9
|
-
var _a
|
|
10
|
-
console.log("
|
|
8
|
+
export default (nodeConfig, testName, projectConfig) => {
|
|
9
|
+
var _a;
|
|
10
|
+
console.log("esbuild", testName, projectConfig);
|
|
11
|
+
const entryPoints = projectConfig.runtimes[testName].tests;
|
|
11
12
|
// Get entry points from config, or use a default
|
|
12
|
-
let entrypoints = [];
|
|
13
|
-
if (
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
13
|
+
// let entrypoints: string[] = [];
|
|
14
|
+
// if (nodeConfig) {
|
|
15
|
+
// entrypoints = (projectConfig.tests);
|
|
16
|
+
// } else {
|
|
17
|
+
// // console.log(projectConfig)
|
|
18
|
+
// throw "projectConfig.node.tests should exist"
|
|
19
|
+
// // Fallback to a reasonable default
|
|
20
|
+
// // entrypoints = ["./example/Calculator.test.ts"];
|
|
21
|
+
// // console.warn(`No node.tests found in config, using default entry point: ${entrypoints[0]}`);
|
|
22
|
+
// }
|
|
23
23
|
const { inputFilesPluginFactory, register } = inputFilesPlugin("node", testName);
|
|
24
|
-
return Object.assign(Object.assign({}, baseEsBuildConfig(
|
|
24
|
+
return Object.assign(Object.assign({}, baseEsBuildConfig(nodeConfig)), { outdir: absoluteBundlesDir(), outbase: ".", metafile: true, supported: {
|
|
25
25
|
"dynamic-import": true,
|
|
26
26
|
}, define: {
|
|
27
27
|
"process.env.FLUENTFFMPEG_COV": "0",
|
|
28
28
|
ENV: `"node"`,
|
|
29
|
-
}, bundle: true, format: "esm", absWorkingDir: process.cwd(), platform: "node", packages: "external", entryPoints
|
|
29
|
+
}, bundle: true, format: "esm", absWorkingDir: process.cwd(), platform: "node", packages: "external", entryPoints, plugins: [
|
|
30
30
|
featuresPlugin,
|
|
31
31
|
inputFilesPluginFactory,
|
|
32
32
|
rebuildPlugin("node"),
|
|
33
|
-
...(((
|
|
33
|
+
...(((_a = nodeConfig.plugins) === null || _a === void 0 ? void 0 : _a.map((p) => p(register, entryPoints))) || []),
|
|
34
34
|
] });
|
|
35
35
|
};
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
import esbuild from "esbuild";
|
|
2
|
-
import nodeConfiger from "./esbuild";
|
|
3
2
|
import { processMetafile } from "../common";
|
|
3
|
+
import nodeConfiger from "./esbuild";
|
|
4
4
|
console.log(`[NODE BUILDER] hello: ${process.argv}`);
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const testName =
|
|
5
|
+
const projectConfigPath = process.argv[2];
|
|
6
|
+
const nodeConfigPath = process.argv[3];
|
|
7
|
+
const testName = process.argv[4];
|
|
8
|
+
console.log(`[NODE BUILDER] projectConfigPath: ${projectConfigPath}`);
|
|
8
9
|
console.log(`[NODE BUILDER] nodeConfig: ${nodeConfigPath}`);
|
|
10
|
+
console.log(`[NODE BUILDER] testName: ${testName}`);
|
|
9
11
|
// run esbuild in watch mode using esbuildConfigs. Write to fs the bundle and metafile
|
|
10
|
-
async function startBundling(
|
|
12
|
+
async function startBundling(nodeConfigs, projectConfig) {
|
|
11
13
|
console.log(`[NODE BUILDER] is now bundling: ${testName}`);
|
|
12
|
-
const n = nodeConfiger(
|
|
14
|
+
const n = nodeConfiger(nodeConfigs, testName, projectConfig);
|
|
13
15
|
const buildResult = await esbuild.build(n);
|
|
14
16
|
// const metafilesDir =
|
|
15
17
|
// process.env.METAFILES_DIR || "/workspace/testeranto/metafiles/node";
|
|
16
18
|
if (buildResult.metafile) {
|
|
17
|
-
await processMetafile(
|
|
19
|
+
await processMetafile(projectConfig, buildResult.metafile, 'node');
|
|
18
20
|
}
|
|
19
21
|
else {
|
|
20
22
|
console.warn("No metafile generated by esbuild");
|
|
@@ -22,8 +24,9 @@ async function startBundling(config) {
|
|
|
22
24
|
}
|
|
23
25
|
async function main() {
|
|
24
26
|
try {
|
|
25
|
-
const
|
|
26
|
-
await
|
|
27
|
+
const nodeConfigs = (await import(nodeConfigPath)).default;
|
|
28
|
+
const projectConfigs = (await import(projectConfigPath)).default;
|
|
29
|
+
await startBundling(nodeConfigs, projectConfigs);
|
|
27
30
|
}
|
|
28
31
|
catch (error) {
|
|
29
32
|
console.error("NODE BUILDER: Error importing config:", nodeConfigPath, error);
|
|
@@ -2,9 +2,10 @@ export class Server_Base {
|
|
|
2
2
|
constructor(configs, mode) {
|
|
3
3
|
this.configs = configs;
|
|
4
4
|
this.mode = mode;
|
|
5
|
+
console.log(`[Base] ${this.configs}`);
|
|
5
6
|
}
|
|
6
7
|
async start() {
|
|
7
|
-
console.log(`[Server_Base] start()`)
|
|
8
|
+
// console.log(`[Server_Base] start()`)
|
|
8
9
|
}
|
|
9
10
|
async stop() {
|
|
10
11
|
console.log(`[Server_Base] stop()`);
|
|
@@ -36,15 +36,15 @@ export class Server_Docker extends Server_WS {
|
|
|
36
36
|
staticTestDockerComposeFile(runtime, container_name, command) {
|
|
37
37
|
// Find the dockerfile path from configs
|
|
38
38
|
let dockerfilePath = '';
|
|
39
|
-
for (const [key, value] of this.configs.
|
|
40
|
-
if (value
|
|
41
|
-
dockerfilePath = value
|
|
39
|
+
for (const [key, value] of Object.entries(this.configs.runtimes)) {
|
|
40
|
+
if (value.runtime === runtime) {
|
|
41
|
+
dockerfilePath = value.dockerfile;
|
|
42
42
|
break;
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
// If no dockerfile found, use a default based on runtime
|
|
46
46
|
if (!dockerfilePath) {
|
|
47
|
-
throw (`no dockerfile found for ${dockerfilePath}`);
|
|
47
|
+
throw (`[Docker] [staticTestDockerComposeFile] no dockerfile found for ${dockerfilePath}, ${Object.entries(this.configs)}`);
|
|
48
48
|
}
|
|
49
49
|
return {
|
|
50
50
|
build: {
|
|
@@ -65,15 +65,15 @@ export class Server_Docker extends Server_WS {
|
|
|
65
65
|
bddTestDockerComposeFile(runtime, container_name, command) {
|
|
66
66
|
// Find the dockerfile path from configs
|
|
67
67
|
let dockerfilePath = '';
|
|
68
|
-
for (const [key, value] of this.configs.
|
|
69
|
-
if (value
|
|
70
|
-
dockerfilePath = value
|
|
68
|
+
for (const [key, value] of Object.entries(this.configs.runtimes)) {
|
|
69
|
+
if (value.runtime === runtime) {
|
|
70
|
+
dockerfilePath = value.dockerfile;
|
|
71
71
|
break;
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
// If no dockerfile found, use a default based on runtime
|
|
75
75
|
if (!dockerfilePath) {
|
|
76
|
-
throw (`no dockerfile found for ${dockerfilePath}`);
|
|
76
|
+
throw (`[Docker] [bddTestDockerComposeFile] no dockerfile found for ${dockerfilePath}, ${Object.entries(this.configs)}`);
|
|
77
77
|
}
|
|
78
78
|
const service = {
|
|
79
79
|
build: {
|
|
@@ -119,6 +119,7 @@ export class Server_Docker extends Server_WS {
|
|
|
119
119
|
// config: IBuiltConfig,
|
|
120
120
|
) {
|
|
121
121
|
const services = {};
|
|
122
|
+
console.log("mark1");
|
|
122
123
|
// // Add browser service
|
|
123
124
|
// services['browser'] = {
|
|
124
125
|
// build:
|
|
@@ -153,89 +154,66 @@ export class Server_Docker extends Server_WS {
|
|
|
153
154
|
"java": [javaDockerComposeFile, javaBuildCommand, javaBddCommand]
|
|
154
155
|
};
|
|
155
156
|
// Iterate through each entry in the config Map
|
|
156
|
-
for (const [runtimeTestsName, runtimeTests] of this.configs.
|
|
157
|
-
const runtime = runtimeTests
|
|
158
|
-
const dockerfile = runtimeTests
|
|
159
|
-
const
|
|
160
|
-
const testsObj = runtimeTests
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
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
|
-
const uid = `${runtimeTestsName}-${cleanTestName}`;
|
|
216
|
-
// Add BDD service for this test
|
|
217
|
-
const bddCommandFunc = runTimeToCompose[runtime][2];
|
|
218
|
-
// TODO find filepath
|
|
219
|
-
// const filePath = "testeranto/bundles/allTests/ruby/example/Calculator.test.rb"
|
|
220
|
-
console.log("mark8", testName);
|
|
221
|
-
const filePath = `testeranto/bundles/allTests/${runtime}/${testName}`;
|
|
222
|
-
console.log("mark4", filePath);
|
|
223
|
-
const command = bddCommandFunc(filePath);
|
|
224
|
-
// // Determine the file path to pass to bddCommandFunc
|
|
225
|
-
// let filePath = "";
|
|
226
|
-
// if (typeof testConfig === 'string') {
|
|
227
|
-
// filePath = testConfig;
|
|
228
|
-
// } else if (testConfig && typeof testConfig === 'object') {
|
|
229
|
-
// // Try to get path or entryPoint from test config
|
|
230
|
-
// filePath = testConfig.path || testConfig.entryPoint || "";
|
|
231
|
-
// }
|
|
232
|
-
// const command = bddCommandFunc ? bddCommandFunc(filePath) : "";
|
|
233
|
-
// Only add BDD service if we have a command
|
|
234
|
-
if (command) {
|
|
235
|
-
services[`${uid}-bdd`] = this.bddTestDockerComposeFile(runtime, `${uid}-bdd`, command);
|
|
157
|
+
for (const [runtimeTestsName, runtimeTests] of Object.entries(this.configs.runtimes)) {
|
|
158
|
+
const runtime = runtimeTests.runtime;
|
|
159
|
+
const dockerfile = runtimeTests.dockerfile;
|
|
160
|
+
const buildOptions = runtimeTests.buildOptions;
|
|
161
|
+
const testsObj = runtimeTests.tests;
|
|
162
|
+
// loop over all suites which are of the right runtime
|
|
163
|
+
for (const [t, c] of Object.entries(this.configs.runtimes)) {
|
|
164
|
+
if (c.runtime === runtime) {
|
|
165
|
+
if (RUN_TIMES.includes(runtime)) {
|
|
166
|
+
const buildCommand = runTimeToCompose[runtime][1](buildOptions, c.buildOptions, runtimeTestsName);
|
|
167
|
+
// Add builder service for this runtime
|
|
168
|
+
const builderServiceName = `${runtime}-builder`;
|
|
169
|
+
// Ensure dockerfile path is valid and exists
|
|
170
|
+
let dockerfilePath = dockerfile;
|
|
171
|
+
const fullDockerfilePath = path.join(process.cwd(), dockerfilePath);
|
|
172
|
+
if (!fs.existsSync(fullDockerfilePath)) {
|
|
173
|
+
throw (`[Server_Docker] Dockerfile not found at ${fullDockerfilePath}`);
|
|
174
|
+
}
|
|
175
|
+
services[builderServiceName] = {
|
|
176
|
+
build: {
|
|
177
|
+
context: process.cwd(),
|
|
178
|
+
dockerfile: dockerfilePath,
|
|
179
|
+
},
|
|
180
|
+
container_name: builderServiceName,
|
|
181
|
+
environment: {},
|
|
182
|
+
working_dir: "/workspace",
|
|
183
|
+
volumes: [
|
|
184
|
+
`${process.cwd()}/src:/workspace/src`,
|
|
185
|
+
`${process.cwd()}/example:/workspace/example`,
|
|
186
|
+
`${process.cwd()}/dist:/workspace/dist`,
|
|
187
|
+
`${process.cwd()}/testeranto:/workspace/testeranto`,
|
|
188
|
+
],
|
|
189
|
+
command: buildCommand,
|
|
190
|
+
networks: ["allTests_network"],
|
|
191
|
+
};
|
|
192
|
+
for (const tName of testsObj) {
|
|
193
|
+
// Clean the test name for use in container names
|
|
194
|
+
// Handle numeric test names (like '0') by converting to string
|
|
195
|
+
// const testNameStr = String(testName);
|
|
196
|
+
const cleanTestName = tName.toLowerCase()
|
|
197
|
+
.replaceAll("/", "_")
|
|
198
|
+
.replaceAll(".", "-")
|
|
199
|
+
.replace(/[^a-z0-9_-]/g, '');
|
|
200
|
+
// Generate UID using the runtimeTestsName (e.g., 'nodeTests') and clean test name
|
|
201
|
+
const uid = `${runtimeTestsName.toLowerCase()}-${cleanTestName}`;
|
|
202
|
+
// Add BDD service for this test
|
|
203
|
+
const bddCommandFunc = runTimeToCompose[runtime][2];
|
|
204
|
+
// TODO find filepath
|
|
205
|
+
// const filePath = "testeranto/bundles/allTests/ruby/example/Calculator.test.rb"
|
|
206
|
+
const filePath = `testeranto/bundles/allTests/${runtime}/${tName}`;
|
|
207
|
+
const command = bddCommandFunc(filePath);
|
|
208
|
+
console.log("wtf command", command);
|
|
209
|
+
services[`${uid}-bdd`] = this.bddTestDockerComposeFile(runtime, `${uid}-bdd`, command);
|
|
210
|
+
services[`${uid}-aider`] = this.aiderDockerComposeFile(`${uid}-aider`);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
else {
|
|
214
|
+
throw `unknown runtime ${runtime}`;
|
|
215
|
+
}
|
|
236
216
|
}
|
|
237
|
-
// Always add aider service
|
|
238
|
-
services[`${uid}-aider`] = this.aiderDockerComposeFile(`${uid}-aider`);
|
|
239
217
|
}
|
|
240
218
|
}
|
|
241
219
|
// Ensure all services use the same network configuration
|
|
@@ -463,10 +441,10 @@ ${x}
|
|
|
463
441
|
console.log(`[Server_Docker] Waiting for browser container to be healthy...`);
|
|
464
442
|
await this.waitForContainerHealthy('browser-allTests', 60000); // 60 seconds max
|
|
465
443
|
// Start aider services
|
|
466
|
-
for (const [configKey, configValue] of this.configs.
|
|
467
|
-
const runtime = configValue
|
|
468
|
-
const testsObj = configValue[3];
|
|
469
|
-
const tests =
|
|
444
|
+
for (const [configKey, configValue] of Object.entries(this.configs.runtimes)) {
|
|
445
|
+
const runtime = configValue.runtime;
|
|
446
|
+
// const testsObj = configValue[3];
|
|
447
|
+
const tests = configValue.tests;
|
|
470
448
|
console.log(`[Server_Docker] Found tests for ${runtime}:`, (JSON.stringify(tests)));
|
|
471
449
|
for (const testName of tests) {
|
|
472
450
|
// Generate the UID exactly as DockerManager does
|
|
@@ -488,10 +466,14 @@ ${x}
|
|
|
488
466
|
}
|
|
489
467
|
// Start BDD test services
|
|
490
468
|
// TODO these logs from these services should be saved into reports
|
|
491
|
-
for (const [configKey, configValue] of this.configs.
|
|
492
|
-
const runtime = configValue
|
|
493
|
-
const testsObj = configValue[3];
|
|
494
|
-
const tests =
|
|
469
|
+
for (const [configKey, configValue] of Object.entries(this.configs.runtimes)) {
|
|
470
|
+
const runtime = configValue.runtime;
|
|
471
|
+
// const testsObj = configValue[3];
|
|
472
|
+
const tests = configValue.tests;
|
|
473
|
+
console.log(`[Server_Docker] Found tests for ${runtime}:`, (JSON.stringify(tests)));
|
|
474
|
+
// const runtime = configValue[0];
|
|
475
|
+
// const testsObj = configValue[3];
|
|
476
|
+
// const tests = testsObj?.tests || {};
|
|
495
477
|
for (const testName of tests) {
|
|
496
478
|
const uid = `${configKey}-${testName.toLowerCase().replaceAll("/", "_").replaceAll(".", "-")}`;
|
|
497
479
|
const bddServiceName = `${uid}-bdd`;
|
|
@@ -517,7 +499,7 @@ ${x}
|
|
|
517
499
|
}
|
|
518
500
|
// Start static test services
|
|
519
501
|
// TODO these logs from these services should be saved into reports
|
|
520
|
-
for (const [configKey, configValue] of this.configs
|
|
502
|
+
for (const [configKey, configValue] of Object.entries(this.configs)) {
|
|
521
503
|
const runtime = configValue[0];
|
|
522
504
|
const testsObj = configValue[3];
|
|
523
505
|
const tests = (testsObj === null || testsObj === void 0 ? void 0 : testsObj.tests) || {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const fs = await import('fs/promises');
|
|
2
|
-
const yaml = await import('yaml');
|
|
3
|
-
import path from "path";
|
|
2
|
+
// const yaml = await import('yaml');
|
|
3
|
+
// import path from "path";
|
|
4
4
|
import { Server } from "./server/serverClasees/Server";
|
|
5
5
|
const mode = process.argv[3];
|
|
6
6
|
if (mode !== "once" && mode !== "dev") {
|
|
@@ -8,32 +8,33 @@ if (mode !== "once" && mode !== "dev") {
|
|
|
8
8
|
process.exit(-1);
|
|
9
9
|
}
|
|
10
10
|
const main = async () => {
|
|
11
|
-
const yamlPath = path.join(process.cwd(), 'testeranto/testeranto.yml');
|
|
12
|
-
const yamlContent = await fs.readFile(yamlPath, 'utf-8');
|
|
13
|
-
const parsed = yaml.parse(yamlContent);
|
|
14
|
-
const config = new Map();
|
|
15
|
-
for (const [key, value] of Object.entries(parsed)) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
11
|
+
// const yamlPath = path.join(process.cwd(), 'testeranto/testeranto.yml');
|
|
12
|
+
// const yamlContent = await fs.readFile(yamlPath, 'utf-8');
|
|
13
|
+
// const parsed = yaml.parse(yamlContent);
|
|
14
|
+
// const config: ITestconfigV2 = new Map();
|
|
15
|
+
// for (const [key, value] of Object.entries(parsed)) {
|
|
16
|
+
// if (Array.isArray(value) && value.length >= 4) {
|
|
17
|
+
// // The first three elements are runtime, dockerfile, script
|
|
18
|
+
// const runtime = String(value[0]) as IRunTime;
|
|
19
|
+
// const dockerfile = String(value[1]);
|
|
20
|
+
// const script = String(value[2]);
|
|
21
|
+
// // The fourth element should be an object with tests
|
|
22
|
+
// let testsObj = { tests: [] as string[] };
|
|
23
|
+
// const fourth = value[3];
|
|
24
|
+
// if (fourth && typeof fourth === 'object' && fourth !== null) {
|
|
25
|
+
// const testsData = fourth as any;
|
|
26
|
+
// if (testsData.tests && Array.isArray(testsData.tests)) {
|
|
27
|
+
// testsObj.tests = testsData.tests.map((t: any) => String(t));
|
|
28
|
+
// }
|
|
29
|
+
// }
|
|
30
|
+
// config.set(key, [runtime, dockerfile, script, testsObj]);
|
|
31
|
+
// } else {
|
|
32
|
+
// console.warn(`Skipping entry ${key}: expected array with at least 4 elements, got`, value);
|
|
33
|
+
// }
|
|
34
|
+
// }
|
|
35
|
+
// console.log('Parsed config:', Array.from(config.entries()));
|
|
36
|
+
const config = (await import('../testeranto/testeranto.ts')).default;
|
|
37
|
+
console.log("mark123", config);
|
|
37
38
|
await new Server(config, mode).start();
|
|
38
39
|
};
|
|
39
40
|
main();
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
const config = {
|
|
2
|
+
featureIngestor: function (s) {
|
|
3
|
+
throw new Error("Function not implemented.");
|
|
4
|
+
},
|
|
5
|
+
runtimes: {
|
|
6
|
+
nodetests: ({
|
|
7
|
+
runtime: "node",
|
|
8
|
+
tests: ["example/Calculator.test.ts"],
|
|
9
|
+
checks: [
|
|
10
|
+
(x) => `yarn eslint`,
|
|
11
|
+
(x) => `yarn tsc --noEmit`,
|
|
12
|
+
],
|
|
13
|
+
dockerfile: `testeranto/runtimes/node/node.Dockerfile`,
|
|
14
|
+
buildOptions: `testeranto/runtimes/node/node.ts`
|
|
15
|
+
}),
|
|
16
|
+
webtests: ({
|
|
17
|
+
runtime: "web",
|
|
18
|
+
tests: ["example/Calculator.test.ts"],
|
|
19
|
+
checks: [
|
|
20
|
+
(x) => `yarn eslint`,
|
|
21
|
+
(x) => `yarn tsc --noEmit`,
|
|
22
|
+
],
|
|
23
|
+
dockerfile: `testeranto/runtimes/web/web.Dockerfile`,
|
|
24
|
+
buildOptions: `testeranto/runtimes/web/web.ts`
|
|
25
|
+
}),
|
|
26
|
+
pythontests: ({
|
|
27
|
+
runtime: "python",
|
|
28
|
+
tests: ["example/Calculator.test.py"],
|
|
29
|
+
checks: [
|
|
30
|
+
(x) => `yarn eslint`,
|
|
31
|
+
(x) => `yarn tsc --noEmit`,
|
|
32
|
+
],
|
|
33
|
+
dockerfile: `testeranto/runtimes/python/python.Dockerfile`,
|
|
34
|
+
buildOptions: `testeranto/runtimes/python/python.ts`
|
|
35
|
+
}),
|
|
36
|
+
golangtests: ({
|
|
37
|
+
runtime: "golang",
|
|
38
|
+
tests: ["example/Calculator.test.go"],
|
|
39
|
+
checks: [
|
|
40
|
+
(x) => `yarn eslint`,
|
|
41
|
+
(x) => `yarn tsc --noEmit`,
|
|
42
|
+
],
|
|
43
|
+
dockerfile: `testeranto/runtimes/golang/golang.Dockerfile`,
|
|
44
|
+
buildOptions: `testeranto/runtimes/golang/golang.ts`
|
|
45
|
+
}),
|
|
46
|
+
rusttests: ({
|
|
47
|
+
runtime: "rust",
|
|
48
|
+
tests: ["example/Calculator.test.rs"],
|
|
49
|
+
checks: [
|
|
50
|
+
(x) => `yarn eslint`,
|
|
51
|
+
(x) => `yarn tsc --noEmit`,
|
|
52
|
+
],
|
|
53
|
+
dockerfile: `testeranto/runtimes/rust/rust.Dockerfile`,
|
|
54
|
+
buildOptions: `testeranto/runtimes/rust/rust.ts`
|
|
55
|
+
}),
|
|
56
|
+
rubytests: ({
|
|
57
|
+
runtime: "ruby",
|
|
58
|
+
tests: ["example/Calculator.test.rb"],
|
|
59
|
+
checks: [
|
|
60
|
+
(x) => `yarn eslint`,
|
|
61
|
+
(x) => `yarn tsc --noEmit`,
|
|
62
|
+
],
|
|
63
|
+
dockerfile: `testeranto/runtimes/ruby/ruby.Dockerfile`,
|
|
64
|
+
buildOptions: `testeranto/runtimes/ruby/ruby.ts`
|
|
65
|
+
}),
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
export default config;
|