testeranto 0.198.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.
- package/bin/test_runner +0 -0
- package/bin/testeranto +0 -0
- package/bundle.js +2 -2
- 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/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 +14 -14
- 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/build.mjs +0 -578
- 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
package/bin/test_runner
ADDED
|
Binary file
|
package/bin/testeranto
ADDED
|
Binary file
|
package/bundle.js
CHANGED
|
@@ -4,8 +4,8 @@ import { sassPlugin } from 'esbuild-sass-plugin'
|
|
|
4
4
|
await esbuild.build({
|
|
5
5
|
outExtension: { '.js': '.mjs' },
|
|
6
6
|
entryPoints: [
|
|
7
|
-
'src/build.ts',
|
|
8
|
-
'src/run.ts',
|
|
7
|
+
// 'src/build.ts',
|
|
8
|
+
// 'src/run.ts',
|
|
9
9
|
'src/init-docs.ts',
|
|
10
10
|
'src/ReportServer.ts',
|
|
11
11
|
'src/esbuildConfigs/eslint-formatter-testeranto.ts',
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
package main
|
|
2
|
+
|
|
3
|
+
import (
|
|
4
|
+
"fmt"
|
|
5
|
+
"log"
|
|
6
|
+
|
|
7
|
+
"testeranto/src/golingvu"
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
func main() {
|
|
11
|
+
fmt.Println("Starting Golingvu test runner...")
|
|
12
|
+
|
|
13
|
+
// Create a simple test implementation
|
|
14
|
+
testImplementation := golingvu.ITestImplementation{
|
|
15
|
+
Suites: make(map[string]interface{}),
|
|
16
|
+
Givens: make(map[string]interface{}),
|
|
17
|
+
Whens: make(map[string]interface{}),
|
|
18
|
+
Thens: make(map[string]interface{}),
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// Create a test specification
|
|
22
|
+
testSpecification := func(suites, givens, whens, thens interface{}) interface{} {
|
|
23
|
+
fmt.Println("Test specification called")
|
|
24
|
+
return nil
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Create a test adapter
|
|
28
|
+
testAdapter := &golingvu.SimpleTestAdapter{}
|
|
29
|
+
|
|
30
|
+
// Create a test resource requirement
|
|
31
|
+
testResourceRequirement := golingvu.ITTestResourceRequest{
|
|
32
|
+
Ports: 0,
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Create uberCatcher
|
|
36
|
+
uberCatcher := func(f func()) {
|
|
37
|
+
// Handle panics
|
|
38
|
+
defer func() {
|
|
39
|
+
if r := recover(); r != nil {
|
|
40
|
+
log.Printf("Recovered from panic: %v", r)
|
|
41
|
+
}
|
|
42
|
+
}()
|
|
43
|
+
f()
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Create Golingvu instance
|
|
47
|
+
gv := golingvu.NewGolingvu(
|
|
48
|
+
nil,
|
|
49
|
+
testSpecification,
|
|
50
|
+
testImplementation,
|
|
51
|
+
testResourceRequirement,
|
|
52
|
+
testAdapter,
|
|
53
|
+
uberCatcher,
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
fmt.Printf("Golingvu instance created successfully: %v\n", gv != nil)
|
|
57
|
+
|
|
58
|
+
// Try to get specs
|
|
59
|
+
specs := gv.GetSpecs()
|
|
60
|
+
fmt.Printf("Specs: %v\n", specs)
|
|
61
|
+
|
|
62
|
+
// Try to get test jobs
|
|
63
|
+
testJobs := gv.GetTestJobs()
|
|
64
|
+
fmt.Printf("Number of test jobs: %d\n", len(testJobs))
|
|
65
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
package main
|
|
2
|
+
|
|
3
|
+
import (
|
|
4
|
+
"fmt"
|
|
5
|
+
|
|
6
|
+
"testeranto/src/golingvu"
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
func main() {
|
|
10
|
+
fmt.Println("Golingvu Implementation (Testeranto in Go)")
|
|
11
|
+
|
|
12
|
+
// Example usage
|
|
13
|
+
testSpec := func(suites, givens, whens, thens interface{}) interface{} {
|
|
14
|
+
// Implement your test specification logic here
|
|
15
|
+
fmt.Println("Generating test specs...")
|
|
16
|
+
return nil
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
testImpl := golingvu.ITestImplementation{
|
|
20
|
+
Suites: make(map[string]interface{}),
|
|
21
|
+
Givens: make(map[string]interface{}),
|
|
22
|
+
Whens: make(map[string]interface{}),
|
|
23
|
+
Thens: make(map[string]interface{}),
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
gv := golingvu.NewGolingvu(
|
|
27
|
+
nil,
|
|
28
|
+
testSpec,
|
|
29
|
+
testImpl,
|
|
30
|
+
golingvu.DefaultTestResourceRequest,
|
|
31
|
+
nil,
|
|
32
|
+
func(f func()) { f() },
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
fmt.Printf("Golingvu initialized: %v\n", gv)
|
|
36
|
+
fmt.Printf("Specs: %v\n", gv.GetSpecs())
|
|
37
|
+
}
|
|
@@ -87,6 +87,13 @@ function runtimeLogs(runtime, reportDest) {
|
|
|
87
87
|
exit: fs_1.default.createWriteStream(`${safeDest}/exit.log`),
|
|
88
88
|
};
|
|
89
89
|
}
|
|
90
|
+
else if (runtime === "pitono") {
|
|
91
|
+
return {
|
|
92
|
+
stdout: fs_1.default.createWriteStream(`${safeDest}/stdout.log`),
|
|
93
|
+
stderr: fs_1.default.createWriteStream(`${safeDest}/stderr.log`),
|
|
94
|
+
exit: fs_1.default.createWriteStream(`${safeDest}/exit.log`),
|
|
95
|
+
};
|
|
96
|
+
}
|
|
90
97
|
else {
|
|
91
98
|
throw `unknown runtime: ${runtime}`;
|
|
92
99
|
}
|
|
@@ -819,6 +826,32 @@ class PM_Main extends PM_WithEslintAndTsc_js_1.PM_WithEslintAndTsc {
|
|
|
819
826
|
// }
|
|
820
827
|
// }
|
|
821
828
|
};
|
|
829
|
+
this.launchPitono = async (src, dest) => {
|
|
830
|
+
console.log(ansi_colors_2.default.green(ansi_colors_2.default.inverse(`pitono < ${src}`)));
|
|
831
|
+
this.bddTestIsRunning(src);
|
|
832
|
+
const reportDest = `testeranto/reports/${this.name}/${src
|
|
833
|
+
.split(".")
|
|
834
|
+
.slice(0, -1)
|
|
835
|
+
.join(".")}/pitono`;
|
|
836
|
+
if (!fs_1.default.existsSync(reportDest)) {
|
|
837
|
+
fs_1.default.mkdirSync(reportDest, { recursive: true });
|
|
838
|
+
}
|
|
839
|
+
const logs = createLogStreams(reportDest, "node"); // Use node-style logs for pitono
|
|
840
|
+
try {
|
|
841
|
+
// Execute the Python test using the pitono runner
|
|
842
|
+
const { PitonoRunner } = await Promise.resolve().then(() => __importStar(require('./pitonoRunner')));
|
|
843
|
+
const runner = new PitonoRunner(this.configs, this.name);
|
|
844
|
+
await runner.run();
|
|
845
|
+
this.bddTestIsNowDone(src, 0);
|
|
846
|
+
statusMessagePretty(0, src, "pitono");
|
|
847
|
+
}
|
|
848
|
+
catch (error) {
|
|
849
|
+
logs.writeExitCode(-1, error);
|
|
850
|
+
console.log(ansi_colors_2.default.red(ansi_colors_2.default.inverse(`${src} errored with: ${error}. Check logs for more info`)));
|
|
851
|
+
this.bddTestIsNowDone(src, -1);
|
|
852
|
+
statusMessagePretty(-1, src, "pitono");
|
|
853
|
+
}
|
|
854
|
+
};
|
|
822
855
|
this.launchWeb = async (src, dest) => {
|
|
823
856
|
console.log(ansi_colors_2.default.green(ansi_colors_2.default.inverse(`web < ${src}`)));
|
|
824
857
|
this.bddTestIsRunning(src);
|
|
@@ -1391,7 +1424,7 @@ import('${d}').then(async (x) => {
|
|
|
1391
1424
|
console.error(e);
|
|
1392
1425
|
console.error("could not start chrome via puppeter. Check this path: ", executablePath);
|
|
1393
1426
|
}
|
|
1394
|
-
const { nodeEntryPoints, webEntryPoints, pureEntryPoints } = this.getRunnables(this.configs.tests, this.name);
|
|
1427
|
+
const { nodeEntryPoints, webEntryPoints, pureEntryPoints, pitonoEntryPoints } = this.getRunnables(this.configs.tests, this.name);
|
|
1395
1428
|
[
|
|
1396
1429
|
[
|
|
1397
1430
|
nodeEntryPoints,
|
|
@@ -1417,9 +1450,31 @@ import('${d}').then(async (x) => {
|
|
|
1417
1450
|
this.importMetafileWatcher = w;
|
|
1418
1451
|
},
|
|
1419
1452
|
],
|
|
1453
|
+
[
|
|
1454
|
+
pitonoEntryPoints,
|
|
1455
|
+
this.launchPitono,
|
|
1456
|
+
"pitono",
|
|
1457
|
+
(w) => {
|
|
1458
|
+
this.pitonoMetafileWatcher = w;
|
|
1459
|
+
},
|
|
1460
|
+
],
|
|
1420
1461
|
].forEach(async ([eps, launcher, runtime, watcher]) => {
|
|
1421
|
-
|
|
1422
|
-
|
|
1462
|
+
let metafile;
|
|
1463
|
+
if (runtime === "pitono") {
|
|
1464
|
+
metafile = `./testeranto/metafiles/python/core.json`;
|
|
1465
|
+
// Ensure the directory exists before trying to watch
|
|
1466
|
+
const metafileDir = path_1.default.dirname(metafile);
|
|
1467
|
+
if (!fs_1.default.existsSync(metafileDir)) {
|
|
1468
|
+
fs_1.default.mkdirSync(metafileDir, { recursive: true });
|
|
1469
|
+
}
|
|
1470
|
+
}
|
|
1471
|
+
else {
|
|
1472
|
+
metafile = `./testeranto/metafiles/${runtime}/${this.name}.json`;
|
|
1473
|
+
}
|
|
1474
|
+
// Only poll for file if it's not a pitono runtime
|
|
1475
|
+
if (runtime !== "pitono") {
|
|
1476
|
+
await pollForFile(metafile);
|
|
1477
|
+
}
|
|
1423
1478
|
Object.entries(eps).forEach(async ([inputFile, outputFile]) => {
|
|
1424
1479
|
// await pollForFile(outputFile);\
|
|
1425
1480
|
this.launchers[inputFile] = () => launcher(inputFile, outputFile);
|
|
@@ -1440,10 +1495,37 @@ import('${d}').then(async (x) => {
|
|
|
1440
1495
|
}
|
|
1441
1496
|
});
|
|
1442
1497
|
this.metafileOutputs(runtime);
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1498
|
+
// For pitono, we need to wait for the file to be created
|
|
1499
|
+
if (runtime === "pitono") {
|
|
1500
|
+
// Use polling to wait for the file to exist
|
|
1501
|
+
const checkFileExists = () => {
|
|
1502
|
+
if (fs_1.default.existsSync(metafile)) {
|
|
1503
|
+
console.log(ansi_colors_2.default.green(ansi_colors_2.default.inverse(`Pitono metafile found: ${metafile}`)));
|
|
1504
|
+
// Set up the watcher once the file exists
|
|
1505
|
+
watcher((0, fs_1.watch)(metafile, async (e, filename) => {
|
|
1506
|
+
console.log(ansi_colors_2.default.yellow(ansi_colors_2.default.inverse(`< ${e} ${filename} (${runtime})`)));
|
|
1507
|
+
this.metafileOutputs(runtime);
|
|
1508
|
+
}));
|
|
1509
|
+
// Read the metafile immediately
|
|
1510
|
+
this.metafileOutputs(runtime);
|
|
1511
|
+
}
|
|
1512
|
+
else {
|
|
1513
|
+
// Check again after a delay
|
|
1514
|
+
setTimeout(checkFileExists, 1000);
|
|
1515
|
+
}
|
|
1516
|
+
};
|
|
1517
|
+
// Start checking for the file
|
|
1518
|
+
checkFileExists();
|
|
1519
|
+
}
|
|
1520
|
+
else {
|
|
1521
|
+
// For other runtimes, only set up watcher if the file exists
|
|
1522
|
+
if (fs_1.default.existsSync(metafile)) {
|
|
1523
|
+
watcher((0, fs_1.watch)(metafile, async (e, filename) => {
|
|
1524
|
+
console.log(ansi_colors_2.default.yellow(ansi_colors_2.default.inverse(`< ${e} ${filename} (${runtime})`)));
|
|
1525
|
+
this.metafileOutputs(runtime);
|
|
1526
|
+
}));
|
|
1527
|
+
}
|
|
1528
|
+
}
|
|
1447
1529
|
});
|
|
1448
1530
|
// Object.keys(this.configs.externalTests).forEach((et) => {
|
|
1449
1531
|
// this.launchExternalTest(et, this.configs.externalTests[et]);
|
|
@@ -1485,6 +1567,9 @@ import('${d}').then(async (x) => {
|
|
|
1485
1567
|
this.nodeMetafileWatcher.close();
|
|
1486
1568
|
this.webMetafileWatcher.close();
|
|
1487
1569
|
this.importMetafileWatcher.close();
|
|
1570
|
+
if (this.pitonoMetafileWatcher) {
|
|
1571
|
+
this.pitonoMetafileWatcher.close();
|
|
1572
|
+
}
|
|
1488
1573
|
// Close any remaining log streams
|
|
1489
1574
|
Object.values(this.logStreams || {}).forEach((logs) => logs.closeAll());
|
|
1490
1575
|
// Close WebSocket server
|
|
@@ -1503,11 +1588,41 @@ import('${d}').then(async (x) => {
|
|
|
1503
1588
|
this.checkForShutdown();
|
|
1504
1589
|
}
|
|
1505
1590
|
async metafileOutputs(platform) {
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
.
|
|
1509
|
-
|
|
1591
|
+
let metafilePath;
|
|
1592
|
+
if (platform === "pitono") {
|
|
1593
|
+
metafilePath = `./testeranto/metafiles/python/core.json`;
|
|
1594
|
+
}
|
|
1595
|
+
else {
|
|
1596
|
+
metafilePath = `./testeranto/metafiles/${platform}/${this.name}.json`;
|
|
1597
|
+
}
|
|
1598
|
+
// Check if the file exists
|
|
1599
|
+
if (!fs_1.default.existsSync(metafilePath)) {
|
|
1600
|
+
if (platform === "pitono") {
|
|
1601
|
+
console.log(ansi_colors_2.default.yellow(ansi_colors_2.default.inverse(`Pitono metafile not found yet: ${metafilePath}`)));
|
|
1602
|
+
}
|
|
1603
|
+
return;
|
|
1604
|
+
}
|
|
1605
|
+
let metafile;
|
|
1606
|
+
try {
|
|
1607
|
+
const fileContent = fs_1.default.readFileSync(metafilePath).toString();
|
|
1608
|
+
const parsedData = JSON.parse(fileContent);
|
|
1609
|
+
// Handle different metafile structures
|
|
1610
|
+
if (platform === "pitono") {
|
|
1611
|
+
// Pitono metafile might be the entire content or have a different structure
|
|
1612
|
+
metafile = parsedData.metafile || parsedData;
|
|
1613
|
+
}
|
|
1614
|
+
else {
|
|
1615
|
+
metafile = parsedData.metafile;
|
|
1616
|
+
}
|
|
1617
|
+
if (!metafile) {
|
|
1618
|
+
console.log(ansi_colors_2.default.yellow(ansi_colors_2.default.inverse(`No metafile found in ${metafilePath}`)));
|
|
1619
|
+
return;
|
|
1620
|
+
}
|
|
1621
|
+
}
|
|
1622
|
+
catch (error) {
|
|
1623
|
+
console.error(`Error reading metafile at ${metafilePath}:`, error);
|
|
1510
1624
|
return;
|
|
1625
|
+
}
|
|
1511
1626
|
const outputs = metafile.outputs;
|
|
1512
1627
|
Object.keys(outputs).forEach(async (k) => {
|
|
1513
1628
|
const pattern = `testeranto/bundles/${platform}/${this.name}/${this.configs.src}`;
|
|
@@ -0,0 +1,54 @@
|
|
|
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.PitonoRunner = void 0;
|
|
7
|
+
const child_process_1 = require("child_process");
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const fs_1 = __importDefault(require("fs"));
|
|
10
|
+
class PitonoRunner {
|
|
11
|
+
constructor(config, testName) {
|
|
12
|
+
this.config = config;
|
|
13
|
+
this.testName = testName;
|
|
14
|
+
}
|
|
15
|
+
async run() {
|
|
16
|
+
const coreJsonPath = path_1.default.join(process.cwd(), 'testeranto', 'pitono', this.testName, 'core.json');
|
|
17
|
+
// Wait for the core.json file to be created with a timeout
|
|
18
|
+
const maxWaitTime = 10000; // 10 seconds
|
|
19
|
+
const startTime = Date.now();
|
|
20
|
+
while (!fs_1.default.existsSync(coreJsonPath) && (Date.now() - startTime) < maxWaitTime) {
|
|
21
|
+
await new Promise(resolve => setTimeout(resolve, 100));
|
|
22
|
+
}
|
|
23
|
+
if (!fs_1.default.existsSync(coreJsonPath)) {
|
|
24
|
+
console.error(`Pitono core.json not found at: ${coreJsonPath} after waiting ${maxWaitTime}ms`);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
try {
|
|
28
|
+
const coreData = JSON.parse(fs_1.default.readFileSync(coreJsonPath, 'utf-8'));
|
|
29
|
+
const entryPoints = coreData.entryPoints;
|
|
30
|
+
for (const entryPoint of entryPoints) {
|
|
31
|
+
try {
|
|
32
|
+
console.log(`Running pitono test: ${entryPoint}`);
|
|
33
|
+
// Use python to execute the test file
|
|
34
|
+
const absolutePath = path_1.default.resolve(entryPoint);
|
|
35
|
+
// Check if the file exists
|
|
36
|
+
if (!fs_1.default.existsSync(absolutePath)) {
|
|
37
|
+
console.error(`Pitono test file not found: ${absolutePath}`);
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
(0, child_process_1.execSync)(`python "${absolutePath}"`, { stdio: 'inherit' });
|
|
41
|
+
console.log(`Pitono test completed: ${entryPoint}`);
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
console.error(`Pitono test failed: ${entryPoint}`, error);
|
|
45
|
+
throw error;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
console.error(`Error reading or parsing core.json: ${error}`);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.PitonoRunner = PitonoRunner;
|