testeranto 0.199.0 → 0.200.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. package/bin/test_runner +0 -0
  2. package/bin/testeranto +0 -0
  3. package/bundle.js +2 -2
  4. package/cmd/test_runner/main.go +65 -0
  5. package/cmd/testeranto/main.go +37 -0
  6. package/dist/common/src/PM/main.js +126 -11
  7. package/dist/common/src/PM/pitonoRunner.js +54 -0
  8. package/dist/common/src/components/pure/TestPageView.js +180 -65
  9. package/dist/common/src/components/stateful/TestPage.js +50 -11
  10. package/dist/common/src/lib/abstractBase.test/index.js +1 -0
  11. package/dist/common/src/run.js +48 -82
  12. package/dist/common/src/{build.js → testeranto.js} +107 -55
  13. package/dist/common/src/utils/golingvuMetafile.js +116 -0
  14. package/dist/common/src/utils/logFiles.js +2 -1
  15. package/dist/common/src/utils/pitonoMetafile.js +67 -0
  16. package/dist/common/src/utils.js +40 -1
  17. package/dist/common/testeranto.config.js +23 -21
  18. package/dist/common/tsconfig.common.tsbuildinfo +1 -1
  19. package/dist/module/src/PM/main.js +126 -11
  20. package/dist/module/src/PM/pitonoRunner.js +47 -0
  21. package/dist/module/src/components/pure/TestPageView.js +180 -65
  22. package/dist/module/src/components/stateful/TestPage.js +50 -11
  23. package/dist/module/src/lib/abstractBase.test/index.js +1 -0
  24. package/dist/module/src/run.js +49 -45
  25. package/dist/module/src/{build.js → testeranto.js} +107 -55
  26. package/dist/module/src/utils/golingvuMetafile.js +109 -0
  27. package/dist/module/src/utils/logFiles.js +2 -1
  28. package/dist/module/src/utils/pitonoMetafile.js +60 -0
  29. package/dist/module/src/utils.js +40 -1
  30. package/dist/module/testeranto.config.js +23 -21
  31. package/dist/module/tsconfig.module.tsbuildinfo +1 -1
  32. package/dist/prebuild/App.js +81 -17
  33. package/dist/types/src/PM/main.d.ts +2 -0
  34. package/dist/types/src/PM/pitonoRunner.d.ts +7 -0
  35. package/dist/types/src/Types.d.ts +1 -1
  36. package/dist/types/src/run.d.ts +0 -1
  37. package/dist/types/src/utils/golingvuMetafile.d.ts +19 -0
  38. package/dist/types/src/utils/logFiles.d.ts +5 -1
  39. package/dist/types/src/utils/pitonoMetafile.d.ts +7 -0
  40. package/dist/types/src/utils.d.ts +5 -0
  41. package/dist/types/tsconfig.types.tsbuildinfo +1 -1
  42. package/docs/index.md +13 -13
  43. package/example/test_example.py +106 -0
  44. package/go.mod +3 -0
  45. package/package.json +2 -2
  46. package/pitono/__init__.py +54 -0
  47. package/pitono/base_given.py +131 -0
  48. package/pitono/base_suite.py +95 -0
  49. package/pitono/base_then.py +50 -0
  50. package/pitono/base_when.py +52 -0
  51. package/pitono/core_generator.py +110 -0
  52. package/pitono/pitono.egg-info/PKG-INFO +17 -0
  53. package/pitono/pitono.egg-info/SOURCES.txt +7 -0
  54. package/pitono/pitono.egg-info/dependency_links.txt +1 -0
  55. package/pitono/pitono.egg-info/entry_points.txt +2 -0
  56. package/pitono/pitono.egg-info/top_level.txt +1 -0
  57. package/pitono/pyproject.toml +26 -0
  58. package/pitono/setup.py +40 -0
  59. package/pitono/simple_adapter.py +24 -0
  60. package/pitono/types.py +78 -0
  61. package/sampleMetafile.json +56 -0
  62. package/src/PM/main.ts +146 -17
  63. package/src/PM/pitonoRunner.ts +49 -0
  64. package/src/Types.ts +1 -1
  65. package/src/components/pure/TestPageView.tsx +175 -8
  66. package/src/components/stateful/TestPage.tsx +57 -16
  67. package/src/core/types.go +36 -0
  68. package/src/golingvu/README.md +3 -0
  69. package/src/golingvu/base_given.go +76 -0
  70. package/src/golingvu/base_suite.go +39 -0
  71. package/src/golingvu/base_suite_test.go +197 -0
  72. package/src/golingvu/base_then.go +21 -0
  73. package/src/golingvu/base_when.go +21 -0
  74. package/src/golingvu/golingvu.go +179 -0
  75. package/src/golingvu/test_adapter.go +33 -0
  76. package/src/golingvu/types.go +86 -0
  77. package/src/lib/abstractBase.test/index.ts +1 -0
  78. package/src/pitono/README.md +3 -0
  79. package/src/run.ts +48 -48
  80. package/src/templates/frontpage.html +26 -17
  81. package/src/{build.ts → testeranto.ts} +128 -58
  82. package/src/utils/golingvuMetafile.ts +165 -0
  83. package/src/utils/logFiles.ts +2 -1
  84. package/src/utils/pitonoMetafile.ts +68 -0
  85. package/src/utils.ts +38 -1
  86. package/testeranto/App.js +81 -17
  87. package/testeranto/metafiles/golang/core.json +72 -0
  88. package/testeranto/metafiles/node/core.json +21 -459
  89. package/testeranto/metafiles/pure/core.json +18 -119
  90. package/testeranto/metafiles/web/core.json +37 -16797
  91. package/testeranto/reports/core/config.json +8 -40
  92. package/testeranto/reports/core/src/lib/BaseSuite.test/node.test/node/lint_errors.txt +6 -0
  93. package/testeranto/reports/core/src/lib/BaseSuite.test/node.test/node/prompt.txt +12 -1
  94. package/testeranto/reports/core/src/lib/BaseSuite.test/pure.test/pure/lint_errors.txt +2 -0
  95. package/testeranto/reports/core/src/lib/BaseSuite.test/pure.test/pure/prompt.txt +11 -1
  96. package/testeranto/reports/core/src/lib/BaseSuite.test/web.test/web/lint_errors.txt +2 -0
  97. package/testeranto/reports/core/src/lib/BaseSuite.test/web.test/web/prompt.txt +13 -3
  98. package/testeranto/reports/core/summary.json +9 -45
  99. package/testeranto.config.ts +25 -21
  100. package/tsc.log +46 -7
  101. package/dist/common/src/lib/mocks.test.js +0 -11
  102. package/dist/module/src/lib/mocks.test.js +0 -11
  103. package/dist/prebuild/build.mjs +0 -578
  104. package/dist/prebuild/run.mjs +0 -2290
  105. package/dist/tsconfig.tsbuildinfo +0 -1
  106. package/dist/types/src/lib/mocks.test.d.ts +0 -0
  107. package/src/lib/mocks.test.ts +0 -11
  108. package/testeranto/reports/core/src/Pure.test/pure/exit.log +0 -0
  109. package/testeranto/reports/core/src/Pure.test/pure/lint_errors.txt +0 -0
  110. package/testeranto/reports/core/src/Pure.test/pure/message.txt +0 -17
  111. package/testeranto/reports/core/src/Pure.test/pure/prompt.txt +0 -14
  112. package/testeranto/reports/core/src/Pure.test/pure/type_errors.txt +0 -66
  113. package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/debug.log +0 -0
  114. package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/error.log +0 -67
  115. package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/exit.log +0 -1
  116. package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/info.log +0 -2
  117. package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/lint_errors.txt +0 -0
  118. package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/message.txt +0 -17
  119. package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/prompt.txt +0 -16
  120. package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/tests.json +0 -68
  121. package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/type_errors.txt +0 -56
  122. package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/warn.log +0 -0
  123. package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/debug.log +0 -0
  124. package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/error.log +0 -22
  125. package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/exit.log +0 -1
  126. package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/info.log +0 -2
  127. package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/lint_errors.txt +0 -13
  128. package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/message.txt +0 -17
  129. package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/prompt.txt +0 -16
  130. package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/tests.json +0 -88
  131. package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/type_errors.txt +0 -45
  132. package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/warn.log +0 -0
  133. package/testeranto/reports/core/src/components/pure/TestPageView.test/index/web/debug.log +0 -0
  134. package/testeranto/reports/core/src/components/pure/TestPageView.test/index/web/error.log +0 -0
  135. package/testeranto/reports/core/src/components/pure/TestPageView.test/index/web/exit.log +0 -1
  136. package/testeranto/reports/core/src/components/pure/TestPageView.test/index/web/info.log +0 -2
  137. package/testeranto/reports/core/src/components/pure/TestPageView.test/index/web/lint_errors.txt +0 -47
  138. package/testeranto/reports/core/src/components/pure/TestPageView.test/index/web/message.txt +0 -17
  139. package/testeranto/reports/core/src/components/pure/TestPageView.test/index/web/prompt.txt +0 -17
  140. package/testeranto/reports/core/src/components/pure/TestPageView.test/index/web/tests.json +0 -57
  141. package/testeranto/reports/core/src/components/pure/TestPageView.test/index/web/type_errors.txt +0 -99
  142. package/testeranto/reports/core/src/components/pure/TestPageView.test/index/web/warn.log +0 -0
  143. package/testeranto/reports/core/src/lib/TipoSkripto.test/TipoSkripto/node/exit.log +0 -1
  144. package/testeranto/reports/core/src/lib/TipoSkripto.test/TipoSkripto/node/lint_errors.txt +0 -0
  145. package/testeranto/reports/core/src/lib/TipoSkripto.test/TipoSkripto/node/message.txt +0 -17
  146. package/testeranto/reports/core/src/lib/TipoSkripto.test/TipoSkripto/node/prompt.txt +0 -17
  147. package/testeranto/reports/core/src/lib/TipoSkripto.test/TipoSkripto/node/stderr.log +0 -18
  148. package/testeranto/reports/core/src/lib/TipoSkripto.test/TipoSkripto/node/stdout.log +0 -0
  149. package/testeranto/reports/core/src/lib/TipoSkripto.test/TipoSkripto/node/type_errors.txt +0 -32
  150. package/testeranto/reports/core/src/lib/pmProxy.test/index/node/exit.log +0 -1
  151. package/testeranto/reports/core/src/lib/pmProxy.test/index/node/lint_errors.txt +0 -15
  152. package/testeranto/reports/core/src/lib/pmProxy.test/index/node/message.txt +0 -17
  153. package/testeranto/reports/core/src/lib/pmProxy.test/index/node/prompt.txt +0 -17
  154. package/testeranto/reports/core/src/lib/pmProxy.test/index/node/stderr.log +0 -66
  155. package/testeranto/reports/core/src/lib/pmProxy.test/index/node/stdout.log +0 -10
  156. package/testeranto/reports/core/src/lib/pmProxy.test/index/node/type_errors.txt +0 -47
  157. /package/dist/types/src/{build.d.ts → testeranto.d.ts} +0 -0
@@ -54,17 +54,18 @@
54
54
  <section class="snap-section min-vh-100 d-flex align-items-center" style="
55
55
  background: linear-gradient(
56
56
  135deg,
57
- rgba(66, 85, 197, 0.9) 0%,
58
- rgba(105, 4, 106, 0.9) 100%
57
+ #220022 0%,
58
+ #440044 50%,
59
+ #220022 100%
59
60
  ),
60
61
  radial-gradient(
61
62
  circle at 30% 30%,
62
- rgba(66, 85, 197, 0.2) 0%,
63
+ rgba(68, 0, 68, 0.3) 0%,
63
64
  transparent 50%
64
65
  ),
65
66
  radial-gradient(
66
67
  circle at 70% 70%,
67
- rgba(105, 4, 106, 0.2) 0%,
68
+ rgba(34, 0, 34, 0.3) 0%,
68
69
  transparent 50%
69
70
  );
70
71
  color: var(--dark-vibrant-text);
@@ -302,30 +303,38 @@
302
303
 
303
304
  <!-- Demo Section -->
304
305
  <section class="snap-section d-flex align-items-center justify-content-center min-vh-100" style="
305
- background: linear-gradient(0deg, #000 0%, #222 50%, #000 100%);
306
- animation: vibrantPulse 8s ease infinite;
306
+ background: linear-gradient(135deg, #000022 0%, #220033 50%, #000022 100%),
307
+ radial-gradient(circle at 20% 30%, rgba(34, 0, 51, 0.3) 0%, transparent 50%),
308
+ radial-gradient(circle at 80% 70%, rgba(0, 0, 34, 0.3) 0%, transparent 50%);
309
+ background-size: 200% 200%, cover, cover;
307
310
  color: #fff;
308
311
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
312
+ animation: vibrantPulse 8s ease infinite;
309
313
  ">
310
314
  <div class="container text-center">
311
315
  <h2 class="display-4 mb-4">A demo is worth a thousand tokens.</h2>
312
316
  <h2 class="mb-5">
313
317
  <a href="/testeranto/projects.html#/projects/core/tests/src%2Fcomponents%2Fpure%2FProjectPageView.test%2Findex.tsx/web"
314
- style="">See it for yourself</a>
318
+ style="color: #fff;">See it for yourself</a>
315
319
  </h2>
316
320
  </div>
317
321
  </section>
318
322
 
319
323
  <!-- Beta Program Section -->
320
- <!-- <section class="snap-section d-flex align-items-center justify-content-center min-vh-100" style="background: white;
321
-
322
- color: #fff;
323
- text-shadow: 0 2px 4px rgba(0,0,0,0.5);">
324
+ <section class="snap-section d-flex align-items-center justify-content-center min-vh-100" style="
325
+ background: linear-gradient(135deg, #001100 0%, #003322 50%, #001100 100%),
326
+ radial-gradient(circle at 30% 30%, rgba(0, 51, 34, 0.3) 0%, transparent 50%),
327
+ radial-gradient(circle at 70% 70%, rgba(0, 17, 0, 0.3) 0%, transparent 50%);
328
+ background-size: 200% 200%, cover, cover;
329
+ color: #fff;
330
+ text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
331
+ animation: gradientFlow 15s ease infinite;
332
+ ">
324
333
  <div class="container text-center">
325
- <h2 class="display-4 mb-4">A demo is worth a thousand tokens.</h2>
326
- <p class="lead mb-5">See testeranto in action <a
327
- href="/testeranto/projects.html#/projects/core/tests/src%2Fcomponents%2Fpure%2FProjectPageView.test%2Findex.tsx/web"
328
- style="color: #fff;">here</a></p>
334
+ <h2 class="display-4 mb-4">Join the Beta Program</h2>
335
+ <p class="lead mb-5">Be among the first to experience Testeranto's full potential. <a
336
+ href="#beta-signup"
337
+ style="color: #fff;">Sign up now</a></p>
329
338
  </div>
330
- </section> -->
331
- </div>
339
+ </section>
340
+ </div>
@@ -15,19 +15,24 @@ import esbuildNodeConfiger from "./esbuildConfigs/node";
15
15
  import esbuildWebConfiger from "./esbuildConfigs/web";
16
16
  import esbuildImportConfiger from "./esbuildConfigs/pure";
17
17
  import webHtmlFrame from "./web.html";
18
+ import { PM_Main } from "./PM/main";
18
19
 
19
20
  readline.emitKeypressEvents(process.stdin);
20
21
  if (process.stdin.isTTY) process.stdin.setRawMode(true);
21
22
 
22
23
  const testName = process.argv[2];
23
24
 
24
- let mode = process.argv[3] as "once" | "dev";
25
+ const mode = process.argv[3] as "once" | "dev";
25
26
  if (mode !== "once" && mode !== "dev") {
26
- console.error(`The 4th argument should be 'dev' or 'once', not '${mode}'.`);
27
+ console.error(`The 3rd argument should be 'dev' or 'once', not '${mode}'.`);
27
28
  process.exit(-1);
28
29
  }
29
30
 
30
- import(process.cwd() + "/" + "testeranto.config.ts").then(async (module) => {
31
+ const f = process.cwd() + "/" + "testeranto.config.ts";
32
+
33
+ console.log("config file:", f);
34
+
35
+ import(f).then(async (module) => {
31
36
  const pckge = (await import(`${process.cwd()}/package.json`)).default;
32
37
  const bigConfig: IProject = module.default;
33
38
 
@@ -44,64 +49,39 @@ import(process.cwd() + "/" + "testeranto.config.ts").then(async (module) => {
44
49
 
45
50
  const rawConfig: ITestconfig = bigConfig.projects[testName];
46
51
 
47
- const getSecondaryEndpointsPoints = (runtime?: IRunTime): string[] => {
48
- const meta = (ts: ITestTypes[], st: Set<string>): Set<string> => {
49
- ts.forEach((t) => {
50
- if (t[1] === runtime) {
51
- st.add(t[0]);
52
- }
53
- if (Array.isArray(t[3])) {
54
- meta(t[3], st);
55
- }
56
- });
57
- return st;
58
- };
59
- return Array.from(meta(config.tests, new Set()));
60
- };
52
+ if (!rawConfig) {
53
+ console.error(`Project "${testName}" does not exist in the configuration.`);
54
+ console.error("Available projects:", Object.keys(bigConfig.projects));
55
+ process.exit(-1);
56
+ }
61
57
 
62
- // const getSideCars = (runtime?: IRunTime): string[] => {
63
- // return Array.from(
64
- // new Set(
65
- // config.tests
66
- // .reduce((mm, t) => {
67
- // mm = mm.concat(t[3]);
68
- // return mm;
69
- // }, [] as ITestTypes[])
70
- // .filter((t) => {
71
- // return t[1] === runtime;
72
- // })
73
- // .map((t) => {
74
- // return t[0];
75
- // })
76
- // )
77
- // );
78
- // };
58
+ if (!rawConfig.tests) {
59
+ console.error(testName, "appears to have no tests: ", f);
60
+ console.error(`here is the config:`);
61
+ console.log(JSON.stringify(rawConfig));
62
+ process.exit(-1);
63
+ }
79
64
 
80
65
  const config: IBuiltConfig = {
81
66
  ...rawConfig,
82
67
  buildDir: process.cwd() + "/testeranto/bundles/" + testName,
83
68
  };
84
69
 
85
- console.log(
86
- `Press 'q' to shutdown gracefully. Press 'x' to shutdown forcefully.`
87
- );
70
+ console.log(ansiC.inverse("Press 'q' to initiate a graceful shutdown."));
71
+ console.log(ansiC.inverse("Press 'x' to quit forcefully."));
72
+
88
73
  process.stdin.on("keypress", (str, key) => {
89
- if (key.name === "q") {
90
- console.log("Testeranto-Build is shutting down...");
91
- mode = "once";
92
- onDone();
93
- } else if (key.name === "x") {
94
- console.log("Testeranto-Build is shutting down forcefully...");
74
+ if (key.name === "x") {
75
+ console.log(ansiC.inverse("Shutting down forcefully..."));
95
76
  process.exit(-1);
96
- } else {
97
- console.log(
98
- `Press 'q' to shutdown gracefully. Press 'x' to shutdown forcefully.`
99
- );
100
77
  }
101
78
  });
79
+
102
80
  let nodeDone: boolean = false;
103
81
  let webDone: boolean = false;
104
82
  let importDone: boolean = false;
83
+ let golangDone: boolean = false;
84
+ let pitonoDone: boolean = false;
105
85
 
106
86
  let status: "build" | "built" = "build";
107
87
 
@@ -129,17 +109,45 @@ import(process.cwd() + "/" + "testeranto.config.ts").then(async (module) => {
129
109
  onDone();
130
110
  };
131
111
 
112
+ const onGolangDone = () => {
113
+ golangDone = true;
114
+ onDone();
115
+ };
116
+
117
+ const onPitonoDone = () => {
118
+ pitonoDone = true;
119
+ onDone();
120
+ };
121
+
122
+ let pm: PM_Main | null = null;
132
123
  const onDone = async () => {
133
- if (nodeDone && webDone && importDone) {
124
+ // Check which test types are present
125
+ const hasGolangTests = config.tests.some(test => test[1] === 'golang');
126
+ const hasPitonoTests = config.tests.some(test => test[1] === 'pitono');
127
+
128
+ // Wait for all relevant runtimes to be done
129
+ const allDone =
130
+ nodeDone && webDone && importDone &&
131
+ (!hasGolangTests || golangDone) &&
132
+ (!hasPitonoTests || pitonoDone);
133
+
134
+ if (allDone) {
134
135
  status = "built";
136
+
137
+ // Start the PM_Main to run the tests after build
138
+ if (!pm) {
139
+ const { PM_Main } = await import("./PM/main");
140
+ pm = new PM_Main(config, testName, mode);
141
+ await pm.start();
142
+ }
135
143
  }
136
- if (nodeDone && webDone && importDone && mode === "once") {
144
+ if (allDone && mode === "once") {
137
145
  console.log(
138
146
  ansiC.inverse(
139
147
  `${testName} was built and the builder exited successfully.`
140
148
  )
141
149
  );
142
- process.exit();
150
+ // Let PM_Main handle the exit after tests are complete
143
151
  }
144
152
  };
145
153
 
@@ -157,6 +165,65 @@ import(process.cwd() + "/" + "testeranto.config.ts").then(async (module) => {
157
165
  );
158
166
  });
159
167
 
168
+ const getSecondaryEndpointsPoints = (runtime?: IRunTime): string[] => {
169
+ const meta = (ts: ITestTypes[], st: Set<string>): Set<string> => {
170
+ ts.forEach((t) => {
171
+ if (t[1] === runtime) {
172
+ st.add(t[0]);
173
+ }
174
+ if (Array.isArray(t[3])) {
175
+ meta(t[3], st);
176
+ }
177
+ });
178
+ return st;
179
+ };
180
+ return Array.from(meta(config.tests, new Set()));
181
+ };
182
+
183
+ // Also handle pitono endpoints for HTML generation if needed
184
+ [...getSecondaryEndpointsPoints("pitono")].forEach(async (sourceFilePath) => {
185
+ // You might want to generate specific files for pitono tests here
186
+ console.log(`Pitono test found: ${sourceFilePath}`);
187
+ });
188
+
189
+ // Handle golang tests by generating their metafiles
190
+ const golangTests = config.tests.filter(test => test[1] === 'golang');
191
+ const hasGolangTests = golangTests.length > 0;
192
+ if (hasGolangTests) {
193
+ // Import and use the golang metafile utilities
194
+ const { generateGolangMetafile, writeGolangMetafile } = await import('./utils/golingvuMetafile');
195
+ // Get the entry points (first element of each test tuple)
196
+ const golangEntryPoints = golangTests.map(test => test[0]);
197
+ const metafile = await generateGolangMetafile(testName, golangEntryPoints);
198
+ writeGolangMetafile(testName, metafile);
199
+ // Mark golang as done after writing the metafile
200
+ onGolangDone();
201
+ }
202
+
203
+ // Handle pitono (Python) tests by generating their metafiles
204
+ const pitonoTests = config.tests.filter(test => test[1] === 'pitono');
205
+ const hasPitonoTests = pitonoTests.length > 0;
206
+ if (hasPitonoTests) {
207
+ // Import and use the pitono metafile utilities
208
+ const { generatePitonoMetafile } = await import('./utils/pitonoMetafile');
209
+ // Get the entry points (first element of each test tuple)
210
+ const pitonoEntryPoints = pitonoTests.map(test => test[0]);
211
+ const metafile = await generatePitonoMetafile(testName, pitonoEntryPoints);
212
+
213
+ // Ensure the directory exists
214
+ const pitonoMetafilePath = `${process.cwd()}/testeranto/metafiles/python`;
215
+ await fs.promises.mkdir(pitonoMetafilePath, { recursive: true });
216
+
217
+ // Write the metafile to the specified path
218
+ fs.writeFileSync(
219
+ `${pitonoMetafilePath}/core.json`,
220
+ JSON.stringify(metafile, null, 2)
221
+ );
222
+
223
+ // Mark pitono as done after writing the metafile
224
+ onPitonoDone();
225
+ }
226
+
160
227
  Promise.resolve(
161
228
  Promise.all(
162
229
  [...getSecondaryEndpointsPoints("web")].map(async (sourceFilePath) => {
@@ -188,14 +255,6 @@ import(process.cwd() + "/" + "testeranto.config.ts").then(async (module) => {
188
255
  )
189
256
  );
190
257
 
191
- // glob(`${process.cwd()}/testeranto/bundles/${testName}/chunk-*.mjs`, {
192
- // ignore: "node_modules/**",
193
- // }).then((chunks) => {
194
- // chunks.forEach((chunk) => {
195
- // fs.unlinkSync(chunk);
196
- // });
197
- // });
198
-
199
258
  const x: [IRunTime, string[]][] = [
200
259
  ["pure", Object.keys(pureEntryPoints)],
201
260
  ["node", Object.keys(nodeEntryPoints)],
@@ -282,4 +341,15 @@ import(process.cwd() + "/" + "testeranto.config.ts").then(async (module) => {
282
341
  });
283
342
  }),
284
343
  ]);
344
+
345
+ process.stdin.on("keypress", (str, key) => {
346
+ if (key.name === "q") {
347
+ console.log("Testeranto is shutting down gracefully...");
348
+ if (pm) {
349
+ pm.stop();
350
+ } else {
351
+ process.exit();
352
+ }
353
+ }
354
+ });
285
355
  });
@@ -0,0 +1,165 @@
1
+ import { execSync } from "child_process";
2
+ import fs from "fs";
3
+ import path from "path";
4
+
5
+ export interface GolingvuBuildResult {
6
+ errors: any[];
7
+ warnings: any[];
8
+ metafile?: {
9
+ inputs: Record<string, {
10
+ bytes: number;
11
+ imports: any[];
12
+ }>;
13
+ outputs: Record<
14
+ string,
15
+ {
16
+ bytes: number;
17
+ inputs: Record<string, { bytesInOutput: number }>;
18
+ entryPoint: string;
19
+ }
20
+ >;
21
+ };
22
+ }
23
+
24
+ export async function generateGolangMetafile(testName: string, entryPoints: string[]): Promise<GolingvuBuildResult> {
25
+ const outputs: Record<
26
+ string,
27
+ {
28
+ entryPoint: string;
29
+ inputs: Record<string, { bytesInOutput: number }>;
30
+ bytes: number;
31
+ }
32
+ > = {};
33
+
34
+ // Process each Go entry point
35
+ for (const entryPoint of entryPoints) {
36
+ try {
37
+ // Get the package directory to find all Go files in the same package
38
+ const entryDir = path.dirname(entryPoint);
39
+
40
+ // Find all .go files in the same directory
41
+ const goFiles = fs.readdirSync(entryDir)
42
+ .filter(file => file.endsWith('.go'))
43
+ .map(file => path.join(entryDir, file));
44
+
45
+ // Create inputs record
46
+ const inputs: Record<string, { bytesInOutput: number }> = {};
47
+ let totalBytes = 0;
48
+
49
+ for (const file of goFiles) {
50
+ try {
51
+ const stats = fs.statSync(file);
52
+ inputs[file] = { bytesInOutput: stats.size };
53
+ totalBytes += stats.size;
54
+ } catch {
55
+ inputs[file] = { bytesInOutput: 0 };
56
+ }
57
+ }
58
+
59
+ // Add the entry point itself if not already included
60
+ if (!inputs[entryPoint]) {
61
+ try {
62
+ const entryStats = fs.statSync(entryPoint);
63
+ inputs[entryPoint] = { bytesInOutput: entryStats.size };
64
+ totalBytes += entryStats.size;
65
+ } catch {
66
+ inputs[entryPoint] = { bytesInOutput: 0 };
67
+ }
68
+ }
69
+
70
+ // The output path should match the Node.js structure - use a path in testeranto/bundles
71
+ // For Go, we don't have actual bundled outputs, so we'll use a placeholder
72
+ const outputPath = `testeranto/bundles/golang/${testName}/${entryPoint}`;
73
+ outputs[outputPath] = {
74
+ entryPoint: entryPoint, // Use the source file path, not the bundle path
75
+ inputs,
76
+ bytes: totalBytes
77
+ };
78
+ } catch (error) {
79
+ console.error(`Error processing Go entry point ${entryPoint}:`, error);
80
+ }
81
+ }
82
+
83
+ // Create inputs record for the metafile - include all Go files
84
+ const allInputs: Record<string, {
85
+ bytes: number;
86
+ imports: any[];
87
+ }> = {};
88
+
89
+ // Collect all unique Go files from all entry points
90
+ const allGoFiles = new Set<string>();
91
+
92
+ for (const entryPoint of entryPoints) {
93
+ try {
94
+ const entryDir = path.dirname(entryPoint);
95
+
96
+ // Find all .go files in the same directory
97
+ const goFiles = fs.readdirSync(entryDir)
98
+ .filter(file => file.endsWith('.go'))
99
+ .map(file => path.join(entryDir, file));
100
+
101
+ goFiles.forEach(file => allGoFiles.add(file));
102
+
103
+ // Add the entry point itself
104
+ allGoFiles.add(entryPoint);
105
+ } catch (error) {
106
+ console.error(`Error processing Go entry point ${entryPoint} for source files:`, error);
107
+ }
108
+ }
109
+
110
+ // Add all Go files to inputs
111
+ for (const filePath of Array.from(allGoFiles)) {
112
+ try {
113
+ const stats = fs.statSync(filePath);
114
+ allInputs[filePath] = {
115
+ bytes: stats.size,
116
+ imports: [] // Go files don't have imports like JS
117
+ };
118
+ } catch {
119
+ allInputs[filePath] = {
120
+ bytes: 0,
121
+ imports: []
122
+ };
123
+ }
124
+ }
125
+
126
+ // Reformat outputs to match esbuild structure
127
+ const esbuildOutputs: Record<string, {
128
+ bytes: number;
129
+ inputs: Record<string, { bytesInOutput: number }>;
130
+ entryPoint: string;
131
+ }> = {};
132
+ for (const [outputPath, output] of Object.entries(outputs)) {
133
+ esbuildOutputs[outputPath] = {
134
+ bytes: output.bytes,
135
+ inputs: output.inputs,
136
+ entryPoint: output.entryPoint
137
+ };
138
+ }
139
+
140
+ return {
141
+ errors: [],
142
+ warnings: [],
143
+ metafile: {
144
+ inputs: allInputs,
145
+ outputs: esbuildOutputs
146
+ }
147
+ };
148
+ }
149
+
150
+
151
+ export function writeGolangMetafile(
152
+ testName: string,
153
+ metafile: GolingvuBuildResult
154
+ ): void {
155
+ const metafileDir = path.join(
156
+ process.cwd(),
157
+ "testeranto",
158
+ "metafiles",
159
+ "golang"
160
+ );
161
+ fs.mkdirSync(metafileDir, { recursive: true });
162
+
163
+ const metafilePath = path.join(metafileDir, `${testName}.json`);
164
+ fs.writeFileSync(metafilePath, JSON.stringify(metafile, null, 2));
165
+ }
@@ -21,7 +21,8 @@ export const STANDARD_LOGS = {
21
21
  LINT_ERRORS: 'lint_errors.txt',
22
22
  EXIT: 'exit.log',
23
23
  MESSAGE: 'message.txt',
24
- PROMPT: 'prompt.txt'
24
+ PROMPT: 'prompt.txt',
25
+ BUILD: 'build.json'
25
26
  } as const;
26
27
 
27
28
  export const RUNTIME_SPECIFIC_LOGS = {
@@ -0,0 +1,68 @@
1
+ import fs from 'fs';
2
+ import path from 'path';
3
+ import { execSync } from 'child_process';
4
+
5
+ export interface PitonoMetafile {
6
+ testName: string;
7
+ entryPoints: string[];
8
+ timestamp: number;
9
+ }
10
+
11
+ export async function generatePitonoMetafile(testName: string, entryPoints: string[]): Promise<PitonoMetafile> {
12
+ return {
13
+ testName,
14
+ entryPoints,
15
+ timestamp: Date.now()
16
+ };
17
+ }
18
+
19
+ export function writePitonoMetafile(testName: string, metafile: PitonoMetafile): void {
20
+ const metafilePath = path.join(process.cwd(), 'testeranto', 'pitono', testName, 'metafile.json');
21
+ const metafileDir = path.dirname(metafilePath);
22
+
23
+ // Ensure directory exists
24
+ if (!fs.existsSync(metafileDir)) {
25
+ fs.mkdirSync(metafileDir, { recursive: true });
26
+ }
27
+
28
+ // Write the metafile
29
+ fs.writeFileSync(metafilePath, JSON.stringify(metafile, null, 2));
30
+ console.log(`Pitono metafile written to: ${metafilePath}`);
31
+
32
+ // Generate core.json using the Python script
33
+ try {
34
+ // First try using the installed command
35
+ const command = `pitono-core-generator ${testName} ${metafile.entryPoints.join(' ')}`;
36
+ execSync(command, { stdio: 'inherit' });
37
+ console.log(`Pitono core.json generated successfully for ${testName}`);
38
+ } catch (error) {
39
+ console.error(`Failed to generate Pitono core.json with installed command: ${error}`);
40
+ // Fallback to direct Python execution
41
+ try {
42
+ const pythonCommand = `python ${process.cwd()}/pitono/core_generator.py ${testName} ${metafile.entryPoints.join(' ')}`;
43
+ execSync(pythonCommand, { stdio: 'inherit' });
44
+ console.log(`Pitono core.json generated successfully using direct Python execution`);
45
+ } catch (fallbackError) {
46
+ console.error(`Direct Python execution also failed: ${fallbackError}`);
47
+ // Last resort: create the core.json manually
48
+ try {
49
+ const coreData = {
50
+ testName: testName,
51
+ entryPoints: metafile.entryPoints,
52
+ outputs: {},
53
+ metafile: {
54
+ inputs: {},
55
+ outputs: {}
56
+ },
57
+ timestamp: Date.now(),
58
+ runtime: "pitono"
59
+ };
60
+ const coreFilePath = path.join(process.cwd(), 'testeranto', 'pitono', testName, 'core.json');
61
+ fs.writeFileSync(coreFilePath, JSON.stringify(coreData, null, 2));
62
+ console.log(`Pitono core.json created manually as fallback`);
63
+ } catch (manualError) {
64
+ console.error(`Even manual creation failed: ${manualError}`);
65
+ }
66
+ }
67
+ }
68
+ }
package/src/utils.ts CHANGED
@@ -80,14 +80,33 @@ export const getRunnables = (
80
80
  tests: ITestTypes[],
81
81
  projectName: string,
82
82
  payload = {
83
+ pythonEntryPoints: {},
83
84
  nodeEntryPoints: {},
84
85
  nodeEntryPointSidecars: {},
85
86
  webEntryPoints: {},
86
87
  webEntryPointSidecars: {},
87
88
  pureEntryPoints: {},
88
89
  pureEntryPointSidecars: {},
90
+ golangEntryPoints: {},
91
+ golangEntryPointSidecars: {},
92
+ pitonoEntryPoints: {},
93
+ pitonoEntryPointSidecars: {},
89
94
  }
90
95
  ): IRunnables => {
96
+ // Ensure all properties are properly initialized
97
+ const initializedPayload = {
98
+ pythonEntryPoints: payload.pythonEntryPoints || {},
99
+ nodeEntryPoints: payload.nodeEntryPoints || {},
100
+ nodeEntryPointSidecars: payload.nodeEntryPointSidecars || {},
101
+ webEntryPoints: payload.webEntryPoints || {},
102
+ webEntryPointSidecars: payload.webEntryPointSidecars || {},
103
+ pureEntryPoints: payload.pureEntryPoints || {},
104
+ pureEntryPointSidecars: payload.pureEntryPointSidecars || {},
105
+ golangEntryPoints: payload.golangEntryPoints || {},
106
+ golangEntryPointSidecars: payload.golangEntryPointSidecars || {},
107
+ pitonoEntryPoints: payload.pitonoEntryPoints || {},
108
+ pitonoEntryPointSidecars: payload.pitonoEntryPointSidecars || {},
109
+ };
91
110
  return tests.reduce((pt, cv, cndx, cry) => {
92
111
  if (cv[1] === "node") {
93
112
  pt.nodeEntryPoints[cv[0]] = path.resolve(
@@ -113,6 +132,12 @@ export const getRunnables = (
113
132
  .concat("mjs")
114
133
  .join(".")}`
115
134
  );
135
+ } else if (cv[1] === "golang") {
136
+ // For Go files, we'll use the original path since they're not compiled to JS
137
+ pt.golangEntryPoints[cv[0]] = path.resolve(cv[0]);
138
+ } else if (cv[1] === "pitono") {
139
+ // For pitono files, use the original Python file path
140
+ pt.pitonoEntryPoints[cv[0]] = path.resolve(cv[0]);
116
141
  }
117
142
 
118
143
  //////////////////////////////////////////////////////////
@@ -150,7 +175,19 @@ export const getRunnables = (
150
175
  .join(".")}`
151
176
  );
152
177
  });
178
+ cv[3]
179
+ .filter((t) => t[1] === "golang")
180
+ .forEach((t) => {
181
+ // For Go sidecars, use the original path
182
+ pt.golangEntryPointSidecars[`${t[0]}`] = path.resolve(t[0]);
183
+ });
184
+ cv[3]
185
+ .filter((t) => t[1] === "pitono")
186
+ .forEach((t) => {
187
+ // For pitono sidecars, use the original Python file path
188
+ pt.pitonoEntryPointSidecars[`${t[0]}`] = path.resolve(t[0]);
189
+ });
153
190
 
154
191
  return pt;
155
- }, payload as IRunnables);
192
+ }, initializedPayload as IRunnables);
156
193
  };