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.
Files changed (126) hide show
  1. package/dist/common/src/Types.js +61 -0
  2. package/dist/common/src/esbuildConfigs/index.js +2 -1
  3. package/dist/common/src/server/runtimes/node/docker.js +7 -6
  4. package/dist/common/src/server/runtimes/node/esbuild.js +18 -18
  5. package/dist/common/src/server/runtimes/node/node.js +12 -8
  6. package/dist/common/src/server/serverClasees/Server_Base.js +2 -1
  7. package/dist/common/src/server/serverClasees/Server_Docker.js +81 -99
  8. package/dist/common/src/testeranto.js +29 -31
  9. package/dist/common/testeranto/runtimes/node/node.js +2 -1
  10. package/dist/common/testeranto/testeranto.js +70 -0
  11. package/dist/common/tsconfig.common.tsbuildinfo +1 -1
  12. package/dist/module/src/Types.js +61 -0
  13. package/dist/module/src/esbuildConfigs/index.js +2 -1
  14. package/dist/module/src/server/runtimes/node/docker.js +7 -6
  15. package/dist/module/src/server/runtimes/node/esbuild.js +18 -18
  16. package/dist/module/src/server/runtimes/node/node.js +12 -8
  17. package/dist/module/src/server/serverClasees/Server_Base.js +2 -1
  18. package/dist/module/src/server/serverClasees/Server_Docker.js +81 -99
  19. package/dist/module/src/testeranto.js +29 -28
  20. package/dist/module/testeranto/runtimes/node/node.js +2 -1
  21. package/dist/module/testeranto/testeranto.js +68 -0
  22. package/dist/module/tsconfig.module.tsbuildinfo +1 -1
  23. package/dist/prebuild/{chunk-MU5PJQAO.mjs → chunk-QLT7PNPK.mjs} +3 -3
  24. package/dist/prebuild/server/runtimes/node/node.mjs +20 -21
  25. package/dist/prebuild/server/runtimes/web/web.mjs +1 -1
  26. package/dist/prebuild/testeranto-6SAYRVSE.mjs +72 -0
  27. package/dist/prebuild/testeranto.mjs +75 -108
  28. package/dist/types/{Types.d.ts → src/Types.d.ts} +14 -79
  29. package/dist/types/src/esbuildConfigs/index.d.ts +3 -0
  30. package/dist/types/{server → src/server}/runtimes/golang/docker.d.ts +2 -2
  31. package/dist/types/src/server/runtimes/node/docker.d.ts +14 -0
  32. package/dist/types/src/server/runtimes/node/esbuild.d.ts +4 -0
  33. package/dist/types/{server → src/server}/serverClasees/Server.d.ts +2 -2
  34. package/dist/types/{server → src/server}/serverClasees/Server_Base.d.ts +3 -3
  35. package/dist/types/{server → src/server}/serverClasees/Server_Docker.d.ts +2 -2
  36. package/dist/types/{server → src/server}/serverClasees/Server_HTTP.d.ts +2 -2
  37. package/dist/types/{server → src/server}/serverClasees/Server_WS.d.ts +2 -2
  38. package/dist/types/testeranto/testeranto.d.ts +3 -0
  39. package/dist/types/tsconfig.types.tsbuildinfo +1 -1
  40. package/package.json +1 -1
  41. package/src/Types.ts +132 -69
  42. package/src/esbuildConfigs/index.ts +4 -3
  43. package/src/lib/pitono/pyproject.toml +1 -1
  44. package/src/server/runtimes/golang/docker.ts +2 -2
  45. package/src/server/runtimes/node/docker.ts +10 -7
  46. package/src/server/runtimes/node/esbuild.ts +21 -19
  47. package/src/server/runtimes/node/node.ts +14 -9
  48. package/src/server/serverClasees/Server.ts +3 -2
  49. package/src/server/serverClasees/Server_Base.ts +7 -6
  50. package/src/server/serverClasees/Server_Docker.ts +105 -111
  51. package/src/server/serverClasees/Server_HTTP.ts +2 -2
  52. package/src/server/serverClasees/Server_WS.ts +2 -2
  53. package/src/testeranto.ts +37 -32
  54. package/testeranto/bundles/allTests/node/{Node-JOOBJDHW.mjs → Node-MSIIDKGC.mjs} +64 -28
  55. package/testeranto/docker-compose.yml +34 -74
  56. package/testeranto/runtimes/node/node.Dockerfile +0 -1
  57. package/testeranto/runtimes/node/node.ts +2 -1
  58. package/testeranto/testeranto.ts +90 -0
  59. package/tsconfig.json +1 -1
  60. package/allTests.ts +0 -52
  61. package/dist/common/allTests.js +0 -39
  62. package/dist/module/allTests.js +0 -37
  63. package/dist/types/esbuildConfigs/index.d.ts +0 -4
  64. package/dist/types/server/runtimes/node/docker.d.ts +0 -14
  65. package/dist/types/server/runtimes/node/esbuild.d.ts +0 -4
  66. /package/dist/types/{Init.d.ts → src/Init.d.ts} +0 -0
  67. /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/consoleDetectorPlugin.d.ts +0 -0
  68. /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/eslint-formatter-testeranto.d.ts +0 -0
  69. /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/featuresPlugin.d.ts +0 -0
  70. /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/inputFilesPlugin.d.ts +0 -0
  71. /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/nativeImportDetectorPlugin.d.ts +0 -0
  72. /package/dist/types/{esbuildConfigs → src/esbuildConfigs}/rebuildPlugin.d.ts +0 -0
  73. /package/dist/types/{init-docs.d.ts → src/init-docs.d.ts} +0 -0
  74. /package/dist/types/{lib → src/lib}/tiposkripto/BaseGiven.d.ts +0 -0
  75. /package/dist/types/{lib → src/lib}/tiposkripto/BaseSuite.d.ts +0 -0
  76. /package/dist/types/{lib → src/lib}/tiposkripto/BaseThen.d.ts +0 -0
  77. /package/dist/types/{lib → src/lib}/tiposkripto/BaseTiposkripto.d.ts +0 -0
  78. /package/dist/types/{lib → src/lib}/tiposkripto/BaseWhen.d.ts +0 -0
  79. /package/dist/types/{lib → src/lib}/tiposkripto/CoreTypes.d.ts +0 -0
  80. /package/dist/types/{lib → src/lib}/tiposkripto/Node.d.ts +0 -0
  81. /package/dist/types/{lib → src/lib}/tiposkripto/Tiposkripto.d.ts +0 -0
  82. /package/dist/types/{lib → src/lib}/tiposkripto/Types.d.ts +0 -0
  83. /package/dist/types/{lib → src/lib}/tiposkripto/Web.d.ts +0 -0
  84. /package/dist/types/{lib → src/lib}/tiposkripto/abstractBase.test/MockGiven.d.ts +0 -0
  85. /package/dist/types/{lib → src/lib}/tiposkripto/abstractBase.test/MockThen.d.ts +0 -0
  86. /package/dist/types/{lib → src/lib}/tiposkripto/abstractBase.test/MockWhen.d.ts +0 -0
  87. /package/dist/types/{lib → src/lib}/tiposkripto/abstractBase.test/adapter.d.ts +0 -0
  88. /package/dist/types/{lib → src/lib}/tiposkripto/abstractBase.test/implementation.d.ts +0 -0
  89. /package/dist/types/{lib → src/lib}/tiposkripto/abstractBase.test/index.d.ts +0 -0
  90. /package/dist/types/{lib → src/lib}/tiposkripto/abstractBase.test/specification.d.ts +0 -0
  91. /package/dist/types/{lib → src/lib}/tiposkripto/abstractBase.test/types.d.ts +0 -0
  92. /package/dist/types/{lib → src/lib}/tiposkripto/index.d.ts +0 -0
  93. /package/dist/types/{runtimes.d.ts → src/runtimes.d.ts} +0 -0
  94. /package/dist/types/{server → src/server}/aider/configParser.d.ts +0 -0
  95. /package/dist/types/{server → src/server}/aider/docker.d.ts +0 -0
  96. /package/dist/types/{server → src/server}/getRunnables.d.ts +0 -0
  97. /package/dist/types/{server → src/server}/htmlTemplate.d.ts +0 -0
  98. /package/dist/types/{server → src/server}/nodeVersion.d.ts +0 -0
  99. /package/dist/types/{server → src/server}/runtimes/common.d.ts +0 -0
  100. /package/dist/types/{server → src/server}/runtimes/java/docker.d.ts +0 -0
  101. /package/dist/types/{server → src/server}/runtimes/node/node.d.ts +0 -0
  102. /package/dist/types/{server → src/server}/runtimes/python/docker.d.ts +0 -0
  103. /package/dist/types/{server → src/server}/runtimes/ruby/docker.d.ts +0 -0
  104. /package/dist/types/{server → src/server}/runtimes/rust/docker.d.ts +0 -0
  105. /package/dist/types/{server → src/server}/runtimes/web/docker.d.ts +0 -0
  106. /package/dist/types/{server → src/server}/runtimes/web/esbuild.d.ts +0 -0
  107. /package/dist/types/{server → src/server}/runtimes/web/hoist.d.ts +0 -0
  108. /package/dist/types/{server → src/server}/runtimes/web/web.d.ts +0 -0
  109. /package/dist/types/{server → src/server}/serverClasees/Server_FS.d.ts +0 -0
  110. /package/dist/types/{server → src/server}/serverManagers/DockerManager.d.ts +0 -0
  111. /package/dist/types/{server → src/server}/serverManagers/HttpManager.d.ts +0 -0
  112. /package/dist/types/{server → src/server}/serverManagers/WsManager.d.ts +0 -0
  113. /package/dist/types/{server → src/server}/serverManagers/fs.d.ts +0 -0
  114. /package/dist/types/{server → src/server}/serverManagers/tcp.d.ts +0 -0
  115. /package/dist/types/{server → src/server}/types.d.ts +0 -0
  116. /package/dist/types/{testeranto.d.ts → src/testeranto.d.ts} +0 -0
  117. /package/dist/types/{vscode → src/vscode}/TerminalManager.d.ts +0 -0
  118. /package/dist/types/{vscode → src/vscode}/TestTreeItem.d.ts +0 -0
  119. /package/dist/types/{vscode → src/vscode}/extension.d.ts +0 -0
  120. /package/dist/types/{vscode → src/vscode}/providers/FeaturesTreeDataProvider.d.ts +0 -0
  121. /package/dist/types/{vscode → src/vscode}/providers/FileTreeDataProvider.d.ts +0 -0
  122. /package/dist/types/{vscode → src/vscode}/providers/ProcessesTreeDataProvider.d.ts +0 -0
  123. /package/dist/types/{vscode → src/vscode}/providers/ResultsTreeDataProvider.d.ts +0 -0
  124. /package/dist/types/{vscode → src/vscode}/providers/TestTreeDataProvider.d.ts +0 -0
  125. /package/dist/types/{vscode → src/vscode}/types.d.ts +0 -0
  126. /package/testeranto/{testeranto.yml → testeranto-deprecateed.yml} +0 -0
@@ -5,7 +5,7 @@ import yaml from "js-yaml";
5
5
  import path from "path";
6
6
  import { promisify } from "util";
7
7
  import { RUN_TIMES } from "../../runtimes";
8
- import { IConfig, IRunTime } from "../../Types";
8
+ import { ITestconfigV2, IRunTime } from "../../Types";
9
9
  import { golangBddCommand, golangBuildCommand, golangDockerComposeFile } from "../runtimes/golang/docker";
10
10
  import { javaBddCommand, javaBuildCommand, javaDockerComposeFile } from "../runtimes/java/docker";
11
11
  import { nodeBddCommand, nodeBuildCommand, nodeDockerComposeFile } from "../runtimes/node/docker";
@@ -28,7 +28,7 @@ export interface IDockerComposeResult {
28
28
  export class Server_Docker extends Server_WS {
29
29
  private logProcesses: Map<string, { process: any; serviceName: string }> = new Map();
30
30
 
31
- constructor(configs: IConfig, mode: IMode) {
31
+ constructor(configs: ITestconfigV2, mode: IMode) {
32
32
  super(configs, mode);
33
33
  }
34
34
 
@@ -49,19 +49,18 @@ export class Server_Docker extends Server_WS {
49
49
  }
50
50
 
51
51
  staticTestDockerComposeFile(runtime: IRunTime, container_name: string, command: string) {
52
-
53
52
  // Find the dockerfile path from configs
54
53
  let dockerfilePath = '';
55
- for (const [key, value] of this.configs.entries()) {
56
- if (value[0] === runtime) {
57
- dockerfilePath = value[1];
54
+ for (const [key, value] of Object.entries(this.configs.runtimes)) {
55
+ if (value.runtime === runtime) {
56
+ dockerfilePath = value.dockerfile;
58
57
  break;
59
58
  }
60
59
  }
61
60
 
62
61
  // If no dockerfile found, use a default based on runtime
63
62
  if (!dockerfilePath) {
64
- throw (`no dockerfile found for ${dockerfilePath}`)
63
+ throw (`[Docker] [staticTestDockerComposeFile] no dockerfile found for ${dockerfilePath}, ${Object.entries(this.configs)}`)
65
64
  }
66
65
 
67
66
  return {
@@ -83,16 +82,16 @@ export class Server_Docker extends Server_WS {
83
82
  bddTestDockerComposeFile(runtime: IRunTime, container_name: string, command: string) {
84
83
  // Find the dockerfile path from configs
85
84
  let dockerfilePath = '';
86
- for (const [key, value] of this.configs.entries()) {
87
- if (value[0] === runtime) {
88
- dockerfilePath = value[1];
85
+ for (const [key, value] of Object.entries(this.configs.runtimes)) {
86
+ if (value.runtime === runtime) {
87
+ dockerfilePath = value.dockerfile;
89
88
  break;
90
89
  }
91
90
  }
92
91
 
93
92
  // If no dockerfile found, use a default based on runtime
94
93
  if (!dockerfilePath) {
95
- throw (`no dockerfile found for ${dockerfilePath}`)
94
+ throw (`[Docker] [bddTestDockerComposeFile] no dockerfile found for ${dockerfilePath}, ${Object.entries(this.configs)}`)
96
95
  }
97
96
 
98
97
  const service: any = {
@@ -141,6 +140,7 @@ export class Server_Docker extends Server_WS {
141
140
  ): Record<string, any> {
142
141
  const services: IService = {};
143
142
 
143
+ console.log("mark1")
144
144
  // // Add browser service
145
145
  // services['browser'] = {
146
146
 
@@ -172,12 +172,14 @@ export class Server_Docker extends Server_WS {
172
172
 
173
173
  const runTimeToCompose: Record<IRunTime, [
174
174
  (
175
- config: IConfig,
175
+ config: ITestconfigV2,
176
176
  container_name: string,
177
- fpath: string
177
+ projectConfigPath: string,
178
+ nodeConfigPath: string,
179
+ testName: string
178
180
  ) => object,
179
181
 
180
- (fpath: string) => string,
182
+ (projectConfig: string, nodeConfigPath: string, testname: string) => string,
181
183
  (fpath: string) => string,
182
184
  ]> = {
183
185
  'node': [nodeDockerComposeFile, nodeBuildCommand, nodeBddCommand],
@@ -190,103 +192,88 @@ export class Server_Docker extends Server_WS {
190
192
  };
191
193
 
192
194
  // Iterate through each entry in the config Map
193
- for (const [runtimeTestsName, runtimeTests] of this.configs.entries()) {
194
- const runtime: IRunTime = runtimeTests[0];
195
- const dockerfile = runtimeTests[1];
196
- const runtimeConfig = runtimeTests[2];
197
- const testsObj = runtimeTests[3];
195
+ for (const [runtimeTestsName, runtimeTests] of Object.entries(this.configs.runtimes)) {
196
+
197
+ const runtime: IRunTime = runtimeTests.runtime as IRunTime;
198
+ const dockerfile = runtimeTests.dockerfile;
199
+ const buildOptions = runtimeTests.buildOptions;
200
+ const testsObj = runtimeTests.tests
201
+
202
+ // loop over all suites which are of the right runtime
203
+ for (const [t, c] of Object.entries(this.configs.runtimes)) {
204
+ if (c.runtime === runtime) {
205
+ if (RUN_TIMES.includes(runtime)) {
206
+ const buildCommand = runTimeToCompose[runtime][1](
207
+ buildOptions,
208
+ c.buildOptions,
209
+ runtimeTestsName
210
+ )
211
+
212
+ // Add builder service for this runtime
213
+ const builderServiceName = `${runtime}-builder`;
214
+
215
+ // Ensure dockerfile path is valid and exists
216
+ let dockerfilePath = dockerfile;
217
+ const fullDockerfilePath = path.join(process.cwd(), dockerfilePath);
218
+ if (!fs.existsSync(fullDockerfilePath)) {
219
+ throw (`[Server_Docker] Dockerfile not found at ${fullDockerfilePath}`);
198
220
 
199
- const buildCommand = runTimeToCompose[runtime][1](runtimeConfig)
221
+ }
200
222
 
201
- if (RUN_TIMES.includes(runtime)) {
202
- // Add builder service for this runtime
203
- const builderServiceName = `${runtime}-builder`;
223
+ services[builderServiceName] = {
224
+ build: {
225
+ context: process.cwd(),
226
+ dockerfile: dockerfilePath,
227
+ },
228
+ container_name: builderServiceName,
229
+ environment: {},
230
+ working_dir: "/workspace",
231
+ volumes: [
232
+ `${process.cwd()}/src:/workspace/src`,
233
+ `${process.cwd()}/example:/workspace/example`,
234
+ `${process.cwd()}/dist:/workspace/dist`,
235
+ `${process.cwd()}/testeranto:/workspace/testeranto`,
236
+ ],
237
+ command: buildCommand,
238
+ networks: ["allTests_network"],
239
+ };
240
+
241
+
242
+ for (const tName of testsObj) {
243
+ // Clean the test name for use in container names
244
+ // Handle numeric test names (like '0') by converting to string
245
+ // const testNameStr = String(testName);
246
+ const cleanTestName = tName.toLowerCase()
247
+ .replaceAll("/", "_")
248
+ .replaceAll(".", "-")
249
+ .replace(/[^a-z0-9_-]/g, '');
250
+
251
+ // Generate UID using the runtimeTestsName (e.g., 'nodeTests') and clean test name
252
+ const uid = `${runtimeTestsName.toLowerCase()}-${cleanTestName}`;
253
+
254
+ // Add BDD service for this test
255
+ const bddCommandFunc = runTimeToCompose[runtime][2];
256
+ // TODO find filepath
257
+ // const filePath = "testeranto/bundles/allTests/ruby/example/Calculator.test.rb"
258
+
259
+ const filePath = `testeranto/bundles/allTests/${runtime}/${tName}`
260
+ const command = bddCommandFunc(filePath)
261
+ console.log("wtf command", command)
262
+
263
+ services[`${uid}-bdd`] = this.bddTestDockerComposeFile(runtime, `${uid}-bdd`, command);
264
+ services[`${uid}-aider`] = this.aiderDockerComposeFile(`${uid}-aider`);
265
+ }
204
266
 
205
- // Ensure dockerfile path is valid and exists
206
- let dockerfilePath = dockerfile;
207
- const fullDockerfilePath = path.join(process.cwd(), dockerfilePath);
208
- if (!fs.existsSync(fullDockerfilePath)) {
209
- throw (`[Server_Docker] Dockerfile not found at ${fullDockerfilePath}`);
210
267
 
211
- }
212
268
 
213
- services[builderServiceName] = {
214
- build: {
215
- context: process.cwd(),
216
- dockerfile: dockerfilePath,
217
- },
218
- container_name: builderServiceName,
219
- environment: {},
220
- working_dir: "/workspace",
221
- volumes: [
222
- `${process.cwd()}/src:/workspace/src`,
223
- `${process.cwd()}/example:/workspace/example`,
224
- `${process.cwd()}/dist:/workspace/dist`,
225
- `${process.cwd()}/testeranto:/workspace/testeranto`,
226
- ],
227
- command: buildCommand,
228
- networks: ["allTests_network"],
229
- };
230
269
 
231
- } else {
232
- throw `unknown runtime ${runtime}`;
233
- }
234
-
235
- const testEntries = testsObj.tests.map(test => {
236
- if (typeof test === 'string') {
237
- return { name: test, config: {} };
238
- } else if (test && typeof test === 'object') {
239
- return {
240
- name: test.name || test.testName || 'unknown',
241
- config: test
242
- };
243
- } else {
244
- return { name: String(test), config: {} };
245
- }
246
- });
270
+ } else {
271
+ throw `unknown runtime ${runtime}`;
272
+ }
247
273
 
248
- for (const { name: testName, config: testConfig } of testEntries) {
249
- // Clean the test name for use in container names
250
- // Handle numeric test names (like '0') by converting to string
251
- const testNameStr = String(testName);
252
- const cleanTestName = testNameStr.toLowerCase()
253
- .replaceAll("/", "_")
254
- .replaceAll(".", "-")
255
- .replace(/[^a-z0-9_-]/g, '');
256
-
257
- // Generate UID using the runtimeTestsName (e.g., 'nodeTests') and clean test name
258
- const uid = `${runtimeTestsName}-${cleanTestName}`;
259
-
260
- // Add BDD service for this test
261
- const bddCommandFunc = runTimeToCompose[runtime][2];
262
- // TODO find filepath
263
- // const filePath = "testeranto/bundles/allTests/ruby/example/Calculator.test.rb"
264
-
265
- console.log("mark8", testName)
266
- const filePath = `testeranto/bundles/allTests/${runtime}/${testName}`
267
- console.log("mark4", filePath)
268
-
269
- const command = bddCommandFunc(filePath)
270
-
271
- // // Determine the file path to pass to bddCommandFunc
272
- // let filePath = "";
273
- // if (typeof testConfig === 'string') {
274
- // filePath = testConfig;
275
- // } else if (testConfig && typeof testConfig === 'object') {
276
- // // Try to get path or entryPoint from test config
277
- // filePath = testConfig.path || testConfig.entryPoint || "";
278
- // }
279
-
280
- // const command = bddCommandFunc ? bddCommandFunc(filePath) : "";
281
-
282
- // Only add BDD service if we have a command
283
- if (command) {
284
- services[`${uid}-bdd`] = this.bddTestDockerComposeFile(runtime, `${uid}-bdd`, command);
285
274
  }
286
-
287
- // Always add aider service
288
- services[`${uid}-aider`] = this.aiderDockerComposeFile(`${uid}-aider`);
289
275
  }
276
+
290
277
  }
291
278
 
292
279
  // Ensure all services use the same network configuration
@@ -553,10 +540,10 @@ ${x}
553
540
  await this.waitForContainerHealthy('browser-allTests', 60000); // 60 seconds max
554
541
 
555
542
  // Start aider services
556
- for (const [configKey, configValue] of this.configs.entries()) {
557
- const runtime = configValue[0];
558
- const testsObj = configValue[3];
559
- const tests = testsObj?.tests || {};
543
+ for (const [configKey, configValue] of Object.entries(this.configs.runtimes)) {
544
+ const runtime = configValue.runtime
545
+ // const testsObj = configValue[3];
546
+ const tests = configValue.tests
560
547
 
561
548
  console.log(`[Server_Docker] Found tests for ${runtime}:`, (JSON.stringify(tests)));
562
549
 
@@ -582,10 +569,17 @@ ${x}
582
569
 
583
570
  // Start BDD test services
584
571
  // TODO these logs from these services should be saved into reports
585
- for (const [configKey, configValue] of this.configs.entries()) {
586
- const runtime = configValue[0];
587
- const testsObj = configValue[3];
588
- const tests = testsObj?.tests || {};
572
+ for (const [configKey, configValue] of Object.entries(this.configs.runtimes)) {
573
+
574
+ const runtime = configValue.runtime
575
+ // const testsObj = configValue[3];
576
+ const tests = configValue.tests
577
+
578
+ console.log(`[Server_Docker] Found tests for ${runtime}:`, (JSON.stringify(tests)));
579
+
580
+ // const runtime = configValue[0];
581
+ // const testsObj = configValue[3];
582
+ // const tests = testsObj?.tests || {};
589
583
 
590
584
  for (const testName of tests) {
591
585
  const uid = `${configKey}-${testName.toLowerCase().replaceAll("/", "_").replaceAll(".", "-")}`;
@@ -615,7 +609,7 @@ ${x}
615
609
 
616
610
  // Start static test services
617
611
  // TODO these logs from these services should be saved into reports
618
- for (const [configKey, configValue] of this.configs.entries()) {
612
+ for (const [configKey, configValue] of Object.entries(this.configs)) {
619
613
  const runtime = configValue[0];
620
614
  const testsObj = configValue[3];
621
615
  const tests = testsObj?.tests || {};
@@ -13,7 +13,7 @@ import { IMode } from "../types";
13
13
  import { CONTENT_TYPES, getContentType } from "../serverManagers/tcp";
14
14
  import { HttpManager } from "../serverManagers/HttpManager";
15
15
  import { Server_Base } from "./Server_Base";
16
- import { IConfig } from "../../Types";
16
+ import { ITestconfigV2 } from "../../Types";
17
17
 
18
18
  export abstract class Server_HTTP extends Server_Base {
19
19
 
@@ -21,7 +21,7 @@ export abstract class Server_HTTP extends Server_Base {
21
21
  protected httpServer: http.Server;
22
22
  routes: any;
23
23
 
24
- constructor(configs: IConfig, mode: IMode) {
24
+ constructor(configs: ITestconfigV2, mode: IMode) {
25
25
  super(configs, mode);
26
26
  // this.http = new HttpManager();
27
27
  this.httpServer = http.createServer();
@@ -4,14 +4,14 @@ import { WebSocket, WebSocketServer } from "ws";
4
4
  import { WsManager } from "../serverManagers/WsManager";
5
5
  import { IMode } from "../types";
6
6
  import { Server_HTTP } from "./Server_HTTP";
7
- import { IConfig } from "../../Types";
7
+ import { ITestconfigV2 } from "../../Types";
8
8
 
9
9
  export class Server_WS extends Server_HTTP {
10
10
  protected ws: WebSocketServer;
11
11
  protected wsClients: Set<WebSocket> = new Set();
12
12
  wsManager: WsManager
13
13
 
14
- constructor(configs: IConfig, mode: IMode) {
14
+ constructor(configs: ITestconfigV2, mode: IMode) {
15
15
  super(configs, mode);
16
16
 
17
17
  this.ws = new WebSocketServer({
package/src/testeranto.ts CHANGED
@@ -1,8 +1,8 @@
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
- import { IConfig, IRunTime } from "./Types";
5
+ import { IRunTime, ITestconfigV2 } from "./Types";
6
6
 
7
7
  const mode = process.argv[3] as "once" | "dev";
8
8
  if (mode !== "once" && mode !== "dev") {
@@ -11,35 +11,40 @@ if (mode !== "once" && mode !== "dev") {
11
11
  }
12
12
 
13
13
  const main = async () => {
14
- const yamlPath = path.join(process.cwd(), 'testeranto/testeranto.yml');
15
- const yamlContent = await fs.readFile(yamlPath, 'utf-8');
16
- const parsed = yaml.parse(yamlContent);
17
-
18
- const config: IConfig = new Map();
19
- for (const [key, value] of Object.entries(parsed)) {
20
- if (Array.isArray(value) && value.length >= 4) {
21
- // The first three elements are runtime, dockerfile, script
22
- const runtime = String(value[0]) as IRunTime;
23
- const dockerfile = String(value[1]);
24
- const script = String(value[2]);
25
-
26
- // The fourth element should be an object with tests
27
- let testsObj = { tests: [] as string[] };
28
- const fourth = value[3];
29
- if (fourth && typeof fourth === 'object' && fourth !== null) {
30
- const testsData = fourth as any;
31
- if (testsData.tests && Array.isArray(testsData.tests)) {
32
- testsObj.tests = testsData.tests.map((t: any) => String(t));
33
- }
34
- }
35
-
36
- config.set(key, [runtime, dockerfile, script, testsObj]);
37
- } else {
38
- console.warn(`Skipping entry ${key}: expected array with at least 4 elements, got`, value);
39
- }
40
- }
41
-
42
- console.log('Parsed config:', Array.from(config.entries()));
14
+ // const yamlPath = path.join(process.cwd(), 'testeranto/testeranto.yml');
15
+ // const yamlContent = await fs.readFile(yamlPath, 'utf-8');
16
+ // const parsed = yaml.parse(yamlContent);
17
+
18
+ // const config: ITestconfigV2 = new Map();
19
+
20
+ // for (const [key, value] of Object.entries(parsed)) {
21
+ // if (Array.isArray(value) && value.length >= 4) {
22
+ // // The first three elements are runtime, dockerfile, script
23
+ // const runtime = String(value[0]) as IRunTime;
24
+ // const dockerfile = String(value[1]);
25
+ // const script = String(value[2]);
26
+
27
+ // // The fourth element should be an object with tests
28
+ // let testsObj = { tests: [] as string[] };
29
+ // const fourth = value[3];
30
+ // if (fourth && typeof fourth === 'object' && fourth !== null) {
31
+ // const testsData = fourth as any;
32
+ // if (testsData.tests && Array.isArray(testsData.tests)) {
33
+ // testsObj.tests = testsData.tests.map((t: any) => String(t));
34
+ // }
35
+ // }
36
+
37
+ // config.set(key, [runtime, dockerfile, script, testsObj]);
38
+ // } else {
39
+ // console.warn(`Skipping entry ${key}: expected array with at least 4 elements, got`, value);
40
+ // }
41
+ // }
42
+
43
+ // console.log('Parsed config:', Array.from(config.entries()));
44
+
45
+ const config: ITestconfigV2 = (await import('../testeranto/testeranto.ts')).default;
46
+
47
+ console.log("mark123", config)
43
48
  await new Server(config, mode).start();
44
49
  }
45
50
 
@@ -8,15 +8,19 @@ import fs from "fs";
8
8
 
9
9
  // src/lib/tiposkripto/BaseGiven.ts
10
10
  var BaseGiven = class {
11
- constructor(features, whens, thens, givenCB, initialValues) {
12
- this.artifacts = [];
13
- this.features = features;
14
- this.whens = whens;
15
- this.thens = thens;
16
- this.givenCB = givenCB;
17
- this.initialValues = initialValues;
18
- this.fails = 0;
19
- }
11
+ features;
12
+ whens;
13
+ thens;
14
+ error;
15
+ fail;
16
+ store;
17
+ recommendedFsPath;
18
+ givenCB;
19
+ initialValues;
20
+ key;
21
+ failed;
22
+ artifacts = [];
23
+ status;
20
24
  addArtifact(path) {
21
25
  if (typeof path !== "string") {
22
26
  throw new Error(
@@ -28,6 +32,14 @@ var BaseGiven = class {
28
32
  const normalizedPath = path.replace(/\\/g, "/");
29
33
  this.artifacts.push(normalizedPath);
30
34
  }
35
+ constructor(features, whens, thens, givenCB, initialValues) {
36
+ this.features = features;
37
+ this.whens = whens;
38
+ this.thens = thens;
39
+ this.givenCB = givenCB;
40
+ this.initialValues = initialValues;
41
+ this.fails = 0;
42
+ }
31
43
  beforeAll(store) {
32
44
  return store;
33
45
  }
@@ -105,17 +117,14 @@ var BaseGiven = class {
105
117
 
106
118
  // src/lib/tiposkripto/BaseSuite.ts
107
119
  var BaseSuite = class {
108
- constructor(name, index, givens = {}) {
109
- this.artifacts = [];
110
- const suiteName = name || "testSuite";
111
- if (!suiteName) {
112
- throw new Error("BaseSuite requires a non-empty name");
113
- }
114
- this.name = suiteName;
115
- this.index = index;
116
- this.givens = givens;
117
- this.fails = 0;
118
- }
120
+ name;
121
+ givens;
122
+ store;
123
+ testResourceConfiguration;
124
+ index;
125
+ failed;
126
+ fails;
127
+ artifacts = [];
119
128
  addArtifact(path) {
120
129
  if (typeof path !== "string") {
121
130
  throw new Error(
@@ -127,6 +136,16 @@ var BaseSuite = class {
127
136
  const normalizedPath = path.replace(/\\/g, "/");
128
137
  this.artifacts.push(normalizedPath);
129
138
  }
139
+ constructor(name, index, givens = {}) {
140
+ const suiteName = name || "testSuite";
141
+ if (!suiteName) {
142
+ throw new Error("BaseSuite requires a non-empty name");
143
+ }
144
+ this.name = suiteName;
145
+ this.index = index;
146
+ this.givens = givens;
147
+ this.fails = 0;
148
+ }
130
149
  features() {
131
150
  try {
132
151
  const features = Object.keys(this.givens).map((k) => this.givens[k].features).flat().filter((value, index, array) => {
@@ -214,8 +233,12 @@ var BaseSuite = class {
214
233
 
215
234
  // src/lib/tiposkripto/BaseThen.ts
216
235
  var BaseThen = class {
236
+ name;
237
+ thenCB;
238
+ error;
239
+ artifacts = [];
240
+ status;
217
241
  constructor(name, thenCB) {
218
- this.artifacts = [];
219
242
  this.name = name;
220
243
  this.thenCB = thenCB;
221
244
  this.error = false;
@@ -274,11 +297,11 @@ var BaseThen = class {
274
297
 
275
298
  // src/lib/tiposkripto/BaseWhen.ts
276
299
  var BaseWhen = class {
277
- constructor(name, whenCB) {
278
- this.artifacts = [];
279
- this.name = name;
280
- this.whenCB = whenCB;
281
- }
300
+ name;
301
+ whenCB;
302
+ error;
303
+ artifacts = [];
304
+ status;
282
305
  addArtifact(path) {
283
306
  if (typeof path !== "string") {
284
307
  throw new Error(
@@ -290,6 +313,10 @@ var BaseWhen = class {
290
313
  const normalizedPath = path.replace(/\\/g, "/");
291
314
  this.artifacts.push(normalizedPath);
292
315
  }
316
+ constructor(name, whenCB) {
317
+ this.name = name;
318
+ this.whenCB = whenCB;
319
+ }
293
320
  toObj() {
294
321
  const obj = {
295
322
  name: this.name,
@@ -320,9 +347,18 @@ ${this.error.stack}` : null,
320
347
 
321
348
  // src/lib/tiposkripto/BaseTiposkripto.ts
322
349
  var BaseTiposkripto = class {
350
+ totalTests = 0;
351
+ artifacts = [];
352
+ assertThis;
353
+ givenOverrides;
354
+ specs;
355
+ suitesOverrides;
356
+ testJobs;
357
+ testResourceRequirement;
358
+ testSpecification;
359
+ thenOverrides;
360
+ whenOverrides;
323
361
  constructor(webOrNode, input, testSpecification, testImplementation, testResourceRequirement = defaultTestResourceRequirement, testAdapter = {}, testResourceConfiguration, wsPort = "3456", wsHost = "localhost") {
324
- this.totalTests = 0;
325
- this.artifacts = [];
326
362
  this.testResourceConfiguration = testResourceConfiguration;
327
363
  const fullAdapter = DefaultAdapter(testAdapter);
328
364
  if (!testImplementation.suites || typeof testImplementation.suites !== "object") {