testeranto 0.199.0 → 0.200.1
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/bin/test_runner +0 -0
- package/bin/testeranto +0 -0
- package/bundle.js +5 -4
- package/cmd/test_runner/main.go +65 -0
- package/cmd/testeranto/main.go +37 -0
- package/dist/common/src/PM/main.js +126 -11
- package/dist/common/src/PM/pitonoRunner.js +54 -0
- package/dist/common/src/components/pure/TestPageView.js +180 -65
- package/dist/common/src/components/stateful/TestPage.js +50 -11
- package/dist/common/src/lib/abstractBase.test/index.js +1 -0
- package/dist/common/src/run.js +48 -82
- package/dist/common/src/{build.js → testeranto.js} +107 -55
- package/dist/common/src/utils/golingvuMetafile.js +116 -0
- package/dist/common/src/utils/logFiles.js +2 -1
- package/dist/common/src/utils/pitonoMetafile.js +67 -0
- package/dist/common/src/utils.js +40 -1
- package/dist/common/testeranto.config.js +23 -21
- package/dist/common/tsconfig.common.tsbuildinfo +1 -1
- package/dist/module/src/PM/main.js +126 -11
- package/dist/module/src/PM/pitonoRunner.js +47 -0
- package/dist/module/src/components/pure/TestPageView.js +180 -65
- package/dist/module/src/components/stateful/TestPage.js +50 -11
- package/dist/module/src/lib/abstractBase.test/index.js +1 -0
- package/dist/module/src/run.js +49 -45
- package/dist/module/src/{build.js → testeranto.js} +107 -55
- package/dist/module/src/utils/golingvuMetafile.js +109 -0
- package/dist/module/src/utils/logFiles.js +2 -1
- package/dist/module/src/utils/pitonoMetafile.js +60 -0
- package/dist/module/src/utils.js +40 -1
- package/dist/module/testeranto.config.js +23 -21
- package/dist/module/tsconfig.module.tsbuildinfo +1 -1
- package/dist/prebuild/App.js +81 -17
- package/dist/prebuild/testeranto.mjs +3249 -0
- package/dist/types/src/PM/main.d.ts +2 -0
- package/dist/types/src/PM/pitonoRunner.d.ts +7 -0
- package/dist/types/src/Types.d.ts +1 -1
- package/dist/types/src/run.d.ts +0 -1
- package/dist/types/src/utils/golingvuMetafile.d.ts +19 -0
- package/dist/types/src/utils/logFiles.d.ts +5 -1
- package/dist/types/src/utils/pitonoMetafile.d.ts +7 -0
- package/dist/types/src/utils.d.ts +5 -0
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/docs/index.md +13 -13
- package/example/test_example.py +106 -0
- package/go.mod +3 -0
- package/package.json +2 -2
- package/pitono/__init__.py +54 -0
- package/pitono/base_given.py +131 -0
- package/pitono/base_suite.py +95 -0
- package/pitono/base_then.py +50 -0
- package/pitono/base_when.py +52 -0
- package/pitono/core_generator.py +110 -0
- package/pitono/pitono.egg-info/PKG-INFO +17 -0
- package/pitono/pitono.egg-info/SOURCES.txt +7 -0
- package/pitono/pitono.egg-info/dependency_links.txt +1 -0
- package/pitono/pitono.egg-info/entry_points.txt +2 -0
- package/pitono/pitono.egg-info/top_level.txt +1 -0
- package/pitono/pyproject.toml +26 -0
- package/pitono/setup.py +40 -0
- package/pitono/simple_adapter.py +24 -0
- package/pitono/types.py +78 -0
- package/sampleMetafile.json +56 -0
- package/src/PM/main.ts +146 -17
- package/src/PM/pitonoRunner.ts +49 -0
- package/src/Types.ts +1 -1
- package/src/components/pure/TestPageView.tsx +175 -8
- package/src/components/stateful/TestPage.tsx +57 -16
- package/src/core/types.go +36 -0
- package/src/golingvu/README.md +3 -0
- package/src/golingvu/base_given.go +76 -0
- package/src/golingvu/base_suite.go +39 -0
- package/src/golingvu/base_suite_test.go +197 -0
- package/src/golingvu/base_then.go +21 -0
- package/src/golingvu/base_when.go +21 -0
- package/src/golingvu/golingvu.go +179 -0
- package/src/golingvu/test_adapter.go +33 -0
- package/src/golingvu/types.go +86 -0
- package/src/lib/abstractBase.test/index.ts +1 -0
- package/src/pitono/README.md +3 -0
- package/src/run.ts +48 -48
- package/src/templates/frontpage.html +26 -17
- package/src/{build.ts → testeranto.ts} +128 -58
- package/src/utils/golingvuMetafile.ts +165 -0
- package/src/utils/logFiles.ts +2 -1
- package/src/utils/pitonoMetafile.ts +68 -0
- package/src/utils.ts +38 -1
- package/testeranto/App.js +81 -17
- package/testeranto/metafiles/golang/core.json +72 -0
- package/testeranto/metafiles/node/core.json +21 -459
- package/testeranto/metafiles/pure/core.json +18 -119
- package/testeranto/metafiles/web/core.json +37 -16797
- package/testeranto/reports/core/config.json +8 -40
- package/testeranto/reports/core/src/lib/BaseSuite.test/node.test/node/lint_errors.txt +6 -0
- package/testeranto/reports/core/src/lib/BaseSuite.test/node.test/node/prompt.txt +12 -1
- package/testeranto/reports/core/src/lib/BaseSuite.test/pure.test/pure/lint_errors.txt +2 -0
- package/testeranto/reports/core/src/lib/BaseSuite.test/pure.test/pure/prompt.txt +11 -1
- package/testeranto/reports/core/src/lib/BaseSuite.test/web.test/web/lint_errors.txt +2 -0
- package/testeranto/reports/core/src/lib/BaseSuite.test/web.test/web/prompt.txt +13 -3
- package/testeranto/reports/core/summary.json +9 -45
- package/testeranto.config.ts +25 -21
- package/tsc.log +46 -7
- package/dist/common/src/lib/mocks.test.js +0 -11
- package/dist/module/src/lib/mocks.test.js +0 -11
- package/dist/prebuild/ReportServer.mjs +0 -227
- package/dist/prebuild/build.mjs +0 -578
- package/dist/prebuild/mothership/index.mjs +0 -22
- package/dist/prebuild/run.mjs +0 -2290
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/dist/types/src/lib/mocks.test.d.ts +0 -0
- package/src/lib/mocks.test.ts +0 -11
- package/testeranto/reports/core/src/Pure.test/pure/exit.log +0 -0
- package/testeranto/reports/core/src/Pure.test/pure/lint_errors.txt +0 -0
- package/testeranto/reports/core/src/Pure.test/pure/message.txt +0 -17
- package/testeranto/reports/core/src/Pure.test/pure/prompt.txt +0 -14
- package/testeranto/reports/core/src/Pure.test/pure/type_errors.txt +0 -66
- package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/debug.log +0 -0
- package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/error.log +0 -67
- package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/exit.log +0 -1
- package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/info.log +0 -2
- package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/lint_errors.txt +0 -0
- package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/message.txt +0 -17
- package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/prompt.txt +0 -16
- package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/tests.json +0 -68
- package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/type_errors.txt +0 -56
- package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/warn.log +0 -0
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/debug.log +0 -0
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/error.log +0 -22
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/exit.log +0 -1
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/info.log +0 -2
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/lint_errors.txt +0 -13
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/message.txt +0 -17
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/prompt.txt +0 -16
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/tests.json +0 -88
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/type_errors.txt +0 -45
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/warn.log +0 -0
- package/testeranto/reports/core/src/components/pure/TestPageView.test/index/web/debug.log +0 -0
- package/testeranto/reports/core/src/components/pure/TestPageView.test/index/web/error.log +0 -0
- package/testeranto/reports/core/src/components/pure/TestPageView.test/index/web/exit.log +0 -1
- package/testeranto/reports/core/src/components/pure/TestPageView.test/index/web/info.log +0 -2
- package/testeranto/reports/core/src/components/pure/TestPageView.test/index/web/lint_errors.txt +0 -47
- package/testeranto/reports/core/src/components/pure/TestPageView.test/index/web/message.txt +0 -17
- package/testeranto/reports/core/src/components/pure/TestPageView.test/index/web/prompt.txt +0 -17
- package/testeranto/reports/core/src/components/pure/TestPageView.test/index/web/tests.json +0 -57
- package/testeranto/reports/core/src/components/pure/TestPageView.test/index/web/type_errors.txt +0 -99
- package/testeranto/reports/core/src/components/pure/TestPageView.test/index/web/warn.log +0 -0
- package/testeranto/reports/core/src/lib/TipoSkripto.test/TipoSkripto/node/exit.log +0 -1
- package/testeranto/reports/core/src/lib/TipoSkripto.test/TipoSkripto/node/lint_errors.txt +0 -0
- package/testeranto/reports/core/src/lib/TipoSkripto.test/TipoSkripto/node/message.txt +0 -17
- package/testeranto/reports/core/src/lib/TipoSkripto.test/TipoSkripto/node/prompt.txt +0 -17
- package/testeranto/reports/core/src/lib/TipoSkripto.test/TipoSkripto/node/stderr.log +0 -18
- package/testeranto/reports/core/src/lib/TipoSkripto.test/TipoSkripto/node/stdout.log +0 -0
- package/testeranto/reports/core/src/lib/TipoSkripto.test/TipoSkripto/node/type_errors.txt +0 -32
- package/testeranto/reports/core/src/lib/pmProxy.test/index/node/exit.log +0 -1
- package/testeranto/reports/core/src/lib/pmProxy.test/index/node/lint_errors.txt +0 -15
- package/testeranto/reports/core/src/lib/pmProxy.test/index/node/message.txt +0 -17
- package/testeranto/reports/core/src/lib/pmProxy.test/index/node/prompt.txt +0 -17
- package/testeranto/reports/core/src/lib/pmProxy.test/index/node/stderr.log +0 -66
- package/testeranto/reports/core/src/lib/pmProxy.test/index/node/stdout.log +0 -10
- package/testeranto/reports/core/src/lib/pmProxy.test/index/node/type_errors.txt +0 -47
- /package/dist/types/src/{build.d.ts → testeranto.d.ts} +0 -0
|
@@ -53,12 +53,14 @@ readline_1.default.emitKeypressEvents(process.stdin);
|
|
|
53
53
|
if (process.stdin.isTTY)
|
|
54
54
|
process.stdin.setRawMode(true);
|
|
55
55
|
const testName = process.argv[2];
|
|
56
|
-
|
|
56
|
+
const mode = process.argv[3];
|
|
57
57
|
if (mode !== "once" && mode !== "dev") {
|
|
58
|
-
console.error(`The
|
|
58
|
+
console.error(`The 3rd argument should be 'dev' or 'once', not '${mode}'.`);
|
|
59
59
|
process.exit(-1);
|
|
60
60
|
}
|
|
61
|
-
|
|
61
|
+
const f = process.cwd() + "/" + "testeranto.config.ts";
|
|
62
|
+
console.log("config file:", f);
|
|
63
|
+
Promise.resolve(`${f}`).then(s => __importStar(require(s))).then(async (module) => {
|
|
62
64
|
const pckge = (await Promise.resolve(`${`${process.cwd()}/package.json`}`).then(s => __importStar(require(s)))).default;
|
|
63
65
|
const bigConfig = module.default;
|
|
64
66
|
const project = bigConfig.projects[testName];
|
|
@@ -68,56 +70,31 @@ Promise.resolve(`${process.cwd() + "/" + "testeranto.config.ts"}`).then(s => __i
|
|
|
68
70
|
}
|
|
69
71
|
fs_1.default.writeFileSync(`${process.cwd()}/testeranto/projects.json`, JSON.stringify(Object.keys(bigConfig.projects), null, 2));
|
|
70
72
|
const rawConfig = bigConfig.projects[testName];
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
};
|
|
83
|
-
return Array.from(meta(config.tests, new Set()));
|
|
84
|
-
};
|
|
85
|
-
// const getSideCars = (runtime?: IRunTime): string[] => {
|
|
86
|
-
// return Array.from(
|
|
87
|
-
// new Set(
|
|
88
|
-
// config.tests
|
|
89
|
-
// .reduce((mm, t) => {
|
|
90
|
-
// mm = mm.concat(t[3]);
|
|
91
|
-
// return mm;
|
|
92
|
-
// }, [] as ITestTypes[])
|
|
93
|
-
// .filter((t) => {
|
|
94
|
-
// return t[1] === runtime;
|
|
95
|
-
// })
|
|
96
|
-
// .map((t) => {
|
|
97
|
-
// return t[0];
|
|
98
|
-
// })
|
|
99
|
-
// )
|
|
100
|
-
// );
|
|
101
|
-
// };
|
|
73
|
+
if (!rawConfig) {
|
|
74
|
+
console.error(`Project "${testName}" does not exist in the configuration.`);
|
|
75
|
+
console.error("Available projects:", Object.keys(bigConfig.projects));
|
|
76
|
+
process.exit(-1);
|
|
77
|
+
}
|
|
78
|
+
if (!rawConfig.tests) {
|
|
79
|
+
console.error(testName, "appears to have no tests: ", f);
|
|
80
|
+
console.error(`here is the config:`);
|
|
81
|
+
console.log(JSON.stringify(rawConfig));
|
|
82
|
+
process.exit(-1);
|
|
83
|
+
}
|
|
102
84
|
const config = Object.assign(Object.assign({}, rawConfig), { buildDir: process.cwd() + "/testeranto/bundles/" + testName });
|
|
103
|
-
console.log(
|
|
85
|
+
console.log(ansi_colors_1.default.inverse("Press 'q' to initiate a graceful shutdown."));
|
|
86
|
+
console.log(ansi_colors_1.default.inverse("Press 'x' to quit forcefully."));
|
|
104
87
|
process.stdin.on("keypress", (str, key) => {
|
|
105
|
-
if (key.name === "
|
|
106
|
-
console.log("
|
|
107
|
-
mode = "once";
|
|
108
|
-
onDone();
|
|
109
|
-
}
|
|
110
|
-
else if (key.name === "x") {
|
|
111
|
-
console.log("Testeranto-Build is shutting down forcefully...");
|
|
88
|
+
if (key.name === "x") {
|
|
89
|
+
console.log(ansi_colors_1.default.inverse("Shutting down forcefully..."));
|
|
112
90
|
process.exit(-1);
|
|
113
91
|
}
|
|
114
|
-
else {
|
|
115
|
-
console.log(`Press 'q' to shutdown gracefully. Press 'x' to shutdown forcefully.`);
|
|
116
|
-
}
|
|
117
92
|
});
|
|
118
93
|
let nodeDone = false;
|
|
119
94
|
let webDone = false;
|
|
120
95
|
let importDone = false;
|
|
96
|
+
let golangDone = false;
|
|
97
|
+
let pitonoDone = false;
|
|
121
98
|
let status = "build";
|
|
122
99
|
const { nodeEntryPoints, nodeEntryPointSidecars, webEntryPoints, webEntryPointSidecars, pureEntryPoints, pureEntryPointSidecars, } = (0, utils_1.getRunnables)(config.tests, testName);
|
|
123
100
|
const onNodeDone = () => {
|
|
@@ -132,13 +109,35 @@ Promise.resolve(`${process.cwd() + "/" + "testeranto.config.ts"}`).then(s => __i
|
|
|
132
109
|
importDone = true;
|
|
133
110
|
onDone();
|
|
134
111
|
};
|
|
112
|
+
const onGolangDone = () => {
|
|
113
|
+
golangDone = true;
|
|
114
|
+
onDone();
|
|
115
|
+
};
|
|
116
|
+
const onPitonoDone = () => {
|
|
117
|
+
pitonoDone = true;
|
|
118
|
+
onDone();
|
|
119
|
+
};
|
|
120
|
+
let pm = null;
|
|
135
121
|
const onDone = async () => {
|
|
136
|
-
|
|
122
|
+
// Check which test types are present
|
|
123
|
+
const hasGolangTests = config.tests.some(test => test[1] === 'golang');
|
|
124
|
+
const hasPitonoTests = config.tests.some(test => test[1] === 'pitono');
|
|
125
|
+
// Wait for all relevant runtimes to be done
|
|
126
|
+
const allDone = nodeDone && webDone && importDone &&
|
|
127
|
+
(!hasGolangTests || golangDone) &&
|
|
128
|
+
(!hasPitonoTests || pitonoDone);
|
|
129
|
+
if (allDone) {
|
|
137
130
|
status = "built";
|
|
131
|
+
// Start the PM_Main to run the tests after build
|
|
132
|
+
if (!pm) {
|
|
133
|
+
const { PM_Main } = await Promise.resolve().then(() => __importStar(require("./PM/main")));
|
|
134
|
+
pm = new PM_Main(config, testName, mode);
|
|
135
|
+
await pm.start();
|
|
136
|
+
}
|
|
138
137
|
}
|
|
139
|
-
if (
|
|
138
|
+
if (allDone && mode === "once") {
|
|
140
139
|
console.log(ansi_colors_1.default.inverse(`${testName} was built and the builder exited successfully.`));
|
|
141
|
-
|
|
140
|
+
// Let PM_Main handle the exit after tests are complete
|
|
142
141
|
}
|
|
143
142
|
};
|
|
144
143
|
fs_1.default.writeFileSync(`${process.cwd()}/testeranto/projects.html`, (0, buildTemplates_1.AppHtml)());
|
|
@@ -149,6 +148,55 @@ Promise.resolve(`${process.cwd() + "/" + "testeranto.config.ts"}`).then(s => __i
|
|
|
149
148
|
}
|
|
150
149
|
fs_1.default.writeFileSync(`testeranto/reports/${projectName}/config.json`, JSON.stringify(config, null, 2));
|
|
151
150
|
});
|
|
151
|
+
const getSecondaryEndpointsPoints = (runtime) => {
|
|
152
|
+
const meta = (ts, st) => {
|
|
153
|
+
ts.forEach((t) => {
|
|
154
|
+
if (t[1] === runtime) {
|
|
155
|
+
st.add(t[0]);
|
|
156
|
+
}
|
|
157
|
+
if (Array.isArray(t[3])) {
|
|
158
|
+
meta(t[3], st);
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
return st;
|
|
162
|
+
};
|
|
163
|
+
return Array.from(meta(config.tests, new Set()));
|
|
164
|
+
};
|
|
165
|
+
// Also handle pitono endpoints for HTML generation if needed
|
|
166
|
+
[...getSecondaryEndpointsPoints("pitono")].forEach(async (sourceFilePath) => {
|
|
167
|
+
// You might want to generate specific files for pitono tests here
|
|
168
|
+
console.log(`Pitono test found: ${sourceFilePath}`);
|
|
169
|
+
});
|
|
170
|
+
// Handle golang tests by generating their metafiles
|
|
171
|
+
const golangTests = config.tests.filter(test => test[1] === 'golang');
|
|
172
|
+
const hasGolangTests = golangTests.length > 0;
|
|
173
|
+
if (hasGolangTests) {
|
|
174
|
+
// Import and use the golang metafile utilities
|
|
175
|
+
const { generateGolangMetafile, writeGolangMetafile } = await Promise.resolve().then(() => __importStar(require('./utils/golingvuMetafile')));
|
|
176
|
+
// Get the entry points (first element of each test tuple)
|
|
177
|
+
const golangEntryPoints = golangTests.map(test => test[0]);
|
|
178
|
+
const metafile = await generateGolangMetafile(testName, golangEntryPoints);
|
|
179
|
+
writeGolangMetafile(testName, metafile);
|
|
180
|
+
// Mark golang as done after writing the metafile
|
|
181
|
+
onGolangDone();
|
|
182
|
+
}
|
|
183
|
+
// Handle pitono (Python) tests by generating their metafiles
|
|
184
|
+
const pitonoTests = config.tests.filter(test => test[1] === 'pitono');
|
|
185
|
+
const hasPitonoTests = pitonoTests.length > 0;
|
|
186
|
+
if (hasPitonoTests) {
|
|
187
|
+
// Import and use the pitono metafile utilities
|
|
188
|
+
const { generatePitonoMetafile } = await Promise.resolve().then(() => __importStar(require('./utils/pitonoMetafile')));
|
|
189
|
+
// Get the entry points (first element of each test tuple)
|
|
190
|
+
const pitonoEntryPoints = pitonoTests.map(test => test[0]);
|
|
191
|
+
const metafile = await generatePitonoMetafile(testName, pitonoEntryPoints);
|
|
192
|
+
// Ensure the directory exists
|
|
193
|
+
const pitonoMetafilePath = `${process.cwd()}/testeranto/metafiles/python`;
|
|
194
|
+
await fs_1.default.promises.mkdir(pitonoMetafilePath, { recursive: true });
|
|
195
|
+
// Write the metafile to the specified path
|
|
196
|
+
fs_1.default.writeFileSync(`${pitonoMetafilePath}/core.json`, JSON.stringify(metafile, null, 2));
|
|
197
|
+
// Mark pitono as done after writing the metafile
|
|
198
|
+
onPitonoDone();
|
|
199
|
+
}
|
|
152
200
|
Promise.resolve(Promise.all([...getSecondaryEndpointsPoints("web")].map(async (sourceFilePath) => {
|
|
153
201
|
const sourceFileSplit = sourceFilePath.split("/");
|
|
154
202
|
const sourceDir = sourceFileSplit.slice(0, -1);
|
|
@@ -164,13 +212,6 @@ Promise.resolve(`${process.cwd() + "/" + "testeranto.config.ts"}`).then(s => __i
|
|
|
164
212
|
.mkdir(path_1.default.dirname(htmlFilePath), { recursive: true })
|
|
165
213
|
.then((x) => fs_1.default.writeFileSync(htmlFilePath, (0, web_html_1.default)(jsfilePath, htmlFilePath, cssFilePath)));
|
|
166
214
|
})));
|
|
167
|
-
// glob(`${process.cwd()}/testeranto/bundles/${testName}/chunk-*.mjs`, {
|
|
168
|
-
// ignore: "node_modules/**",
|
|
169
|
-
// }).then((chunks) => {
|
|
170
|
-
// chunks.forEach((chunk) => {
|
|
171
|
-
// fs.unlinkSync(chunk);
|
|
172
|
-
// });
|
|
173
|
-
// });
|
|
174
215
|
const x = [
|
|
175
216
|
["pure", Object.keys(pureEntryPoints)],
|
|
176
217
|
["node", Object.keys(nodeEntryPoints)],
|
|
@@ -228,4 +269,15 @@ Promise.resolve(`${process.cwd() + "/" + "testeranto.config.ts"}`).then(s => __i
|
|
|
228
269
|
});
|
|
229
270
|
}),
|
|
230
271
|
]);
|
|
272
|
+
process.stdin.on("keypress", (str, key) => {
|
|
273
|
+
if (key.name === "q") {
|
|
274
|
+
console.log("Testeranto is shutting down gracefully...");
|
|
275
|
+
if (pm) {
|
|
276
|
+
pm.stop();
|
|
277
|
+
}
|
|
278
|
+
else {
|
|
279
|
+
process.exit();
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
});
|
|
231
283
|
});
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.generateGolangMetafile = generateGolangMetafile;
|
|
7
|
+
exports.writeGolangMetafile = writeGolangMetafile;
|
|
8
|
+
const fs_1 = __importDefault(require("fs"));
|
|
9
|
+
const path_1 = __importDefault(require("path"));
|
|
10
|
+
async function generateGolangMetafile(testName, entryPoints) {
|
|
11
|
+
const outputs = {};
|
|
12
|
+
// Process each Go entry point
|
|
13
|
+
for (const entryPoint of entryPoints) {
|
|
14
|
+
try {
|
|
15
|
+
// Get the package directory to find all Go files in the same package
|
|
16
|
+
const entryDir = path_1.default.dirname(entryPoint);
|
|
17
|
+
// Find all .go files in the same directory
|
|
18
|
+
const goFiles = fs_1.default.readdirSync(entryDir)
|
|
19
|
+
.filter(file => file.endsWith('.go'))
|
|
20
|
+
.map(file => path_1.default.join(entryDir, file));
|
|
21
|
+
// Create inputs record
|
|
22
|
+
const inputs = {};
|
|
23
|
+
let totalBytes = 0;
|
|
24
|
+
for (const file of goFiles) {
|
|
25
|
+
try {
|
|
26
|
+
const stats = fs_1.default.statSync(file);
|
|
27
|
+
inputs[file] = { bytesInOutput: stats.size };
|
|
28
|
+
totalBytes += stats.size;
|
|
29
|
+
}
|
|
30
|
+
catch (_a) {
|
|
31
|
+
inputs[file] = { bytesInOutput: 0 };
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
// Add the entry point itself if not already included
|
|
35
|
+
if (!inputs[entryPoint]) {
|
|
36
|
+
try {
|
|
37
|
+
const entryStats = fs_1.default.statSync(entryPoint);
|
|
38
|
+
inputs[entryPoint] = { bytesInOutput: entryStats.size };
|
|
39
|
+
totalBytes += entryStats.size;
|
|
40
|
+
}
|
|
41
|
+
catch (_b) {
|
|
42
|
+
inputs[entryPoint] = { bytesInOutput: 0 };
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
// The output path should match the Node.js structure - use a path in testeranto/bundles
|
|
46
|
+
// For Go, we don't have actual bundled outputs, so we'll use a placeholder
|
|
47
|
+
const outputPath = `testeranto/bundles/golang/${testName}/${entryPoint}`;
|
|
48
|
+
outputs[outputPath] = {
|
|
49
|
+
entryPoint: entryPoint, // Use the source file path, not the bundle path
|
|
50
|
+
inputs,
|
|
51
|
+
bytes: totalBytes
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
console.error(`Error processing Go entry point ${entryPoint}:`, error);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
// Create inputs record for the metafile - include all Go files
|
|
59
|
+
const allInputs = {};
|
|
60
|
+
// Collect all unique Go files from all entry points
|
|
61
|
+
const allGoFiles = new Set();
|
|
62
|
+
for (const entryPoint of entryPoints) {
|
|
63
|
+
try {
|
|
64
|
+
const entryDir = path_1.default.dirname(entryPoint);
|
|
65
|
+
// Find all .go files in the same directory
|
|
66
|
+
const goFiles = fs_1.default.readdirSync(entryDir)
|
|
67
|
+
.filter(file => file.endsWith('.go'))
|
|
68
|
+
.map(file => path_1.default.join(entryDir, file));
|
|
69
|
+
goFiles.forEach(file => allGoFiles.add(file));
|
|
70
|
+
// Add the entry point itself
|
|
71
|
+
allGoFiles.add(entryPoint);
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
console.error(`Error processing Go entry point ${entryPoint} for source files:`, error);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
// Add all Go files to inputs
|
|
78
|
+
for (const filePath of Array.from(allGoFiles)) {
|
|
79
|
+
try {
|
|
80
|
+
const stats = fs_1.default.statSync(filePath);
|
|
81
|
+
allInputs[filePath] = {
|
|
82
|
+
bytes: stats.size,
|
|
83
|
+
imports: [] // Go files don't have imports like JS
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
catch (_c) {
|
|
87
|
+
allInputs[filePath] = {
|
|
88
|
+
bytes: 0,
|
|
89
|
+
imports: []
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
// Reformat outputs to match esbuild structure
|
|
94
|
+
const esbuildOutputs = {};
|
|
95
|
+
for (const [outputPath, output] of Object.entries(outputs)) {
|
|
96
|
+
esbuildOutputs[outputPath] = {
|
|
97
|
+
bytes: output.bytes,
|
|
98
|
+
inputs: output.inputs,
|
|
99
|
+
entryPoint: output.entryPoint
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
return {
|
|
103
|
+
errors: [],
|
|
104
|
+
warnings: [],
|
|
105
|
+
metafile: {
|
|
106
|
+
inputs: allInputs,
|
|
107
|
+
outputs: esbuildOutputs
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
function writeGolangMetafile(testName, metafile) {
|
|
112
|
+
const metafileDir = path_1.default.join(process.cwd(), "testeranto", "metafiles", "golang");
|
|
113
|
+
fs_1.default.mkdirSync(metafileDir, { recursive: true });
|
|
114
|
+
const metafilePath = path_1.default.join(metafileDir, `${testName}.json`);
|
|
115
|
+
fs_1.default.writeFileSync(metafilePath, JSON.stringify(metafile, null, 2));
|
|
116
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.generatePitonoMetafile = generatePitonoMetafile;
|
|
7
|
+
exports.writePitonoMetafile = writePitonoMetafile;
|
|
8
|
+
const fs_1 = __importDefault(require("fs"));
|
|
9
|
+
const path_1 = __importDefault(require("path"));
|
|
10
|
+
const child_process_1 = require("child_process");
|
|
11
|
+
async function generatePitonoMetafile(testName, entryPoints) {
|
|
12
|
+
return {
|
|
13
|
+
testName,
|
|
14
|
+
entryPoints,
|
|
15
|
+
timestamp: Date.now()
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
function writePitonoMetafile(testName, metafile) {
|
|
19
|
+
const metafilePath = path_1.default.join(process.cwd(), 'testeranto', 'pitono', testName, 'metafile.json');
|
|
20
|
+
const metafileDir = path_1.default.dirname(metafilePath);
|
|
21
|
+
// Ensure directory exists
|
|
22
|
+
if (!fs_1.default.existsSync(metafileDir)) {
|
|
23
|
+
fs_1.default.mkdirSync(metafileDir, { recursive: true });
|
|
24
|
+
}
|
|
25
|
+
// Write the metafile
|
|
26
|
+
fs_1.default.writeFileSync(metafilePath, JSON.stringify(metafile, null, 2));
|
|
27
|
+
console.log(`Pitono metafile written to: ${metafilePath}`);
|
|
28
|
+
// Generate core.json using the Python script
|
|
29
|
+
try {
|
|
30
|
+
// First try using the installed command
|
|
31
|
+
const command = `pitono-core-generator ${testName} ${metafile.entryPoints.join(' ')}`;
|
|
32
|
+
(0, child_process_1.execSync)(command, { stdio: 'inherit' });
|
|
33
|
+
console.log(`Pitono core.json generated successfully for ${testName}`);
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
console.error(`Failed to generate Pitono core.json with installed command: ${error}`);
|
|
37
|
+
// Fallback to direct Python execution
|
|
38
|
+
try {
|
|
39
|
+
const pythonCommand = `python ${process.cwd()}/pitono/core_generator.py ${testName} ${metafile.entryPoints.join(' ')}`;
|
|
40
|
+
(0, child_process_1.execSync)(pythonCommand, { stdio: 'inherit' });
|
|
41
|
+
console.log(`Pitono core.json generated successfully using direct Python execution`);
|
|
42
|
+
}
|
|
43
|
+
catch (fallbackError) {
|
|
44
|
+
console.error(`Direct Python execution also failed: ${fallbackError}`);
|
|
45
|
+
// Last resort: create the core.json manually
|
|
46
|
+
try {
|
|
47
|
+
const coreData = {
|
|
48
|
+
testName: testName,
|
|
49
|
+
entryPoints: metafile.entryPoints,
|
|
50
|
+
outputs: {},
|
|
51
|
+
metafile: {
|
|
52
|
+
inputs: {},
|
|
53
|
+
outputs: {}
|
|
54
|
+
},
|
|
55
|
+
timestamp: Date.now(),
|
|
56
|
+
runtime: "pitono"
|
|
57
|
+
};
|
|
58
|
+
const coreFilePath = path_1.default.join(process.cwd(), 'testeranto', 'pitono', testName, 'core.json');
|
|
59
|
+
fs_1.default.writeFileSync(coreFilePath, JSON.stringify(coreData, null, 2));
|
|
60
|
+
console.log(`Pitono core.json created manually as fallback`);
|
|
61
|
+
}
|
|
62
|
+
catch (manualError) {
|
|
63
|
+
console.error(`Even manual creation failed: ${manualError}`);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
package/dist/common/src/utils.js
CHANGED
|
@@ -31,13 +31,32 @@ const promptPather = (entryPoint, platform, projectName) => {
|
|
|
31
31
|
};
|
|
32
32
|
exports.promptPather = promptPather;
|
|
33
33
|
const getRunnables = (tests, projectName, payload = {
|
|
34
|
+
pythonEntryPoints: {},
|
|
34
35
|
nodeEntryPoints: {},
|
|
35
36
|
nodeEntryPointSidecars: {},
|
|
36
37
|
webEntryPoints: {},
|
|
37
38
|
webEntryPointSidecars: {},
|
|
38
39
|
pureEntryPoints: {},
|
|
39
40
|
pureEntryPointSidecars: {},
|
|
41
|
+
golangEntryPoints: {},
|
|
42
|
+
golangEntryPointSidecars: {},
|
|
43
|
+
pitonoEntryPoints: {},
|
|
44
|
+
pitonoEntryPointSidecars: {},
|
|
40
45
|
}) => {
|
|
46
|
+
// Ensure all properties are properly initialized
|
|
47
|
+
const initializedPayload = {
|
|
48
|
+
pythonEntryPoints: payload.pythonEntryPoints || {},
|
|
49
|
+
nodeEntryPoints: payload.nodeEntryPoints || {},
|
|
50
|
+
nodeEntryPointSidecars: payload.nodeEntryPointSidecars || {},
|
|
51
|
+
webEntryPoints: payload.webEntryPoints || {},
|
|
52
|
+
webEntryPointSidecars: payload.webEntryPointSidecars || {},
|
|
53
|
+
pureEntryPoints: payload.pureEntryPoints || {},
|
|
54
|
+
pureEntryPointSidecars: payload.pureEntryPointSidecars || {},
|
|
55
|
+
golangEntryPoints: payload.golangEntryPoints || {},
|
|
56
|
+
golangEntryPointSidecars: payload.golangEntryPointSidecars || {},
|
|
57
|
+
pitonoEntryPoints: payload.pitonoEntryPoints || {},
|
|
58
|
+
pitonoEntryPointSidecars: payload.pitonoEntryPointSidecars || {},
|
|
59
|
+
};
|
|
41
60
|
return tests.reduce((pt, cv, cndx, cry) => {
|
|
42
61
|
if (cv[1] === "node") {
|
|
43
62
|
pt.nodeEntryPoints[cv[0]] = path_1.default.resolve(`./testeranto/bundles/node/${projectName}/${cv[0]
|
|
@@ -60,6 +79,14 @@ const getRunnables = (tests, projectName, payload = {
|
|
|
60
79
|
.concat("mjs")
|
|
61
80
|
.join(".")}`);
|
|
62
81
|
}
|
|
82
|
+
else if (cv[1] === "golang") {
|
|
83
|
+
// For Go files, we'll use the original path since they're not compiled to JS
|
|
84
|
+
pt.golangEntryPoints[cv[0]] = path_1.default.resolve(cv[0]);
|
|
85
|
+
}
|
|
86
|
+
else if (cv[1] === "pitono") {
|
|
87
|
+
// For pitono files, use the original Python file path
|
|
88
|
+
pt.pitonoEntryPoints[cv[0]] = path_1.default.resolve(cv[0]);
|
|
89
|
+
}
|
|
63
90
|
//////////////////////////////////////////////////////////
|
|
64
91
|
cv[3]
|
|
65
92
|
.filter((t) => t[1] === "node")
|
|
@@ -88,7 +115,19 @@ const getRunnables = (tests, projectName, payload = {
|
|
|
88
115
|
.concat("mjs")
|
|
89
116
|
.join(".")}`);
|
|
90
117
|
});
|
|
118
|
+
cv[3]
|
|
119
|
+
.filter((t) => t[1] === "golang")
|
|
120
|
+
.forEach((t) => {
|
|
121
|
+
// For Go sidecars, use the original path
|
|
122
|
+
pt.golangEntryPointSidecars[`${t[0]}`] = path_1.default.resolve(t[0]);
|
|
123
|
+
});
|
|
124
|
+
cv[3]
|
|
125
|
+
.filter((t) => t[1] === "pitono")
|
|
126
|
+
.forEach((t) => {
|
|
127
|
+
// For pitono sidecars, use the original Python file path
|
|
128
|
+
pt.pitonoEntryPointSidecars[`${t[0]}`] = path_1.default.resolve(t[0]);
|
|
129
|
+
});
|
|
91
130
|
return pt;
|
|
92
|
-
},
|
|
131
|
+
}, initializedPayload);
|
|
93
132
|
};
|
|
94
133
|
exports.getRunnables = getRunnables;
|
|
@@ -21,30 +21,32 @@ const config = {
|
|
|
21
21
|
// },
|
|
22
22
|
core: {
|
|
23
23
|
tests: [
|
|
24
|
+
["example/test_example.py", "python", { ports: 0 }, []],
|
|
25
|
+
["src/golingvu/base_suite_test.go", "golang", { ports: 0 }, []],
|
|
24
26
|
["src/lib/BaseSuite.test/node.test.ts", "node", { ports: 0 }, []],
|
|
25
27
|
["src/lib/BaseSuite.test/pure.test.ts", "pure", { ports: 0 }, []],
|
|
26
28
|
["src/lib/BaseSuite.test/web.test.ts", "web", { ports: 0 }, []],
|
|
27
|
-
[
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
],
|
|
33
|
-
[
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
],
|
|
39
|
-
["src/Pure.test.ts", "pure", { ports: 0 }, []],
|
|
40
|
-
["src/lib/pmProxy.test/index.ts", "node", { ports: 0 }, []],
|
|
41
|
-
["src/lib/TipoSkripto.test/TipoSkripto.ts", "node", { ports: 0 }, []],
|
|
42
|
-
[
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
],
|
|
29
|
+
// [
|
|
30
|
+
// "src/components/pure/TestPageView.test/index.tsx",
|
|
31
|
+
// "web",
|
|
32
|
+
// { ports: 0 },
|
|
33
|
+
// [],
|
|
34
|
+
// ],
|
|
35
|
+
// [
|
|
36
|
+
// "src/components/pure/ProjectPageView.test/index.tsx",
|
|
37
|
+
// "web",
|
|
38
|
+
// { ports: 0 },
|
|
39
|
+
// [],
|
|
40
|
+
// ],
|
|
41
|
+
// ["src/Pure.test.ts", "pure", { ports: 0 }, []],
|
|
42
|
+
// ["src/lib/pmProxy.test/index.ts", "node", { ports: 0 }, []],
|
|
43
|
+
// ["src/lib/TipoSkripto.test/TipoSkripto.ts", "node", { ports: 0 }, []],
|
|
44
|
+
// [
|
|
45
|
+
// "src/components/pure/FeaturesReporterView.test/index.tsx",
|
|
46
|
+
// "web",
|
|
47
|
+
// { ports: 0 },
|
|
48
|
+
// [],
|
|
49
|
+
// ],
|
|
48
50
|
//////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
49
51
|
// broken
|
|
50
52
|
// [
|