testeranto 0.200.1 → 0.203.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/README.md +49 -1
- package/UX/chache/index.md +11 -0
- package/design-editor/DesignEditor.tsx +40 -241
- package/dist/prebuild/App.css +171 -120
- package/dist/prebuild/App.js +47117 -11727
- package/dist/prebuild/testeranto.mjs +5048 -2578
- package/example/Calculator.go +63 -0
- package/example/Calculator.golingvu.adapter.go +81 -0
- package/example/Calculator.golingvu.go +67 -0
- package/example/Calculator.golingvu.implementation.go +95 -0
- package/example/Calculator.golingvu.specification.go +68 -0
- package/example/Calculator.pitono.adapter.py +68 -0
- package/example/Calculator.pitono.implementation.py +30 -0
- package/example/Calculator.pitono.specification.py +154 -0
- package/example/Calculator.pitono.test.py +47 -0
- package/example/Calculator.py +93 -0
- package/example/Calculator.test.adapter.ts +86 -0
- package/example/Calculator.test.implementation.ts +82 -0
- package/example/Calculator.test.specification.ts +213 -0
- package/example/Calculator.test.ts +13 -0
- package/example/Calculator.test.types.ts +50 -0
- package/example/Calculator.ts +130 -0
- package/example/README.md +1 -0
- package/example/base_suite_test.go +51 -0
- package/example/cmd/main.go +16 -0
- package/example/go.mod +9 -0
- package/example/main +0 -0
- package/example/test_example.py +143 -74
- package/example/testeranto/bundles/golang/core/Calculator.golingvu.go +53 -0
- package/example/testeranto/metafiles/golang/core.json +198 -0
- package/git-integration-plan.md +395 -0
- package/go.mod +3 -1
- package/golingvu.tmp.txt +68 -0
- package/log.txt +85 -0
- package/package.json +67 -46
- package/scripts/build-example.ts +245 -0
- package/src/App.tsx +226 -25
- package/src/Helpo.tsx +89 -0
- package/src/PM/PM_WithBuild.ts +183 -0
- package/src/PM/PM_WithEslintAndTsc.ts +109 -86
- package/src/PM/PM_WithGit.ts +632 -0
- package/src/PM/PM_WithHelpo.ts +341 -0
- package/src/PM/PM_WithProcesses.ts +900 -0
- package/src/PM/PM_WithWebSocket.ts +839 -0
- package/src/PM/base.ts +63 -1
- package/src/PM/golingvuBuild.ts +56 -0
- package/src/PM/index.ts +8 -5
- package/src/PM/main.ts +735 -1981
- package/src/PM/node.ts +18 -18
- package/src/PM/pitonoBuild.ts +56 -0
- package/src/PM/pure.ts +5 -13
- package/src/PM/types.ts +145 -0
- package/src/PM/utils.ts +262 -0
- package/src/PM/web.ts +8 -8
- package/src/README.md +122 -0
- package/src/ReportServer.ts +0 -12
- package/src/ReportServerLib.ts +0 -147
- package/src/Types.ts +1 -0
- package/src/app.scss +92 -140
- package/src/components/pure/AppFrame.tsx +354 -78
- package/src/components/pure/ArtifactTree.tsx +82 -0
- package/src/components/pure/BuildLogViewer.tsx +168 -0
- package/src/components/pure/DebugEnv.tsx +30 -0
- package/src/components/pure/FileTree.tsx +58 -0
- package/src/components/pure/FileTreeItem.tsx +49 -0
- package/src/components/pure/GitHubLoginButton.tsx +31 -0
- package/src/components/pure/GitIntegrationView.tsx +732 -0
- package/src/components/pure/HelpoChatDrawer.tsx +222 -0
- package/src/components/pure/MagicRobotModal.tsx +136 -0
- package/src/components/pure/ProcessDetails.tsx +99 -0
- package/src/components/pure/ProcessInput.tsx +67 -0
- package/src/components/pure/ProcessList.tsx +89 -0
- package/src/components/pure/ProcessLogs.tsx +54 -0
- package/src/components/pure/ProcessManager.tsx +38 -46
- package/src/components/pure/ProcessManagerView.tsx +44 -373
- package/src/components/pure/ProcessManagerViewTypes.ts +10 -0
- package/src/components/pure/ProcessSidebar.tsx +88 -0
- package/src/components/pure/ProcessTerminal.tsx +51 -0
- package/src/components/pure/ProjectPageView.tsx +6 -224
- package/src/components/pure/Settings.test.tsx +34 -0
- package/src/components/pure/Settings.tsx +163 -0
- package/src/components/pure/SignIn.tsx +33 -0
- package/src/components/pure/SingleProcessView.tsx +85 -180
- package/src/components/pure/TerminalInput.tsx +73 -0
- package/src/components/pure/TerminalLogs.tsx +80 -0
- package/src/components/pure/TestPageView.test/specification.ts +1 -0
- package/src/components/pure/TestPageView.tsx +308 -912
- package/src/components/pure/TestPageView_utils.tsx +287 -0
- package/src/components/pure/TestTable.tsx +88 -0
- package/src/components/pure/ToastNotification.tsx +19 -0
- package/src/components/pure/UserProfile.tsx +44 -0
- package/src/components/stateful/AuthCallbackPage.tsx +21 -0
- package/src/components/stateful/DratoPage.tsx +457 -0
- package/src/components/stateful/FeaturesReporter.tsx +3 -1
- package/src/components/stateful/FileTree.tsx +58 -58
- package/src/components/stateful/GenericXMLEditor/AttributeEditor.tsx +87 -0
- package/src/components/stateful/GenericXMLEditor/Drawer.tsx +174 -0
- package/src/components/stateful/GenericXMLEditor/GenericPreview.tsx +160 -0
- package/src/components/stateful/GenericXMLEditor/GenericTextEditor.tsx +104 -0
- package/src/components/stateful/GenericXMLEditor/GenericTree.tsx +104 -0
- package/src/components/stateful/GenericXMLEditorPage.tsx +346 -0
- package/src/components/stateful/GitIntegrationPage.tsx +263 -0
- package/src/components/stateful/GrafeoPage.tsx +563 -0
- package/src/components/stateful/ProcessManagerPage.tsx +13 -17
- package/src/components/stateful/ProjectPage.tsx +6 -5
- package/src/components/stateful/ProjectsPage.tsx +17 -19
- package/src/components/stateful/SVGEditor/CircleForm.tsx +68 -0
- package/src/components/stateful/SVGEditor/GroupForm.tsx +56 -0
- package/src/components/stateful/SVGEditor/RectForm.tsx +74 -0
- package/src/components/stateful/SVGEditor/SVGAttributeField.tsx +29 -0
- package/src/components/stateful/SVGEditor/SVGAttributesEditor.tsx +91 -0
- package/src/components/stateful/SVGEditor/SVGEditorControls.tsx +45 -0
- package/src/components/stateful/SVGEditor/SVGElementForm.tsx +45 -0
- package/src/components/stateful/SVGEditor/SVGPreview.tsx +227 -0
- package/src/components/stateful/SVGEditor/SVGTextEditor.tsx +166 -0
- package/src/components/stateful/SVGEditor/SVGTree.tsx +159 -0
- package/src/components/stateful/SVGEditor/SVGTypes.ts +36 -0
- package/src/components/stateful/SVGEditor/svg.xsd.xml +3038 -0
- package/src/components/stateful/SVGEditorPage.tsx +517 -0
- package/src/components/stateful/SingleProcessPage.tsx +133 -144
- package/src/components/stateful/SkriboPage.tsx +765 -0
- package/src/components/stateful/TestPage.tsx +27 -23
- package/src/esbuildConfigs/node.ts +1 -1
- package/src/example/go.mod +9 -0
- package/src/example/main.go +61 -0
- package/src/golingvu/PM/golang_test.go +103 -0
- package/src/golingvu/README.md +186 -2
- package/src/golingvu/base_given.go +89 -2
- package/src/golingvu/base_suite.go +48 -2
- package/src/golingvu/go.mod +6 -0
- package/src/golingvu/golingvu.go +724 -14
- package/src/golingvu/types.go +0 -14
- package/src/helpo/directives.md +5 -0
- package/src/helpo/prompt.txt +38 -0
- package/src/hooks/useGitMode.ts +20 -0
- package/src/hooks/useTerminalWebSocket.ts +49 -0
- package/src/lib/BaseGiven.ts +126 -28
- package/src/lib/BaseSuite.test/mock.ts +16 -10
- package/src/lib/BaseSuite.test/test.ts +165 -207
- package/src/lib/BaseSuite.ts +52 -10
- package/src/lib/BaseThen.ts +34 -38
- package/src/lib/BaseWhen.ts +9 -2
- package/src/lib/Tiposkripto.test/MockTiposkripto.ts +178 -14
- package/src/lib/Tiposkripto.test/Tiposkripto.adapter.ts +9 -14
- package/src/lib/Tiposkripto.test/Tiposkripto.implementation.ts +78 -38
- package/src/lib/Tiposkripto.test/Tiposkripto.specification.ts +51 -8
- package/src/lib/Tiposkripto.test/Tiposkripto.types.ts +5 -0
- package/src/lib/Tiposkripto.ts +64 -7
- package/src/lib/index.ts +7 -0
- package/src/lib/pmProxy.test/specification.ts +168 -166
- package/src/lib/pmProxy.ts +55 -18
- package/src/pitono/PM/python.py +165 -0
- package/src/pitono/Pitono.py +298 -0
- package/src/pitono/PitonoTest.py +25 -0
- package/src/pitono/README.md +21 -0
- package/src/pitono/__init__.py +6 -0
- package/{pitono → src/pitono}/base_given.py +42 -20
- package/{pitono → src/pitono}/base_suite.py +55 -2
- package/{pitono → src/pitono}/base_then.py +15 -1
- package/{pitono → src/pitono}/base_when.py +15 -1
- package/{pitono → src/pitono}/pitono.egg-info/PKG-INFO +25 -0
- package/{pitono → src/pitono}/pitono.egg-info/SOURCES.txt +1 -0
- package/src/pitono/types.py +87 -0
- package/src/services/FileService.ts +677 -0
- package/src/services/GitHubAuthService.ts +240 -0
- package/src/testeranto.ts +133 -245
- package/src/utils/api.ts +15 -13
- package/src/utils/gitTest.ts +29 -0
- package/src/utils/golingvuMetafile.ts +822 -118
- package/src/utils/golingvuWatcher.ts +285 -0
- package/src/utils/logFiles.ts +10 -2
- package/src/utils/makePrompt.ts +12 -1
- package/src/utils/pitonoMetafile.ts +326 -54
- package/src/utils/pitonoWatcher.ts +157 -0
- package/src/utils.ts +21 -12
- package/testeranto/App.css +171 -120
- package/testeranto/App.js +47117 -11727
- package/testeranto/bundles/node/core/chunk-MJTSYIAQ.mjs +1099 -0
- package/testeranto/bundles/node/core/src/lib/BaseSuite.test/node.test.mjs +58 -1147
- package/testeranto/bundles/node/core/src/lib/TipoSkripto.test/TipoSkripto.mjs +572 -0
- package/testeranto/bundles/node/core/src/lib/pmProxy.test/index.mjs +4795 -0
- package/testeranto/bundles/pure/core/chunk-6HR24P27.mjs +1003 -0
- package/testeranto/bundles/pure/core/src/Pure.test.mjs +410 -0
- package/testeranto/bundles/pure/core/src/lib/BaseSuite.test/pure.test.mjs +57 -1062
- package/testeranto/bundles/web/core/MPLUSRounded1c-Black-O75GP5JI.ttf +0 -0
- package/testeranto/bundles/web/core/MPLUSRounded1c-Bold-R524Q5BH.ttf +0 -0
- package/testeranto/bundles/web/core/MPLUSRounded1c-ExtraBold-C6GRMYVT.ttf +0 -0
- package/testeranto/bundles/web/core/MPLUSRounded1c-Light-WKN65Y2C.ttf +0 -0
- package/testeranto/bundles/web/core/MPLUSRounded1c-Medium-ZC4DWL7C.ttf +0 -0
- package/testeranto/bundles/web/core/MPLUSRounded1c-Regular-DT6EKZ3S.ttf +0 -0
- package/testeranto/bundles/web/core/MPLUSRounded1c-Thin-YWDNVG6M.ttf +0 -0
- package/testeranto/bundles/web/core/chunk-AZZHJNSU.mjs +30278 -0
- package/testeranto/bundles/web/core/chunk-ME6I6FJZ.mjs +3005 -0
- package/testeranto/bundles/web/core/src/components/pure/FeaturesReporterView.test/index.html +15 -0
- package/testeranto/bundles/web/core/src/components/pure/FeaturesReporterView.test/index.mjs +162 -0
- package/testeranto/bundles/web/core/src/components/pure/ProjectPageView.test/index.css +11619 -0
- package/testeranto/bundles/web/core/src/components/pure/ProjectPageView.test/index.html +15 -0
- package/testeranto/bundles/web/core/src/components/pure/ProjectPageView.test/index.mjs +6924 -0
- package/testeranto/bundles/web/core/src/lib/BaseSuite.test/web.test.mjs +71 -1050
- package/testeranto/helpo_chat_history.json +1 -0
- package/testeranto/metafiles/golang/core.json +42 -47
- package/testeranto/metafiles/node/core.json +584 -125
- package/testeranto/metafiles/pure/core.json +152 -51
- package/testeranto/metafiles/python/core.json +87 -0
- package/testeranto/metafiles/web/core.json +16365 -75
- package/testeranto/reports/core/config.json +66 -2
- package/testeranto/reports/core/example/Calculator.golingvu/golang/exit.log +1 -0
- package/testeranto/reports/core/example/Calculator.golingvu/golang/stderr.log +2 -0
- package/testeranto/reports/core/example/Calculator.golingvu/golang/stdout.log +1 -0
- package/testeranto/reports/core/example/Calculator.pitono.test/python/exit.log +1 -0
- package/testeranto/reports/core/example/Calculator.pitono.test/python/stderr.log +11 -0
- package/testeranto/reports/core/example/Calculator.pitono.test/python/stdout.log +1 -0
- package/testeranto/reports/core/example/Calculator.test/node/exit.log +1 -0
- package/testeranto/reports/core/example/Calculator.test/node/lint_errors.txt +2 -0
- package/testeranto/reports/core/example/Calculator.test/node/message.txt +16 -0
- package/testeranto/reports/core/example/Calculator.test/node/prompt.txt +13 -0
- package/testeranto/reports/core/example/Calculator.test/node/stderr.log +33 -0
- package/testeranto/reports/core/example/Calculator.test/node/stdout.log +1076 -0
- package/testeranto/reports/core/example/Calculator.test/node/tests.json +1109 -0
- package/testeranto/reports/core/example/Calculator.test/node/type_errors.txt +34 -0
- package/testeranto/reports/core/example/test_example/python/exit.log +1 -0
- package/testeranto/reports/core/example/test_example/python/stderr.log +24 -0
- package/testeranto/reports/core/src/Pure.test/pure/message.txt +16 -0
- package/testeranto/reports/core/src/Pure.test/pure/prompt.txt +13 -0
- package/testeranto/reports/core/src/Pure.test/pure/type_errors.txt +86 -0
- package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/exit.log +0 -0
- package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/info.log +0 -0
- 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 +17 -0
- package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/prompt.txt +26 -0
- package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/type_errors.txt +69 -0
- package/testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/warn.log +0 -0
- package/testeranto/reports/core/src/components/pure/ModalContent.test/index/web/debug.log +0 -0
- package/testeranto/reports/core/src/components/pure/ModalContent.test/index/web/error.log +0 -0
- package/testeranto/reports/core/src/components/pure/ModalContent.test/index/web/exit.log +0 -0
- package/testeranto/reports/core/src/components/pure/ModalContent.test/index/web/info.log +0 -0
- package/testeranto/reports/core/src/components/pure/ModalContent.test/index/web/lint_errors.txt +16 -0
- package/testeranto/reports/core/src/components/pure/ModalContent.test/index/web/message.txt +17 -0
- package/testeranto/reports/core/src/components/pure/ModalContent.test/index/web/prompt.txt +27 -0
- package/testeranto/reports/core/src/components/pure/ModalContent.test/index/web/type_errors.txt +42 -0
- package/testeranto/reports/core/src/components/pure/ModalContent.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 -0
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/exit.log +0 -0
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/info.log +0 -0
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/lint_errors.txt +30 -0
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/message.txt +17 -0
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/prompt.txt +30 -0
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/type_errors.txt +58 -0
- package/testeranto/reports/core/src/components/pure/ProjectPageView.test/index/web/warn.log +0 -0
- package/testeranto/reports/core/src/lib/BaseSuite.test/node.test/node/exit.log +1 -1
- package/testeranto/reports/core/src/lib/BaseSuite.test/node.test/node/lint_errors.txt +0 -6
- package/testeranto/reports/core/src/lib/BaseSuite.test/node.test/node/prompt.txt +9 -12
- package/testeranto/reports/core/src/lib/BaseSuite.test/node.test/node/stderr.log +1 -0
- package/testeranto/reports/core/src/lib/BaseSuite.test/node.test/node/stdout.log +4 -0
- package/testeranto/reports/core/src/lib/BaseSuite.test/node.test/node/tests.json +99 -8
- package/testeranto/reports/core/src/lib/BaseSuite.test/node.test/node/type_errors.txt +57 -44
- package/testeranto/reports/core/src/lib/BaseSuite.test/pure.test/pure/lint_errors.txt +0 -2
- package/testeranto/reports/core/src/lib/BaseSuite.test/pure.test/pure/message.txt +1 -2
- package/testeranto/reports/core/src/lib/BaseSuite.test/pure.test/pure/prompt.txt +4 -16
- package/testeranto/reports/core/src/lib/BaseSuite.test/pure.test/pure/type_errors.txt +62 -44
- package/testeranto/reports/core/src/lib/BaseSuite.test/web.test/web/error.log +0 -1
- package/testeranto/reports/core/src/lib/BaseSuite.test/web.test/web/exit.log +0 -1
- package/testeranto/reports/core/src/lib/BaseSuite.test/web.test/web/lint_errors.txt +0 -2
- package/testeranto/reports/core/src/lib/BaseSuite.test/web.test/web/prompt.txt +13 -13
- package/testeranto/reports/core/src/lib/BaseSuite.test/web.test/web/type_errors.txt +57 -44
- package/testeranto/reports/core/src/lib/TipoSkripto.test/TipoSkripto/node/exit.log +1 -0
- 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 +16 -0
- package/testeranto/reports/core/src/lib/TipoSkripto.test/TipoSkripto/node/prompt.txt +13 -0
- package/testeranto/reports/core/src/lib/TipoSkripto.test/TipoSkripto/node/stderr.log +88 -0
- package/testeranto/reports/core/src/lib/TipoSkripto.test/TipoSkripto/node/stdout.log +521 -0
- package/testeranto/reports/core/src/lib/TipoSkripto.test/TipoSkripto/node/tests.json +166 -0
- package/testeranto/reports/core/src/lib/TipoSkripto.test/TipoSkripto/node/type_errors.txt +78 -0
- package/testeranto/reports/core/src/lib/pmProxy.test/index/node/exit.log +1 -0
- package/testeranto/reports/core/src/lib/pmProxy.test/index/node/lint_errors.txt +15 -0
- package/testeranto/reports/core/src/lib/pmProxy.test/index/node/message.txt +17 -0
- package/testeranto/reports/core/src/lib/pmProxy.test/index/node/prompt.txt +25 -0
- package/testeranto/reports/core/src/lib/pmProxy.test/index/node/stderr.log +0 -0
- package/testeranto/reports/core/src/lib/pmProxy.test/index/node/stdout.log +2 -0
- package/testeranto/reports/core/src/lib/pmProxy.test/index/node/tests.json +31 -0
- package/testeranto/reports/core/src/lib/pmProxy.test/index/node/type_errors.txt +62 -0
- package/testeranto/reports/core/summary.json +66 -11
- package/testeranto.config.ts +38 -44
- package/tsc.log +141 -91
- package/tsconfig.json +6 -2
- package/dist/cjs-shim.js +0 -12
- package/dist/common/design-editor/DesignEditor.js +0 -242
- package/dist/common/design-editor/index.js +0 -18
- package/dist/common/design-editor/server.js +0 -98
- package/dist/common/design-editor/types.js +0 -2
- package/dist/common/package.json +0 -3
- package/dist/common/src/App.js +0 -77
- package/dist/common/src/CoreTypes.js +0 -2
- package/dist/common/src/Init.js +0 -48
- package/dist/common/src/Node.js +0 -40
- package/dist/common/src/NodeSidecar.js +0 -15
- package/dist/common/src/PM/PM_WithEslintAndTsc.js +0 -192
- package/dist/common/src/PM/__tests__/nodeSidecar.testeranto.js +0 -108
- package/dist/common/src/PM/__tests__/pureSidecar.testeranto.js +0 -93
- package/dist/common/src/PM/__tests__/webSidecar.testeranto.js +0 -93
- package/dist/common/src/PM/base.js +0 -257
- package/dist/common/src/PM/index.js +0 -6
- package/dist/common/src/PM/main.js +0 -1815
- package/dist/common/src/PM/node.js +0 -185
- package/dist/common/src/PM/nodeSidecar.js +0 -65
- package/dist/common/src/PM/pitonoRunner.js +0 -54
- package/dist/common/src/PM/pure.js +0 -111
- package/dist/common/src/PM/pureSidecar.js +0 -48
- package/dist/common/src/PM/sidecar.js +0 -11
- package/dist/common/src/PM/types.js +0 -1
- package/dist/common/src/PM/web.js +0 -112
- package/dist/common/src/PM/webSidecar.js +0 -47
- package/dist/common/src/Pure.js +0 -52
- package/dist/common/src/Pure.test.js +0 -180
- package/dist/common/src/PureSidecar.js +0 -13
- package/dist/common/src/ReportServer.js +0 -11
- package/dist/common/src/ReportServer.test.ts/index.js +0 -78
- package/dist/common/src/ReportServerLib.js +0 -141
- package/dist/common/src/Types.js +0 -2
- package/dist/common/src/Web.js +0 -61
- package/dist/common/src/WebSidecar.js +0 -14
- package/dist/common/src/components/DesignEditorPage.js +0 -205
- package/dist/common/src/components/SunriseAnimation.js +0 -291
- package/dist/common/src/components/SunriseAnimation.test/implementation.js +0 -1
- package/dist/common/src/components/SunriseAnimation.test/index.js +0 -1
- package/dist/common/src/components/SunriseAnimation.test/interface.js +0 -68
- package/dist/common/src/components/SunriseAnimation.test/specification.js +0 -1
- package/dist/common/src/components/SunriseAnimation.test/types.js +0 -2
- package/dist/common/src/components/TestStatusBadge.js +0 -35
- package/dist/common/src/components/pure/AppFrame.js +0 -69
- package/dist/common/src/components/pure/AppFrame.test/implementation.js +0 -63
- package/dist/common/src/components/pure/AppFrame.test/index.js +0 -14
- package/dist/common/src/components/pure/AppFrame.test/specification.js +0 -25
- package/dist/common/src/components/pure/AppFrame.test/types.js +0 -3
- package/dist/common/src/components/pure/FeaturesReporterView.js +0 -23
- package/dist/common/src/components/pure/FeaturesReporterView.test/implementation.js +0 -84
- package/dist/common/src/components/pure/FeaturesReporterView.test/index.js +0 -14
- package/dist/common/src/components/pure/FeaturesReporterView.test/specification.js +0 -27
- package/dist/common/src/components/pure/FeaturesReporterView.test/types.js +0 -2
- package/dist/common/src/components/pure/ModalContent.js +0 -86
- package/dist/common/src/components/pure/ModalContent.test/implementation.js +0 -35
- package/dist/common/src/components/pure/ModalContent.test/index.js +0 -58
- package/dist/common/src/components/pure/ModalContent.test/specification.js +0 -19
- package/dist/common/src/components/pure/ModalContent.test/types.js +0 -4
- package/dist/common/src/components/pure/NavBar.js +0 -44
- package/dist/common/src/components/pure/ProcessManager.js +0 -112
- package/dist/common/src/components/pure/ProcessManagerView.js +0 -237
- package/dist/common/src/components/pure/ProjectPageView.js +0 -181
- package/dist/common/src/components/pure/ProjectPageView.test/implementation.js +0 -184
- package/dist/common/src/components/pure/ProjectPageView.test/index.js +0 -14
- package/dist/common/src/components/pure/ProjectPageView.test/specification.js +0 -32
- package/dist/common/src/components/pure/ProjectPageView.test/types.js +0 -4
- package/dist/common/src/components/pure/ProjectsPageView.js +0 -72
- package/dist/common/src/components/pure/SettingsButton.js +0 -13
- package/dist/common/src/components/pure/SingleProcessView.js +0 -214
- package/dist/common/src/components/pure/TestPageView.js +0 -628
- package/dist/common/src/components/pure/TestPageView.test/implementation.js +0 -157
- package/dist/common/src/components/pure/TestPageView.test/index.js +0 -15
- package/dist/common/src/components/pure/TestPageView.test/specification.js +0 -26
- package/dist/common/src/components/pure/TestPageView.test/types.js +0 -4
- package/dist/common/src/components/pure/ThemeCard.js +0 -15
- package/dist/common/src/components/stateful/FeaturesReporter.js +0 -59
- package/dist/common/src/components/stateful/FileTree.js +0 -40
- package/dist/common/src/components/stateful/ProcessManagerPage.js +0 -112
- package/dist/common/src/components/stateful/ProjectPage.js +0 -101
- package/dist/common/src/components/stateful/ProjectsPage.js +0 -118
- package/dist/common/src/components/stateful/SettingsPage.js +0 -72
- package/dist/common/src/components/stateful/SingleProcessPage.js +0 -147
- package/dist/common/src/components/stateful/TestPage.js +0 -268
- package/dist/common/src/components/stateful/TextEditorPage.js +0 -154
- package/dist/common/src/defaultConfig.js +0 -19
- package/dist/common/src/esbuildConfigs/consoleDetectorPlugin.js +0 -38
- package/dist/common/src/esbuildConfigs/eslint-formatter-testeranto.js +0 -21
- package/dist/common/src/esbuildConfigs/featuresPlugin.js +0 -39
- package/dist/common/src/esbuildConfigs/index.js +0 -21
- package/dist/common/src/esbuildConfigs/inputFilesPlugin.js +0 -30
- package/dist/common/src/esbuildConfigs/nativeImportDetectorPlugin.js +0 -24
- package/dist/common/src/esbuildConfigs/node.js +0 -24
- package/dist/common/src/esbuildConfigs/pure.js +0 -42
- package/dist/common/src/esbuildConfigs/rebuildPlugin.js +0 -19
- package/dist/common/src/esbuildConfigs/web.js +0 -48
- package/dist/common/src/init-docs.js +0 -9
- package/dist/common/src/lib/BaseGiven.js +0 -99
- package/dist/common/src/lib/BaseSuite.js +0 -91
- package/dist/common/src/lib/BaseSuite.test/mock.js +0 -61
- package/dist/common/src/lib/BaseSuite.test/node.test.js +0 -10
- package/dist/common/src/lib/BaseSuite.test/pure.test.js +0 -10
- package/dist/common/src/lib/BaseSuite.test/test.js +0 -253
- package/dist/common/src/lib/BaseSuite.test/web.test.js +0 -10
- package/dist/common/src/lib/BaseThen.js +0 -64
- package/dist/common/src/lib/BaseWhen.js +0 -45
- package/dist/common/src/lib/Sidecar.js +0 -7
- package/dist/common/src/lib/Tiposkripto.js +0 -149
- package/dist/common/src/lib/Tiposkripto.test/MockTiposkripto.js +0 -36
- package/dist/common/src/lib/Tiposkripto.test/Tiposkripto.adapter.js +0 -35
- package/dist/common/src/lib/Tiposkripto.test/Tiposkripto.implementation.js +0 -173
- package/dist/common/src/lib/Tiposkripto.test/Tiposkripto.js +0 -11
- package/dist/common/src/lib/Tiposkripto.test/Tiposkripto.specification.js +0 -42
- package/dist/common/src/lib/Tiposkripto.test/Tiposkripto.types.js +0 -2
- package/dist/common/src/lib/abstractBase.test/MockGiven.js +0 -24
- package/dist/common/src/lib/abstractBase.test/MockThen.js +0 -16
- package/dist/common/src/lib/abstractBase.test/MockWhen.js +0 -20
- package/dist/common/src/lib/abstractBase.test/adapter.js +0 -24
- package/dist/common/src/lib/abstractBase.test/implementation.js +0 -38
- package/dist/common/src/lib/abstractBase.test/index.js +0 -18
- package/dist/common/src/lib/abstractBase.test/specification.js +0 -19
- package/dist/common/src/lib/abstractBase.test/types.js +0 -2
- package/dist/common/src/lib/index.js +0 -31
- package/dist/common/src/lib/pmProxy.js +0 -293
- package/dist/common/src/lib/pmProxy.test/adapter.js +0 -54
- package/dist/common/src/lib/pmProxy.test/implementation.js +0 -137
- package/dist/common/src/lib/pmProxy.test/index.js +0 -15
- package/dist/common/src/lib/pmProxy.test/mockPM.js +0 -34
- package/dist/common/src/lib/pmProxy.test/mockPMBase.js +0 -131
- package/dist/common/src/lib/pmProxy.test/specification.js +0 -64
- package/dist/common/src/lib/pmProxy.test/types.js +0 -2
- package/dist/common/src/lib/types.js +0 -3
- package/dist/common/src/mothership/index.js +0 -21
- package/dist/common/src/mothership/test.js +0 -83
- package/dist/common/src/run.js +0 -49
- package/dist/common/src/testeranto.js +0 -283
- package/dist/common/src/types/features.js +0 -34
- package/dist/common/src/utils/api.js +0 -89
- package/dist/common/src/utils/buildTemplates.js +0 -37
- package/dist/common/src/utils/featureUtils.js +0 -29
- package/dist/common/src/utils/golingvuMetafile.js +0 -116
- package/dist/common/src/utils/logFiles.js +0 -52
- package/dist/common/src/utils/makePrompt.js +0 -116
- package/dist/common/src/utils/pitonoMetafile.js +0 -67
- package/dist/common/src/utils/queue.js +0 -36
- package/dist/common/src/utils.js +0 -133
- package/dist/common/src/web.html.js +0 -18
- package/dist/common/testeranto.config.js +0 -98
- package/dist/common/tsconfig.common.tsbuildinfo +0 -1
- package/dist/module/design-editor/DesignEditor.js +0 -206
- package/dist/module/design-editor/index.js +0 -2
- package/dist/module/design-editor/server.js +0 -92
- package/dist/module/design-editor/types.js +0 -1
- package/dist/module/package.json +0 -3
- package/dist/module/src/App.js +0 -70
- package/dist/module/src/CoreTypes.js +0 -1
- package/dist/module/src/Init.js +0 -43
- package/dist/module/src/Node.js +0 -33
- package/dist/module/src/NodeSidecar.js +0 -11
- package/dist/module/src/PM/PM_WithEslintAndTsc.js +0 -185
- package/dist/module/src/PM/__tests__/nodeSidecar.testeranto.js +0 -103
- package/dist/module/src/PM/__tests__/pureSidecar.testeranto.js +0 -88
- package/dist/module/src/PM/__tests__/webSidecar.testeranto.js +0 -88
- package/dist/module/src/PM/base.js +0 -250
- package/dist/module/src/PM/index.js +0 -2
- package/dist/module/src/PM/main.js +0 -1775
- package/dist/module/src/PM/node.js +0 -178
- package/dist/module/src/PM/nodeSidecar.js +0 -58
- package/dist/module/src/PM/pitonoRunner.js +0 -47
- package/dist/module/src/PM/pure.js +0 -107
- package/dist/module/src/PM/pureSidecar.js +0 -41
- package/dist/module/src/PM/sidecar.js +0 -7
- package/dist/module/src/PM/types.js +0 -1
- package/dist/module/src/PM/web.js +0 -108
- package/dist/module/src/PM/webSidecar.js +0 -40
- package/dist/module/src/Pure.js +0 -45
- package/dist/module/src/Pure.test.js +0 -175
- package/dist/module/src/PureSidecar.js +0 -9
- package/dist/module/src/ReportServer.js +0 -9
- package/dist/module/src/ReportServer.test.ts/index.js +0 -73
- package/dist/module/src/ReportServerLib.js +0 -134
- package/dist/module/src/Types.js +0 -1
- package/dist/module/src/Web.js +0 -54
- package/dist/module/src/WebSidecar.js +0 -10
- package/dist/module/src/components/DesignEditorPage.js +0 -168
- package/dist/module/src/components/SunriseAnimation.js +0 -256
- package/dist/module/src/components/SunriseAnimation.test/implementation.js +0 -1
- package/dist/module/src/components/SunriseAnimation.test/index.js +0 -1
- package/dist/module/src/components/SunriseAnimation.test/interface.js +0 -32
- package/dist/module/src/components/SunriseAnimation.test/specification.js +0 -1
- package/dist/module/src/components/SunriseAnimation.test/types.js +0 -1
- package/dist/module/src/components/TestStatusBadge.js +0 -28
- package/dist/module/src/components/pure/AppFrame.js +0 -32
- package/dist/module/src/components/pure/AppFrame.test/implementation.js +0 -57
- package/dist/module/src/components/pure/AppFrame.test/index.js +0 -9
- package/dist/module/src/components/pure/AppFrame.test/specification.js +0 -21
- package/dist/module/src/components/pure/AppFrame.test/types.js +0 -2
- package/dist/module/src/components/pure/FeaturesReporterView.js +0 -16
- package/dist/module/src/components/pure/FeaturesReporterView.test/implementation.js +0 -81
- package/dist/module/src/components/pure/FeaturesReporterView.test/index.js +0 -9
- package/dist/module/src/components/pure/FeaturesReporterView.test/specification.js +0 -23
- package/dist/module/src/components/pure/FeaturesReporterView.test/types.js +0 -1
- package/dist/module/src/components/pure/ModalContent.js +0 -79
- package/dist/module/src/components/pure/ModalContent.test/implementation.js +0 -32
- package/dist/module/src/components/pure/ModalContent.test/index.js +0 -53
- package/dist/module/src/components/pure/ModalContent.test/specification.js +0 -15
- package/dist/module/src/components/pure/ModalContent.test/types.js +0 -3
- package/dist/module/src/components/pure/NavBar.js +0 -37
- package/dist/module/src/components/pure/ProcessManager.js +0 -75
- package/dist/module/src/components/pure/ProcessManagerView.js +0 -200
- package/dist/module/src/components/pure/ProjectPageView.js +0 -174
- package/dist/module/src/components/pure/ProjectPageView.test/implementation.js +0 -181
- package/dist/module/src/components/pure/ProjectPageView.test/index.js +0 -9
- package/dist/module/src/components/pure/ProjectPageView.test/specification.js +0 -28
- package/dist/module/src/components/pure/ProjectPageView.test/types.js +0 -3
- package/dist/module/src/components/pure/ProjectsPageView.js +0 -65
- package/dist/module/src/components/pure/SettingsButton.js +0 -6
- package/dist/module/src/components/pure/SingleProcessView.js +0 -214
- package/dist/module/src/components/pure/TestPageView.js +0 -591
- package/dist/module/src/components/pure/TestPageView.test/implementation.js +0 -121
- package/dist/module/src/components/pure/TestPageView.test/index.js +0 -10
- package/dist/module/src/components/pure/TestPageView.test/specification.js +0 -22
- package/dist/module/src/components/pure/TestPageView.test/types.js +0 -3
- package/dist/module/src/components/pure/ThemeCard.js +0 -8
- package/dist/module/src/components/stateful/FeaturesReporter.js +0 -22
- package/dist/module/src/components/stateful/FileTree.js +0 -33
- package/dist/module/src/components/stateful/ProcessManagerPage.js +0 -75
- package/dist/module/src/components/stateful/ProjectPage.js +0 -64
- package/dist/module/src/components/stateful/ProjectsPage.js +0 -81
- package/dist/module/src/components/stateful/SettingsPage.js +0 -35
- package/dist/module/src/components/stateful/SingleProcessPage.js +0 -110
- package/dist/module/src/components/stateful/TestPage.js +0 -231
- package/dist/module/src/components/stateful/TextEditorPage.js +0 -117
- package/dist/module/src/defaultConfig.js +0 -17
- package/dist/module/src/esbuildConfigs/consoleDetectorPlugin.js +0 -32
- package/dist/module/src/esbuildConfigs/eslint-formatter-testeranto.js +0 -18
- package/dist/module/src/esbuildConfigs/featuresPlugin.js +0 -34
- package/dist/module/src/esbuildConfigs/index.js +0 -19
- package/dist/module/src/esbuildConfigs/inputFilesPlugin.js +0 -25
- package/dist/module/src/esbuildConfigs/nativeImportDetectorPlugin.js +0 -21
- package/dist/module/src/esbuildConfigs/node.js +0 -19
- package/dist/module/src/esbuildConfigs/pure.js +0 -37
- package/dist/module/src/esbuildConfigs/rebuildPlugin.js +0 -14
- package/dist/module/src/esbuildConfigs/web.js +0 -43
- package/dist/module/src/init-docs.js +0 -4
- package/dist/module/src/lib/BaseGiven.js +0 -95
- package/dist/module/src/lib/BaseSuite.js +0 -87
- package/dist/module/src/lib/BaseSuite.test/mock.js +0 -54
- package/dist/module/src/lib/BaseSuite.test/node.test.js +0 -5
- package/dist/module/src/lib/BaseSuite.test/pure.test.js +0 -5
- package/dist/module/src/lib/BaseSuite.test/test.js +0 -249
- package/dist/module/src/lib/BaseSuite.test/web.test.js +0 -5
- package/dist/module/src/lib/BaseThen.js +0 -60
- package/dist/module/src/lib/BaseWhen.js +0 -41
- package/dist/module/src/lib/Sidecar.js +0 -3
- package/dist/module/src/lib/Tiposkripto.js +0 -146
- package/dist/module/src/lib/Tiposkripto.test/MockTiposkripto.js +0 -29
- package/dist/module/src/lib/Tiposkripto.test/Tiposkripto.adapter.js +0 -32
- package/dist/module/src/lib/Tiposkripto.test/Tiposkripto.implementation.js +0 -170
- package/dist/module/src/lib/Tiposkripto.test/Tiposkripto.js +0 -6
- package/dist/module/src/lib/Tiposkripto.test/Tiposkripto.specification.js +0 -38
- package/dist/module/src/lib/Tiposkripto.test/Tiposkripto.types.js +0 -1
- package/dist/module/src/lib/abstractBase.test/MockGiven.js +0 -20
- package/dist/module/src/lib/abstractBase.test/MockThen.js +0 -12
- package/dist/module/src/lib/abstractBase.test/MockWhen.js +0 -16
- package/dist/module/src/lib/abstractBase.test/adapter.js +0 -21
- package/dist/module/src/lib/abstractBase.test/implementation.js +0 -35
- package/dist/module/src/lib/abstractBase.test/index.js +0 -13
- package/dist/module/src/lib/abstractBase.test/specification.js +0 -15
- package/dist/module/src/lib/abstractBase.test/types.js +0 -1
- package/dist/module/src/lib/index.js +0 -26
- package/dist/module/src/lib/pmProxy.js +0 -284
- package/dist/module/src/lib/pmProxy.test/adapter.js +0 -51
- package/dist/module/src/lib/pmProxy.test/implementation.js +0 -134
- package/dist/module/src/lib/pmProxy.test/index.js +0 -10
- package/dist/module/src/lib/pmProxy.test/mockPM.js +0 -30
- package/dist/module/src/lib/pmProxy.test/mockPMBase.js +0 -127
- package/dist/module/src/lib/pmProxy.test/specification.js +0 -60
- package/dist/module/src/lib/pmProxy.test/types.js +0 -1
- package/dist/module/src/lib/types.js +0 -2
- package/dist/module/src/mothership/index.js +0 -16
- package/dist/module/src/mothership/test.js +0 -78
- package/dist/module/src/run.js +0 -49
- package/dist/module/src/testeranto.js +0 -245
- package/dist/module/src/types/features.js +0 -31
- package/dist/module/src/utils/api.js +0 -84
- package/dist/module/src/utils/buildTemplates.js +0 -33
- package/dist/module/src/utils/featureUtils.js +0 -24
- package/dist/module/src/utils/golingvuMetafile.js +0 -109
- package/dist/module/src/utils/logFiles.js +0 -47
- package/dist/module/src/utils/makePrompt.js +0 -109
- package/dist/module/src/utils/pitonoMetafile.js +0 -60
- package/dist/module/src/utils/queue.js +0 -32
- package/dist/module/src/utils.js +0 -121
- package/dist/module/src/web.html.js +0 -16
- package/dist/module/testeranto.config.js +0 -96
- package/dist/module/tsconfig.module.tsbuildinfo +0 -1
- package/dist/types/design-editor/DesignEditor.d.ts +0 -18
- package/dist/types/design-editor/server.d.ts +0 -1
- package/dist/types/src/App.d.ts +0 -1
- package/dist/types/src/CoreTypes.d.ts +0 -52
- package/dist/types/src/Init.d.ts +0 -2
- package/dist/types/src/Node.d.ts +0 -9
- package/dist/types/src/NodeSidecar.d.ts +0 -6
- package/dist/types/src/PM/PM_WithEslintAndTsc.d.ts +0 -24
- package/dist/types/src/PM/__tests__/nodeSidecar.testeranto.d.ts +0 -2
- package/dist/types/src/PM/__tests__/pureSidecar.testeranto.d.ts +0 -2
- package/dist/types/src/PM/__tests__/webSidecar.testeranto.d.ts +0 -2
- package/dist/types/src/PM/base.d.ts +0 -35
- package/dist/types/src/PM/index.d.ts +0 -37
- package/dist/types/src/PM/main.d.ts +0 -79
- package/dist/types/src/PM/node.d.ts +0 -40
- package/dist/types/src/PM/nodeSidecar.d.ts +0 -13
- package/dist/types/src/PM/pitonoRunner.d.ts +0 -7
- package/dist/types/src/PM/pure.d.ts +0 -43
- package/dist/types/src/PM/pureSidecar.d.ts +0 -11
- package/dist/types/src/PM/sidecar.d.ts +0 -8
- package/dist/types/src/PM/web.d.ts +0 -43
- package/dist/types/src/PM/webSidecar.d.ts +0 -11
- package/dist/types/src/Pure.d.ts +0 -9
- package/dist/types/src/Pure.test.d.ts +0 -2
- package/dist/types/src/PureSidecar.d.ts +0 -8
- package/dist/types/src/ReportServer.d.ts +0 -1
- package/dist/types/src/ReportServer.test.ts/index.d.ts +0 -2
- package/dist/types/src/ReportServerLib.d.ts +0 -1
- package/dist/types/src/Types.d.ts +0 -118
- package/dist/types/src/Web.d.ts +0 -9
- package/dist/types/src/WebSidecar.d.ts +0 -8
- package/dist/types/src/components/DesignEditorPage.d.ts +0 -1
- package/dist/types/src/components/SunriseAnimation.d.ts +0 -5
- package/dist/types/src/components/SunriseAnimation.test/interface.d.ts +0 -11
- package/dist/types/src/components/SunriseAnimation.test/types.d.ts +0 -39
- package/dist/types/src/components/TestStatusBadge.d.ts +0 -15
- package/dist/types/src/components/pure/AppFrame.d.ts +0 -11
- package/dist/types/src/components/pure/AppFrame.test/implementation.d.ts +0 -3
- package/dist/types/src/components/pure/AppFrame.test/index.d.ts +0 -3
- package/dist/types/src/components/pure/AppFrame.test/specification.d.ts +0 -3
- package/dist/types/src/components/pure/AppFrame.test/types.d.ts +0 -33
- package/dist/types/src/components/pure/FeaturesReporterView.d.ts +0 -7
- package/dist/types/src/components/pure/FeaturesReporterView.test/implementation.d.ts +0 -3
- package/dist/types/src/components/pure/FeaturesReporterView.test/index.d.ts +0 -2
- package/dist/types/src/components/pure/FeaturesReporterView.test/specification.d.ts +0 -3
- package/dist/types/src/components/pure/FeaturesReporterView.test/types.d.ts +0 -54
- package/dist/types/src/components/pure/ModalContent.d.ts +0 -7
- package/dist/types/src/components/pure/ModalContent.test/implementation.d.ts +0 -3
- package/dist/types/src/components/pure/ModalContent.test/index.d.ts +0 -2
- package/dist/types/src/components/pure/ModalContent.test/specification.d.ts +0 -3
- package/dist/types/src/components/pure/ModalContent.test/types.d.ts +0 -45
- package/dist/types/src/components/pure/NavBar.d.ts +0 -23
- package/dist/types/src/components/pure/ProcessManager.d.ts +0 -8
- package/dist/types/src/components/pure/ProcessManagerView.d.ts +0 -20
- package/dist/types/src/components/pure/ProjectPageView.d.ts +0 -14
- package/dist/types/src/components/pure/ProjectPageView.test/implementation.d.ts +0 -3
- package/dist/types/src/components/pure/ProjectPageView.test/index.d.ts +0 -2
- package/dist/types/src/components/pure/ProjectPageView.test/specification.d.ts +0 -3
- package/dist/types/src/components/pure/ProjectPageView.test/types.d.ts +0 -57
- package/dist/types/src/components/pure/ProjectsPageView.d.ts +0 -29
- package/dist/types/src/components/pure/SettingsButton.d.ts +0 -2
- package/dist/types/src/components/pure/TestPageView.d.ts +0 -15
- package/dist/types/src/components/pure/TestPageView.test/implementation.d.ts +0 -12
- package/dist/types/src/components/pure/TestPageView.test/index.d.ts +0 -3
- package/dist/types/src/components/pure/TestPageView.test/specification.d.ts +0 -11
- package/dist/types/src/components/pure/TestPageView.test/types.d.ts +0 -65
- package/dist/types/src/components/pure/ThemeCard.d.ts +0 -9
- package/dist/types/src/components/stateful/FeaturesReporter.d.ts +0 -2
- package/dist/types/src/components/stateful/FileTree.d.ts +0 -8
- package/dist/types/src/components/stateful/ProcessManagerPage.d.ts +0 -2
- package/dist/types/src/components/stateful/ProjectPage.d.ts +0 -1
- package/dist/types/src/components/stateful/ProjectsPage.d.ts +0 -1
- package/dist/types/src/components/stateful/SettingsPage.d.ts +0 -2
- package/dist/types/src/components/stateful/SingleProcessPage.d.ts +0 -2
- package/dist/types/src/components/stateful/TestPage.d.ts +0 -1
- package/dist/types/src/components/stateful/TextEditorPage.d.ts +0 -1
- package/dist/types/src/defaultConfig.d.ts +0 -3
- package/dist/types/src/esbuildConfigs/consoleDetectorPlugin.d.ts +0 -2
- package/dist/types/src/esbuildConfigs/eslint-formatter-testeranto.d.ts +0 -2
- package/dist/types/src/esbuildConfigs/featuresPlugin.d.ts +0 -5
- package/dist/types/src/esbuildConfigs/index.d.ts +0 -4
- package/dist/types/src/esbuildConfigs/inputFilesPlugin.d.ts +0 -7
- package/dist/types/src/esbuildConfigs/nativeImportDetectorPlugin.d.ts +0 -2
- package/dist/types/src/esbuildConfigs/node.d.ts +0 -4
- package/dist/types/src/esbuildConfigs/pure.d.ts +0 -4
- package/dist/types/src/esbuildConfigs/rebuildPlugin.d.ts +0 -6
- package/dist/types/src/esbuildConfigs/web.d.ts +0 -4
- package/dist/types/src/init-docs.d.ts +0 -1
- package/dist/types/src/lib/BaseGiven.d.ts +0 -44
- package/dist/types/src/lib/BaseSuite.d.ts +0 -46
- package/dist/types/src/lib/BaseSuite.test/mock.d.ts +0 -21
- package/dist/types/src/lib/BaseSuite.test/node.test.d.ts +0 -2
- package/dist/types/src/lib/BaseSuite.test/pure.test.d.ts +0 -2
- package/dist/types/src/lib/BaseSuite.test/test.d.ts +0 -36
- package/dist/types/src/lib/BaseSuite.test/web.test.d.ts +0 -2
- package/dist/types/src/lib/BaseThen.d.ts +0 -27
- package/dist/types/src/lib/BaseWhen.d.ts +0 -27
- package/dist/types/src/lib/Sidecar.d.ts +0 -5
- package/dist/types/src/lib/Tiposkripto.d.ts +0 -35
- package/dist/types/src/lib/Tiposkripto.test/MockTiposkripto.d.ts +0 -15
- package/dist/types/src/lib/Tiposkripto.test/Tiposkripto.adapter.d.ts +0 -3
- package/dist/types/src/lib/Tiposkripto.test/Tiposkripto.d.ts +0 -2
- package/dist/types/src/lib/Tiposkripto.test/Tiposkripto.implementation.d.ts +0 -3
- package/dist/types/src/lib/Tiposkripto.test/Tiposkripto.specification.d.ts +0 -3
- package/dist/types/src/lib/Tiposkripto.test/Tiposkripto.types.d.ts +0 -53
- package/dist/types/src/lib/abstractBase.test/MockGiven.d.ts +0 -9
- package/dist/types/src/lib/abstractBase.test/MockThen.d.ts +0 -6
- package/dist/types/src/lib/abstractBase.test/MockWhen.d.ts +0 -6
- package/dist/types/src/lib/abstractBase.test/adapter.d.ts +0 -3
- package/dist/types/src/lib/abstractBase.test/implementation.d.ts +0 -3
- package/dist/types/src/lib/abstractBase.test/index.d.ts +0 -2
- package/dist/types/src/lib/abstractBase.test/specification.d.ts +0 -3
- package/dist/types/src/lib/abstractBase.test/types.d.ts +0 -39
- package/dist/types/src/lib/index.d.ts +0 -67
- package/dist/types/src/lib/pmProxy.d.ts +0 -12
- package/dist/types/src/lib/pmProxy.test/adapter.d.ts +0 -3
- package/dist/types/src/lib/pmProxy.test/implementation.d.ts +0 -3
- package/dist/types/src/lib/pmProxy.test/index.d.ts +0 -6
- package/dist/types/src/lib/pmProxy.test/mockPM.d.ts +0 -10
- package/dist/types/src/lib/pmProxy.test/mockPMBase.d.ts +0 -40
- package/dist/types/src/lib/pmProxy.test/specification.d.ts +0 -3
- package/dist/types/src/lib/pmProxy.test/types.d.ts +0 -42
- package/dist/types/src/lib/types.d.ts +0 -24
- package/dist/types/src/mothership/index.d.ts +0 -2
- package/dist/types/src/mothership/test.d.ts +0 -2
- package/dist/types/src/testeranto.d.ts +0 -1
- package/dist/types/src/types/features.d.ts +0 -7
- package/dist/types/src/utils/api.d.ts +0 -9
- package/dist/types/src/utils/buildTemplates.d.ts +0 -1
- package/dist/types/src/utils/featureUtils.d.ts +0 -6
- package/dist/types/src/utils/golingvuMetafile.d.ts +0 -19
- package/dist/types/src/utils/logFiles.d.ts +0 -75
- package/dist/types/src/utils/makePrompt.d.ts +0 -2
- package/dist/types/src/utils/pitonoMetafile.d.ts +0 -7
- package/dist/types/src/utils/queue.d.ts +0 -11
- package/dist/types/src/utils.d.ts +0 -20
- package/dist/types/src/web.html.d.ts +0 -2
- package/dist/types/tsconfig.types.tsbuildinfo +0 -1
- package/pitono/__init__.py +0 -54
- package/pitono/types.py +0 -78
- package/src/golingvu/base_suite_test.go +0 -197
- package/src/templates/frontpage.html +0 -340
- package/src/templates/frontpage.md +0 -79
- package/testeranto/reports/core/src/lib/BaseSuite.test/web.test/web/tests.json +0 -29
- /package/{pitono → src/pitono}/core_generator.py +0 -0
- /package/{pitono → src/pitono}/pitono.egg-info/dependency_links.txt +0 -0
- /package/{pitono → src/pitono}/pitono.egg-info/entry_points.txt +0 -0
- /package/{pitono → src/pitono}/pitono.egg-info/top_level.txt +0 -0
- /package/{pitono → src/pitono}/pyproject.toml +0 -0
- /package/{pitono → src/pitono}/setup.py +0 -0
- /package/{pitono → src/pitono}/simple_adapter.py +0 -0
- /package/{dist/types/src/PM/types.d.ts → testeranto/helpo_chat_message.txt} +0 -0
- /package/{dist/types/src/components/SunriseAnimation.test/implementation.d.ts → testeranto/reports/core/example/test_example/python/stdout.log} +0 -0
- /package/{dist/types/src/components/SunriseAnimation.test/index.d.ts → testeranto/reports/core/src/Pure.test/pure/exit.log} +0 -0
- /package/{dist/types/src/components/SunriseAnimation.test/specification.d.ts → testeranto/reports/core/src/Pure.test/pure/lint_errors.txt} +0 -0
- /package/{dist/types/src/components/pure/SingleProcessView.d.ts → testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/debug.log} +0 -0
- /package/{dist/types/src/run.d.ts → testeranto/reports/core/src/components/pure/FeaturesReporterView.test/index/web/error.log} +0 -0
|
@@ -1,1775 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
2
|
-
/* eslint-disable no-async-promise-executor */
|
|
3
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
4
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
5
|
-
import { spawn } from "node:child_process";
|
|
6
|
-
import ansiColors from "ansi-colors";
|
|
7
|
-
import net from "net";
|
|
8
|
-
import fs, { watch } from "fs";
|
|
9
|
-
import path from "path";
|
|
10
|
-
import puppeteer from "puppeteer-core";
|
|
11
|
-
import ansiC from "ansi-colors";
|
|
12
|
-
import crypto from "node:crypto";
|
|
13
|
-
import { WebSocketServer } from "ws";
|
|
14
|
-
import http from "http";
|
|
15
|
-
import url from "url";
|
|
16
|
-
import mime from "mime-types";
|
|
17
|
-
import { getRunnables } from "../utils";
|
|
18
|
-
import { Queue } from "../utils/queue.js";
|
|
19
|
-
import { PM_WithEslintAndTsc } from "./PM_WithEslintAndTsc.js";
|
|
20
|
-
const changes = {};
|
|
21
|
-
const fileHashes = {};
|
|
22
|
-
const files = {};
|
|
23
|
-
const screenshots = {};
|
|
24
|
-
function runtimeLogs(runtime, reportDest) {
|
|
25
|
-
const safeDest = reportDest || `testeranto/reports/default_${Date.now()}`;
|
|
26
|
-
try {
|
|
27
|
-
if (!fs.existsSync(safeDest)) {
|
|
28
|
-
fs.mkdirSync(safeDest, { recursive: true });
|
|
29
|
-
}
|
|
30
|
-
if (runtime === "node") {
|
|
31
|
-
return {
|
|
32
|
-
stdout: fs.createWriteStream(`${safeDest}/stdout.log`),
|
|
33
|
-
stderr: fs.createWriteStream(`${safeDest}/stderr.log`),
|
|
34
|
-
exit: fs.createWriteStream(`${safeDest}/exit.log`),
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
else if (runtime === "web") {
|
|
38
|
-
return {
|
|
39
|
-
info: fs.createWriteStream(`${safeDest}/info.log`),
|
|
40
|
-
warn: fs.createWriteStream(`${safeDest}/warn.log`),
|
|
41
|
-
error: fs.createWriteStream(`${safeDest}/error.log`),
|
|
42
|
-
debug: fs.createWriteStream(`${safeDest}/debug.log`),
|
|
43
|
-
exit: fs.createWriteStream(`${safeDest}/exit.log`),
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
else if (runtime === "pure") {
|
|
47
|
-
return {
|
|
48
|
-
exit: fs.createWriteStream(`${safeDest}/exit.log`),
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
else if (runtime === "pitono") {
|
|
52
|
-
return {
|
|
53
|
-
stdout: fs.createWriteStream(`${safeDest}/stdout.log`),
|
|
54
|
-
stderr: fs.createWriteStream(`${safeDest}/stderr.log`),
|
|
55
|
-
exit: fs.createWriteStream(`${safeDest}/exit.log`),
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
throw `unknown runtime: ${runtime}`;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
catch (e) {
|
|
63
|
-
console.error(`Failed to create log streams in ${safeDest}:`, e);
|
|
64
|
-
throw e;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
function createLogStreams(reportDest, runtime) {
|
|
68
|
-
// Create directory if it doesn't exist
|
|
69
|
-
if (!fs.existsSync(reportDest)) {
|
|
70
|
-
fs.mkdirSync(reportDest, { recursive: true });
|
|
71
|
-
}
|
|
72
|
-
const streams = runtimeLogs(runtime, reportDest);
|
|
73
|
-
// const streams = {
|
|
74
|
-
// exit: fs.createWriteStream(`${reportDest}/exit.log`),
|
|
75
|
-
const safeDest = reportDest || `testeranto/reports/default_${Date.now()}`;
|
|
76
|
-
try {
|
|
77
|
-
if (!fs.existsSync(safeDest)) {
|
|
78
|
-
fs.mkdirSync(safeDest, { recursive: true });
|
|
79
|
-
}
|
|
80
|
-
const streams = runtimeLogs(runtime, safeDest);
|
|
81
|
-
// const streams = {
|
|
82
|
-
// exit: fs.createWriteStream(`${safeDest}/exit.log`),
|
|
83
|
-
// ...(runtime === "node" || runtime === "pure"
|
|
84
|
-
// ? {
|
|
85
|
-
// stdout: fs.createWriteStream(`${safeDest}/stdout.log`),
|
|
86
|
-
// stderr: fs.createWriteStream(`${safeDest}/stderr.log`),
|
|
87
|
-
// }
|
|
88
|
-
// : {
|
|
89
|
-
// info: fs.createWriteStream(`${safeDest}/info.log`),
|
|
90
|
-
// warn: fs.createWriteStream(`${safeDest}/warn.log`),
|
|
91
|
-
// error: fs.createWriteStream(`${safeDest}/error.log`),
|
|
92
|
-
// debug: fs.createWriteStream(`${safeDest}/debug.log`),
|
|
93
|
-
// }),
|
|
94
|
-
// };
|
|
95
|
-
return Object.assign(Object.assign({}, streams), { closeAll: () => {
|
|
96
|
-
Object.values(streams).forEach((stream) => !stream.closed && stream.close());
|
|
97
|
-
}, writeExitCode: (code, error) => {
|
|
98
|
-
if (error) {
|
|
99
|
-
streams.exit.write(`Error: ${error.message}\n`);
|
|
100
|
-
if (error.stack) {
|
|
101
|
-
streams.exit.write(`Stack Trace:\n${error.stack}\n`);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
streams.exit.write(`${code}\n`);
|
|
105
|
-
}, exit: streams.exit });
|
|
106
|
-
}
|
|
107
|
-
catch (e) {
|
|
108
|
-
console.error(`Failed to create log streams in ${safeDest}:`, e);
|
|
109
|
-
throw e;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
async function fileHash(filePath, algorithm = "md5") {
|
|
113
|
-
return new Promise((resolve, reject) => {
|
|
114
|
-
const hash = crypto.createHash(algorithm);
|
|
115
|
-
const fileStream = fs.createReadStream(filePath);
|
|
116
|
-
fileStream.on("data", (data) => {
|
|
117
|
-
hash.update(data);
|
|
118
|
-
});
|
|
119
|
-
fileStream.on("end", () => {
|
|
120
|
-
const fileHash = hash.digest("hex");
|
|
121
|
-
resolve(fileHash);
|
|
122
|
-
});
|
|
123
|
-
fileStream.on("error", (error) => {
|
|
124
|
-
reject(`Error reading file: ${error.message}`);
|
|
125
|
-
});
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
const statusMessagePretty = (failures, test, runtime) => {
|
|
129
|
-
if (failures === 0) {
|
|
130
|
-
console.log(ansiC.green(ansiC.inverse(`${runtime} > ${test}`)));
|
|
131
|
-
}
|
|
132
|
-
else if (failures > 0) {
|
|
133
|
-
console.log(ansiC.red(ansiC.inverse(`${runtime} > ${test} failed ${failures} times (exit code: ${failures})`)));
|
|
134
|
-
}
|
|
135
|
-
else {
|
|
136
|
-
console.log(ansiC.red(ansiC.inverse(`${runtime} > ${test} crashed (exit code: -1)`)));
|
|
137
|
-
}
|
|
138
|
-
};
|
|
139
|
-
async function writeFileAndCreateDir(filePath, data) {
|
|
140
|
-
const dirPath = path.dirname(filePath);
|
|
141
|
-
try {
|
|
142
|
-
await fs.promises.mkdir(dirPath, { recursive: true });
|
|
143
|
-
await fs.writeFileSync(filePath, data);
|
|
144
|
-
}
|
|
145
|
-
catch (error) {
|
|
146
|
-
console.error(`Error writing file: ${error}`);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
const filesHash = async (files, algorithm = "md5") => {
|
|
150
|
-
return new Promise((resolve, reject) => {
|
|
151
|
-
resolve(files.reduce(async (mm, f) => {
|
|
152
|
-
return (await mm) + (await fileHash(f));
|
|
153
|
-
}, Promise.resolve("")));
|
|
154
|
-
});
|
|
155
|
-
};
|
|
156
|
-
function isValidUrl(string) {
|
|
157
|
-
try {
|
|
158
|
-
new URL(string);
|
|
159
|
-
return true;
|
|
160
|
-
}
|
|
161
|
-
catch (err) {
|
|
162
|
-
return false;
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
// Wait for file to exist, checks every 2 seconds by default
|
|
166
|
-
async function pollForFile(path, timeout = 2000) {
|
|
167
|
-
const intervalObj = setInterval(function () {
|
|
168
|
-
const file = path;
|
|
169
|
-
const fileExists = fs.existsSync(file);
|
|
170
|
-
if (fileExists) {
|
|
171
|
-
clearInterval(intervalObj);
|
|
172
|
-
}
|
|
173
|
-
}, timeout);
|
|
174
|
-
}
|
|
175
|
-
export class PM_Main extends PM_WithEslintAndTsc {
|
|
176
|
-
constructor(configs, name, mode) {
|
|
177
|
-
super(configs, name, mode);
|
|
178
|
-
this.logStreams = {};
|
|
179
|
-
this.sidecars = {};
|
|
180
|
-
this.clients = new Set();
|
|
181
|
-
this.runningProcesses = new Map();
|
|
182
|
-
this.allProcesses = new Map();
|
|
183
|
-
this.processLogs = new Map();
|
|
184
|
-
this.getRunnables = (tests, testName, payload = {
|
|
185
|
-
nodeEntryPoints: {},
|
|
186
|
-
nodeEntryPointSidecars: {},
|
|
187
|
-
webEntryPoints: {},
|
|
188
|
-
webEntryPointSidecars: {},
|
|
189
|
-
pureEntryPoints: {},
|
|
190
|
-
pureEntryPointSidecars: {},
|
|
191
|
-
}) => {
|
|
192
|
-
return getRunnables(tests, testName, payload);
|
|
193
|
-
};
|
|
194
|
-
this.launchPure = async (src, dest) => {
|
|
195
|
-
console.log(ansiC.green(ansiC.inverse(`pure < ${src}`)));
|
|
196
|
-
this.bddTestIsRunning(src);
|
|
197
|
-
const reportDest = `testeranto/reports/${this.name}/${src
|
|
198
|
-
.split(".")
|
|
199
|
-
.slice(0, -1)
|
|
200
|
-
.join(".")}/pure`;
|
|
201
|
-
if (!fs.existsSync(reportDest)) {
|
|
202
|
-
fs.mkdirSync(reportDest, { recursive: true });
|
|
203
|
-
}
|
|
204
|
-
const destFolder = dest.replace(".mjs", "");
|
|
205
|
-
let argz = "";
|
|
206
|
-
const testConfig = this.configs.tests.find((t) => {
|
|
207
|
-
return t[0] === src;
|
|
208
|
-
});
|
|
209
|
-
if (!testConfig) {
|
|
210
|
-
console.log(ansiC.inverse("missing test config! Exiting ungracefully!"));
|
|
211
|
-
process.exit(-1);
|
|
212
|
-
}
|
|
213
|
-
const testConfigResource = testConfig[2];
|
|
214
|
-
const portsToUse = [];
|
|
215
|
-
if (testConfigResource.ports === 0) {
|
|
216
|
-
argz = JSON.stringify({
|
|
217
|
-
scheduled: true,
|
|
218
|
-
name: src,
|
|
219
|
-
ports: portsToUse,
|
|
220
|
-
fs: reportDest,
|
|
221
|
-
browserWSEndpoint: this.browser.wsEndpoint(),
|
|
222
|
-
});
|
|
223
|
-
}
|
|
224
|
-
else if (testConfigResource.ports > 0) {
|
|
225
|
-
const openPorts = Object.entries(this.ports).filter(([portnumber, status]) => status === "");
|
|
226
|
-
if (openPorts.length >= testConfigResource.ports) {
|
|
227
|
-
for (let i = 0; i < testConfigResource.ports; i++) {
|
|
228
|
-
portsToUse.push(openPorts[i][0]);
|
|
229
|
-
this.ports[openPorts[i][0]] = src; // port is now claimed
|
|
230
|
-
}
|
|
231
|
-
argz = JSON.stringify({
|
|
232
|
-
scheduled: true,
|
|
233
|
-
name: src,
|
|
234
|
-
ports: portsToUse,
|
|
235
|
-
fs: destFolder,
|
|
236
|
-
browserWSEndpoint: this.browser.wsEndpoint(),
|
|
237
|
-
});
|
|
238
|
-
}
|
|
239
|
-
else {
|
|
240
|
-
this.queue.push(src);
|
|
241
|
-
return [Math.random(), argz];
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
else {
|
|
245
|
-
console.error("negative port makes no sense", src);
|
|
246
|
-
process.exit(-1);
|
|
247
|
-
}
|
|
248
|
-
const builtfile = dest;
|
|
249
|
-
// const webSideCares: Page[] = [];
|
|
250
|
-
// fs.writeFileSync(
|
|
251
|
-
// `${reportDest}/stdlog.txt`,
|
|
252
|
-
// "THIS FILE IS AUTO GENERATED. IT IS PURPOSEFULLY LEFT BLANK."
|
|
253
|
-
// );
|
|
254
|
-
// await Promise.all(
|
|
255
|
-
// testConfig[3].map(async (sidecar) => {
|
|
256
|
-
// if (sidecar[1] === "web") {
|
|
257
|
-
// const s = await this.launchWebSideCar(
|
|
258
|
-
// sidecar[0],
|
|
259
|
-
// destinationOfRuntime(sidecar[0], "web", this.configs),
|
|
260
|
-
// sidecar
|
|
261
|
-
// );
|
|
262
|
-
// webSideCares.push(s);
|
|
263
|
-
// return s;
|
|
264
|
-
// }
|
|
265
|
-
// if (sidecar[1] === "node") {
|
|
266
|
-
// return this.launchNodeSideCar(
|
|
267
|
-
// sidecar[0],
|
|
268
|
-
// destinationOfRuntime(sidecar[0], "node", this.configs),
|
|
269
|
-
// sidecar
|
|
270
|
-
// );
|
|
271
|
-
// }
|
|
272
|
-
// })
|
|
273
|
-
// );
|
|
274
|
-
const logs = createLogStreams(reportDest, "pure");
|
|
275
|
-
try {
|
|
276
|
-
await import(`${builtfile}?cacheBust=${Date.now()}`).then((module) => {
|
|
277
|
-
// Override console methods to redirect logs
|
|
278
|
-
// Only override stdout/stderr methods for pure runtime
|
|
279
|
-
const originalConsole = Object.assign({}, console);
|
|
280
|
-
// console.log = (...args) => {
|
|
281
|
-
// logs.stdout.write(args.join(" ") + "\n");
|
|
282
|
-
// originalConsole.log(...args);
|
|
283
|
-
// };
|
|
284
|
-
// console.error = (...args) => {
|
|
285
|
-
// logs.stderr.write(args.join(" ") + "\n");
|
|
286
|
-
// originalConsole.error(...args);
|
|
287
|
-
// };
|
|
288
|
-
return module.default
|
|
289
|
-
.then((defaultModule) => {
|
|
290
|
-
defaultModule
|
|
291
|
-
.receiveTestResourceConfig(argz)
|
|
292
|
-
.then(async (results) => {
|
|
293
|
-
// this.receiveFeatures(results.features, destFolder, src, "pure");
|
|
294
|
-
// this.receiveFeaturesV2(reportDest, src, "pure");
|
|
295
|
-
statusMessagePretty(results.fails, src, "pure");
|
|
296
|
-
this.bddTestIsNowDone(src, results.fails);
|
|
297
|
-
})
|
|
298
|
-
.catch((e1) => {
|
|
299
|
-
console.log(ansiC.red(`launchPure - ${src} errored with: ${e1.stack}`));
|
|
300
|
-
this.bddTestIsNowDone(src, -1);
|
|
301
|
-
statusMessagePretty(-1, src, "pure");
|
|
302
|
-
});
|
|
303
|
-
// .finally(() => {
|
|
304
|
-
// // webSideCares.forEach((webSideCar) => webSideCar.close());
|
|
305
|
-
// });
|
|
306
|
-
})
|
|
307
|
-
.catch((e2) => {
|
|
308
|
-
console.log(ansiColors.red(`pure ! ${src} failed to execute. No "tests.json" file was generated. Check the logs for more info`));
|
|
309
|
-
logs.exit.write(e2.stack);
|
|
310
|
-
logs.exit.write(-1);
|
|
311
|
-
this.bddTestIsNowDone(src, -1);
|
|
312
|
-
statusMessagePretty(-1, src, "pure");
|
|
313
|
-
// console.error(e);
|
|
314
|
-
})
|
|
315
|
-
.finally((x) => {
|
|
316
|
-
// const fileSet = files[src] || new Set();
|
|
317
|
-
// fs.writeFileSync(
|
|
318
|
-
// reportDest + "/manifest.json",
|
|
319
|
-
// JSON.stringify(Array.from(fileSet))
|
|
320
|
-
// );
|
|
321
|
-
});
|
|
322
|
-
});
|
|
323
|
-
}
|
|
324
|
-
catch (e3) {
|
|
325
|
-
logs.writeExitCode(-1, e3);
|
|
326
|
-
console.log(ansiC.red(ansiC.inverse(`${src} 1 errored with: ${e3}. Check logs for more info`)));
|
|
327
|
-
logs.exit.write(e3.stack);
|
|
328
|
-
logs.exit.write("-1");
|
|
329
|
-
this.bddTestIsNowDone(src, -1);
|
|
330
|
-
statusMessagePretty(-1, src, "pure");
|
|
331
|
-
}
|
|
332
|
-
for (let i = 0; i <= portsToUse.length; i++) {
|
|
333
|
-
if (portsToUse[i]) {
|
|
334
|
-
this.ports[portsToUse[i]] = ""; //port is open again
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
};
|
|
338
|
-
this.launchNode = async (src, dest) => {
|
|
339
|
-
console.log(ansiC.green(ansiC.inverse(`node < ${src}`)));
|
|
340
|
-
this.bddTestIsRunning(src);
|
|
341
|
-
const reportDest = `testeranto/reports/${this.name}/${src
|
|
342
|
-
.split(".")
|
|
343
|
-
.slice(0, -1)
|
|
344
|
-
.join(".")}/node`;
|
|
345
|
-
if (!fs.existsSync(reportDest)) {
|
|
346
|
-
fs.mkdirSync(reportDest, { recursive: true });
|
|
347
|
-
}
|
|
348
|
-
// const destFolder = dest.replace(".mjs", "");
|
|
349
|
-
let testResources = "";
|
|
350
|
-
const testConfig = this.configs.tests.find((t) => {
|
|
351
|
-
return t[0] === src;
|
|
352
|
-
});
|
|
353
|
-
if (!testConfig) {
|
|
354
|
-
console.log(ansiC.inverse(`missing test config! Exiting ungracefully for '${src}'`));
|
|
355
|
-
process.exit(-1);
|
|
356
|
-
}
|
|
357
|
-
const testConfigResource = testConfig[2];
|
|
358
|
-
const portsToUse = [];
|
|
359
|
-
if (testConfigResource.ports === 0) {
|
|
360
|
-
const t = {
|
|
361
|
-
name: src,
|
|
362
|
-
// ports: portsToUse.map((v) => Number(v)),
|
|
363
|
-
ports: [],
|
|
364
|
-
fs: reportDest,
|
|
365
|
-
browserWSEndpoint: this.browser.wsEndpoint(),
|
|
366
|
-
};
|
|
367
|
-
testResources = JSON.stringify(t);
|
|
368
|
-
}
|
|
369
|
-
else if (testConfigResource.ports > 0) {
|
|
370
|
-
const openPorts = Object.entries(this.ports).filter(([portnumber, portopen]) => portopen === "");
|
|
371
|
-
if (openPorts.length >= testConfigResource.ports) {
|
|
372
|
-
for (let i = 0; i < testConfigResource.ports; i++) {
|
|
373
|
-
portsToUse.push(openPorts[i][0]); // Convert string port to number
|
|
374
|
-
this.ports[openPorts[i][0]] = src; // port is now claimed
|
|
375
|
-
}
|
|
376
|
-
testResources = JSON.stringify({
|
|
377
|
-
scheduled: true,
|
|
378
|
-
name: src,
|
|
379
|
-
ports: portsToUse,
|
|
380
|
-
fs: reportDest,
|
|
381
|
-
browserWSEndpoint: this.browser.wsEndpoint(),
|
|
382
|
-
});
|
|
383
|
-
}
|
|
384
|
-
else {
|
|
385
|
-
console.log(ansiC.red(`node: cannot run ${src} because there are no open ports ATM. This job will be enqueued and run again run a port is available`));
|
|
386
|
-
this.queue.push(src);
|
|
387
|
-
return [Math.random(), argz]; // Add this return
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
else {
|
|
391
|
-
console.error("negative port makes no sense", src);
|
|
392
|
-
process.exit(-1);
|
|
393
|
-
}
|
|
394
|
-
const builtfile = dest;
|
|
395
|
-
let haltReturns = false;
|
|
396
|
-
const ipcfile = "/tmp/tpipe_" + Math.random();
|
|
397
|
-
const child = spawn("node",
|
|
398
|
-
// "node",
|
|
399
|
-
[
|
|
400
|
-
// "--inspect-brk",
|
|
401
|
-
builtfile,
|
|
402
|
-
testResources,
|
|
403
|
-
ipcfile,
|
|
404
|
-
], {
|
|
405
|
-
stdio: ["pipe", "pipe", "pipe", "ipc"],
|
|
406
|
-
});
|
|
407
|
-
let buffer = new Buffer("");
|
|
408
|
-
const server = net.createServer((socket) => {
|
|
409
|
-
const queue = new Queue();
|
|
410
|
-
socket.on("data", (data) => {
|
|
411
|
-
buffer = Buffer.concat([buffer, data]);
|
|
412
|
-
for (let b = 0; b < buffer.length + 1; b++) {
|
|
413
|
-
const c = buffer.slice(0, b);
|
|
414
|
-
let d;
|
|
415
|
-
try {
|
|
416
|
-
d = JSON.parse(c.toString());
|
|
417
|
-
queue.enqueue(d);
|
|
418
|
-
buffer = buffer.slice(b, buffer.length + 1);
|
|
419
|
-
b = 0;
|
|
420
|
-
}
|
|
421
|
-
catch (e) {
|
|
422
|
-
// b++;
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
while (queue.size() > 0) {
|
|
426
|
-
const message = queue.dequeue();
|
|
427
|
-
if (message) {
|
|
428
|
-
// set up the "node" listeners
|
|
429
|
-
this.mapping().forEach(async ([command, func]) => {
|
|
430
|
-
if (message[0] === command) {
|
|
431
|
-
const x = message.slice(1, -1);
|
|
432
|
-
const r = await this[command](...x);
|
|
433
|
-
if (!haltReturns) {
|
|
434
|
-
child.send(JSON.stringify({
|
|
435
|
-
payload: r,
|
|
436
|
-
key: message[message.length - 1],
|
|
437
|
-
}));
|
|
438
|
-
}
|
|
439
|
-
}
|
|
440
|
-
});
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
});
|
|
444
|
-
});
|
|
445
|
-
const logs = createLogStreams(reportDest, "node");
|
|
446
|
-
server.listen(ipcfile, () => {
|
|
447
|
-
var _a, _b;
|
|
448
|
-
// Only handle stdout/stderr for node runtime
|
|
449
|
-
(_a = child.stdout) === null || _a === void 0 ? void 0 : _a.on("data", (data) => {
|
|
450
|
-
var _a;
|
|
451
|
-
(_a = logs.stdout) === null || _a === void 0 ? void 0 : _a.write(data); // Add null check
|
|
452
|
-
});
|
|
453
|
-
(_b = child.stderr) === null || _b === void 0 ? void 0 : _b.on("data", (data) => {
|
|
454
|
-
var _a;
|
|
455
|
-
(_a = logs.stderr) === null || _a === void 0 ? void 0 : _a.write(data); // Add null check
|
|
456
|
-
});
|
|
457
|
-
child.on("error", (err) => { });
|
|
458
|
-
child.on("close", (code) => {
|
|
459
|
-
const exitCode = code === null ? -1 : code;
|
|
460
|
-
if (exitCode < 0) {
|
|
461
|
-
logs.writeExitCode(exitCode, new Error("Process crashed or was terminated"));
|
|
462
|
-
}
|
|
463
|
-
else {
|
|
464
|
-
logs.writeExitCode(exitCode);
|
|
465
|
-
}
|
|
466
|
-
logs.closeAll();
|
|
467
|
-
server.close();
|
|
468
|
-
if (!files[src]) {
|
|
469
|
-
files[src] = new Set();
|
|
470
|
-
}
|
|
471
|
-
if (exitCode === 255) {
|
|
472
|
-
console.log(ansiColors.red(`node ! ${src} failed to execute. No "tests.json" file was generated. Check ${reportDest}/stderr.log for more info`));
|
|
473
|
-
this.bddTestIsNowDone(src, -1);
|
|
474
|
-
statusMessagePretty(-1, src, "node");
|
|
475
|
-
return;
|
|
476
|
-
}
|
|
477
|
-
else if (exitCode === 0) {
|
|
478
|
-
this.bddTestIsNowDone(src, 0);
|
|
479
|
-
statusMessagePretty(0, src, "node");
|
|
480
|
-
}
|
|
481
|
-
else {
|
|
482
|
-
this.bddTestIsNowDone(src, exitCode);
|
|
483
|
-
statusMessagePretty(exitCode, src, "node");
|
|
484
|
-
}
|
|
485
|
-
haltReturns = true;
|
|
486
|
-
});
|
|
487
|
-
child.on("exit", (code) => {
|
|
488
|
-
haltReturns = true;
|
|
489
|
-
for (let i = 0; i <= portsToUse.length; i++) {
|
|
490
|
-
if (portsToUse[i]) {
|
|
491
|
-
this.ports[portsToUse[i]] = ""; //port is open again
|
|
492
|
-
}
|
|
493
|
-
}
|
|
494
|
-
});
|
|
495
|
-
child.on("error", (e) => {
|
|
496
|
-
console.log("error");
|
|
497
|
-
haltReturns = true;
|
|
498
|
-
console.log(ansiC.red(ansiC.inverse(`${src} errored with: ${e.name}. Check error logs for more info`)));
|
|
499
|
-
this.bddTestIsNowDone(src, -1);
|
|
500
|
-
statusMessagePretty(-1, src, "node");
|
|
501
|
-
});
|
|
502
|
-
});
|
|
503
|
-
};
|
|
504
|
-
this.launchWebSideCar = async (testConfig) => {
|
|
505
|
-
const src = testConfig[0];
|
|
506
|
-
const dest = src.split(".").slice(0, -1).join(".");
|
|
507
|
-
// const d = dest + ".mjs";
|
|
508
|
-
const destFolder = dest.replace(".mjs", "");
|
|
509
|
-
console.log(ansiC.green(ansiC.inverse(`launchWebSideCar ${src}`)));
|
|
510
|
-
// const fileStreams2: fs.WriteStream[] = [];
|
|
511
|
-
// const doneFileStream2: Promise<any>[] = [];
|
|
512
|
-
const logs = createLogStreams(dest, "web");
|
|
513
|
-
return new Promise((res, rej) => {
|
|
514
|
-
this.browser
|
|
515
|
-
.newPage()
|
|
516
|
-
.then(async (page) => {
|
|
517
|
-
this.mapping().forEach(async ([command, func]) => {
|
|
518
|
-
page.exposeFunction(command, func);
|
|
519
|
-
});
|
|
520
|
-
const close = () => {
|
|
521
|
-
if (!files[src]) {
|
|
522
|
-
files[src] = new Set();
|
|
523
|
-
}
|
|
524
|
-
// files[src].add(filepath);
|
|
525
|
-
// fs.writeFileSync(
|
|
526
|
-
// destFolder + "/manifest.json",
|
|
527
|
-
// JSON.stringify(Array.from(files[src]))
|
|
528
|
-
// );
|
|
529
|
-
delete files[src];
|
|
530
|
-
Promise.all(screenshots[src] || []).then(() => {
|
|
531
|
-
delete screenshots[src];
|
|
532
|
-
page.close();
|
|
533
|
-
});
|
|
534
|
-
};
|
|
535
|
-
page.on("pageerror", (err) => {
|
|
536
|
-
console.debug(`Error from ${src}: [${err.name}] `);
|
|
537
|
-
console.debug(`Error from ${src}: [${err.name}] `);
|
|
538
|
-
if (err.cause) {
|
|
539
|
-
console.debug(`Error from ${src} cause: [${err.cause}] `);
|
|
540
|
-
}
|
|
541
|
-
if (err.stack) {
|
|
542
|
-
console.debug(`Error from stack ${src}: [${err.stack}] `);
|
|
543
|
-
}
|
|
544
|
-
console.debug(`Error from message ${src}: [${err.message}] `);
|
|
545
|
-
this.bddTestIsNowDone(src, -1);
|
|
546
|
-
close();
|
|
547
|
-
});
|
|
548
|
-
page.on("console", (log) => {
|
|
549
|
-
var _a, _b, _c, _d;
|
|
550
|
-
const msg = `${log.text()}\n${JSON.stringify(log.location())}\n${JSON.stringify(log.stackTrace())}\n`;
|
|
551
|
-
switch (log.type()) {
|
|
552
|
-
case "info":
|
|
553
|
-
(_a = logs.info) === null || _a === void 0 ? void 0 : _a.write(msg);
|
|
554
|
-
break;
|
|
555
|
-
case "warn":
|
|
556
|
-
(_b = logs.warn) === null || _b === void 0 ? void 0 : _b.write(msg);
|
|
557
|
-
break;
|
|
558
|
-
case "error":
|
|
559
|
-
(_c = logs.error) === null || _c === void 0 ? void 0 : _c.write(msg);
|
|
560
|
-
break;
|
|
561
|
-
case "debug":
|
|
562
|
-
(_d = logs.debug) === null || _d === void 0 ? void 0 : _d.write(msg);
|
|
563
|
-
break;
|
|
564
|
-
default:
|
|
565
|
-
break;
|
|
566
|
-
}
|
|
567
|
-
});
|
|
568
|
-
await page.goto(`file://${`${destFolder}.html`}`, {});
|
|
569
|
-
const webArgz = JSON.stringify({
|
|
570
|
-
name: dest,
|
|
571
|
-
ports: [].toString(),
|
|
572
|
-
fs: dest,
|
|
573
|
-
browserWSEndpoint: this.browser.wsEndpoint(),
|
|
574
|
-
});
|
|
575
|
-
const d = `${dest}?cacheBust=${Date.now()}`;
|
|
576
|
-
const evaluation = `
|
|
577
|
-
import('${d}').then(async (x) => {
|
|
578
|
-
|
|
579
|
-
try {
|
|
580
|
-
return await (await x.default).receiveTestResourceConfig(${webArgz})
|
|
581
|
-
} catch (e) {
|
|
582
|
-
console.log("fail", e.toString())
|
|
583
|
-
}
|
|
584
|
-
})`;
|
|
585
|
-
await page
|
|
586
|
-
.evaluate(evaluation)
|
|
587
|
-
.then(async ({ fails, failed, features }) => {
|
|
588
|
-
// this.receiveFeatures(features, destFolder, src, "web");
|
|
589
|
-
// this.receiveFeaturesV2(reportDest, src, "web");
|
|
590
|
-
statusMessagePretty(fails, src, "web");
|
|
591
|
-
this.bddTestIsNowDone(src, fails);
|
|
592
|
-
})
|
|
593
|
-
.catch((e) => {
|
|
594
|
-
console.log(ansiC.red(ansiC.inverse(`launchWebSidecar - ${src} errored with: ${e}`)));
|
|
595
|
-
})
|
|
596
|
-
.finally(() => {
|
|
597
|
-
this.bddTestIsNowDone(src, -1);
|
|
598
|
-
close();
|
|
599
|
-
});
|
|
600
|
-
return page;
|
|
601
|
-
// return page;
|
|
602
|
-
})
|
|
603
|
-
.then(async (page) => {
|
|
604
|
-
await page.goto(`file://${`${dest}.html`}`, {});
|
|
605
|
-
res([Math.random(), page]);
|
|
606
|
-
});
|
|
607
|
-
});
|
|
608
|
-
};
|
|
609
|
-
this.launchNodeSideCar = async (sidecar) => {
|
|
610
|
-
const src = sidecar[0];
|
|
611
|
-
const dest = process.cwd() + `/testeranto/bundles/node/${this.name}/${sidecar[0]}`;
|
|
612
|
-
const d = dest + ".mjs";
|
|
613
|
-
console.log(ansiC.green(ansiC.inverse(`launchNodeSideCar ${sidecar[0]}`)));
|
|
614
|
-
const destFolder = dest.replace(".ts", "");
|
|
615
|
-
const reportDest = `testeranto/reports/${this.name}/${src
|
|
616
|
-
.split(".")
|
|
617
|
-
.slice(0, -1)
|
|
618
|
-
.join(".")}/node`;
|
|
619
|
-
const argz = {
|
|
620
|
-
name: sidecar[0],
|
|
621
|
-
ports: [],
|
|
622
|
-
fs: destFolder,
|
|
623
|
-
browserWSEndpoint: this.browser.wsEndpoint(),
|
|
624
|
-
};
|
|
625
|
-
const testReq = sidecar[2];
|
|
626
|
-
const logs = createLogStreams(dest, "node");
|
|
627
|
-
const portsToUse = [];
|
|
628
|
-
if (testReq.ports === 0) {
|
|
629
|
-
// argz = {
|
|
630
|
-
// name: sidecar[0],
|
|
631
|
-
// ports: portsToUse,
|
|
632
|
-
// fs: destFolder,
|
|
633
|
-
// browserWSEndpoint: this.browser.wsEndpoint(),
|
|
634
|
-
// };
|
|
635
|
-
}
|
|
636
|
-
else if (testReq.ports > 0) {
|
|
637
|
-
const openPorts = Object.entries(this.ports).filter(([portnumber, portopen]) => portopen === "");
|
|
638
|
-
if (openPorts.length >= testReq.ports) {
|
|
639
|
-
for (let i = 0; i < testReq.ports; i++) {
|
|
640
|
-
portsToUse.push(Number(openPorts[i][0])); // Convert string port to number
|
|
641
|
-
this.ports[openPorts[i][0]] = src; // port is now closed
|
|
642
|
-
}
|
|
643
|
-
argz.ports = portsToUse;
|
|
644
|
-
const builtfile = destFolder + ".mjs";
|
|
645
|
-
let haltReturns = false;
|
|
646
|
-
let buffer = new Buffer("");
|
|
647
|
-
const server = net.createServer((socket) => {
|
|
648
|
-
socket.on("data", (data) => {
|
|
649
|
-
buffer = Buffer.concat([buffer, data]);
|
|
650
|
-
const messages = [];
|
|
651
|
-
for (let b = 0; b < buffer.length + 1; b++) {
|
|
652
|
-
const c = buffer.slice(0, b);
|
|
653
|
-
let d;
|
|
654
|
-
try {
|
|
655
|
-
d = JSON.parse(c.toString());
|
|
656
|
-
messages.push(d);
|
|
657
|
-
buffer = buffer.slice(b, buffer.length + 1);
|
|
658
|
-
b = 0;
|
|
659
|
-
}
|
|
660
|
-
catch (e) {
|
|
661
|
-
// b++;
|
|
662
|
-
}
|
|
663
|
-
}
|
|
664
|
-
messages.forEach(async (payload) => {
|
|
665
|
-
this.mapping().forEach(async ([command, func]) => {
|
|
666
|
-
if (payload[0] === command) {
|
|
667
|
-
const x = payload.slice(1, -1);
|
|
668
|
-
const r = await this[command](...x);
|
|
669
|
-
if (!haltReturns) {
|
|
670
|
-
child.send(JSON.stringify({
|
|
671
|
-
payload: r,
|
|
672
|
-
key: payload[payload.length - 1],
|
|
673
|
-
}));
|
|
674
|
-
}
|
|
675
|
-
}
|
|
676
|
-
});
|
|
677
|
-
});
|
|
678
|
-
});
|
|
679
|
-
});
|
|
680
|
-
const child = spawn("node", [builtfile, JSON.stringify(argz)], {
|
|
681
|
-
stdio: ["pipe", "pipe", "pipe", "ipc"],
|
|
682
|
-
// silent: true
|
|
683
|
-
});
|
|
684
|
-
const p = "/tmp/tpipe" + Math.random();
|
|
685
|
-
server.listen(p, () => {
|
|
686
|
-
child.on("close", (code) => {
|
|
687
|
-
server.close();
|
|
688
|
-
haltReturns = true;
|
|
689
|
-
});
|
|
690
|
-
child.on("exit", (code) => {
|
|
691
|
-
haltReturns = true;
|
|
692
|
-
for (let i = 0; i <= portsToUse.length; i++) {
|
|
693
|
-
if (portsToUse[i]) {
|
|
694
|
-
this.ports[portsToUse[i]] = ""; //port is open again
|
|
695
|
-
}
|
|
696
|
-
}
|
|
697
|
-
});
|
|
698
|
-
child.on("error", (e) => {
|
|
699
|
-
var _a;
|
|
700
|
-
if (fs.existsSync(p)) {
|
|
701
|
-
fs.rmSync(p);
|
|
702
|
-
}
|
|
703
|
-
haltReturns = true;
|
|
704
|
-
console.log(ansiC.red(ansiC.inverse(`launchNodeSideCar - ${src} errored with: ${e.name}. Check logs for more info`)));
|
|
705
|
-
(_a = logs.error) === null || _a === void 0 ? void 0 : _a.write(e.toString() + "\n");
|
|
706
|
-
// this.bddTestIsNowDone(src, -1);
|
|
707
|
-
// statusMessagePretty(-1, src);
|
|
708
|
-
});
|
|
709
|
-
});
|
|
710
|
-
child.send({ path: p });
|
|
711
|
-
const r = Math.random();
|
|
712
|
-
this.nodeSidecars[r] = child;
|
|
713
|
-
return [r, argz];
|
|
714
|
-
}
|
|
715
|
-
else {
|
|
716
|
-
console.log(ansiC.red(`cannot ${src} because there are no open ports. the job will be unqueued`));
|
|
717
|
-
this.queue.push(sidecar[0]);
|
|
718
|
-
return [Math.random(), argz];
|
|
719
|
-
}
|
|
720
|
-
}
|
|
721
|
-
else {
|
|
722
|
-
console.error("negative port makes no sense", sidecar[0]);
|
|
723
|
-
process.exit(-1);
|
|
724
|
-
}
|
|
725
|
-
};
|
|
726
|
-
this.stopPureSideCar = async (uid) => {
|
|
727
|
-
console.log(ansiC.green(ansiC.inverse(`stopPureSideCar ${uid}`)));
|
|
728
|
-
await this.sidecars[uid].shutdown();
|
|
729
|
-
return;
|
|
730
|
-
};
|
|
731
|
-
this.launchPureSideCar = async (sidecar) => {
|
|
732
|
-
console.log(ansiC.green(ansiC.inverse(`launchPureSideCar ${sidecar[0]}`)));
|
|
733
|
-
const r = Math.random();
|
|
734
|
-
const dest = process.cwd() + `/testeranto/bundles/pure/${this.name}/${sidecar[0]}`;
|
|
735
|
-
const builtfile = dest.split(".").slice(0, -1).concat("mjs").join(".");
|
|
736
|
-
const destFolder = dest.replace(".mjs", "");
|
|
737
|
-
let argz;
|
|
738
|
-
const z = sidecar[2];
|
|
739
|
-
const testConfigResource = sidecar[2];
|
|
740
|
-
const src = sidecar[0];
|
|
741
|
-
const portsToUse = [];
|
|
742
|
-
if (testConfigResource.ports === 0) {
|
|
743
|
-
argz = {
|
|
744
|
-
// scheduled: true,
|
|
745
|
-
name: src,
|
|
746
|
-
ports: portsToUse,
|
|
747
|
-
fs: destFolder,
|
|
748
|
-
browserWSEndpoint: this.browser.wsEndpoint(),
|
|
749
|
-
};
|
|
750
|
-
}
|
|
751
|
-
else if (testConfigResource.ports > 0) {
|
|
752
|
-
const openPorts = Object.entries(this.ports).filter(([portnumber, portopen]) => portopen === "");
|
|
753
|
-
if (openPorts.length >= testConfigResource.ports) {
|
|
754
|
-
for (let i = 0; i < testConfigResource.ports; i++) {
|
|
755
|
-
portsToUse.push(Number(openPorts[i][0]));
|
|
756
|
-
this.ports[openPorts[i][0]] = src; // port is now claimed
|
|
757
|
-
}
|
|
758
|
-
argz = {
|
|
759
|
-
// scheduled: true,
|
|
760
|
-
name: src,
|
|
761
|
-
// ports: [3333],
|
|
762
|
-
ports: portsToUse,
|
|
763
|
-
fs: ".",
|
|
764
|
-
browserWSEndpoint: this.browser.wsEndpoint(),
|
|
765
|
-
};
|
|
766
|
-
}
|
|
767
|
-
else {
|
|
768
|
-
this.queue.push(src);
|
|
769
|
-
// return;
|
|
770
|
-
}
|
|
771
|
-
}
|
|
772
|
-
else {
|
|
773
|
-
console.error("negative port makes no sense", src);
|
|
774
|
-
process.exit(-1);
|
|
775
|
-
}
|
|
776
|
-
// const builtfile = dest + ".mjs";
|
|
777
|
-
await import(`${builtfile}?cacheBust=${Date.now()}`).then((module) => {
|
|
778
|
-
if (!this.pureSidecars)
|
|
779
|
-
this.pureSidecars = {};
|
|
780
|
-
this.pureSidecars[r] = module.default;
|
|
781
|
-
this.pureSidecars[r].start(argz);
|
|
782
|
-
});
|
|
783
|
-
return [r, argz];
|
|
784
|
-
// for (let i = 0; i <= portsToUse.length; i++) {
|
|
785
|
-
// if (portsToUse[i]) {
|
|
786
|
-
// this.ports[portsToUse[i]] = "true"; //port is open again
|
|
787
|
-
// }
|
|
788
|
-
// }
|
|
789
|
-
};
|
|
790
|
-
this.launchPitono = async (src, dest) => {
|
|
791
|
-
console.log(ansiC.green(ansiC.inverse(`pitono < ${src}`)));
|
|
792
|
-
this.bddTestIsRunning(src);
|
|
793
|
-
const reportDest = `testeranto/reports/${this.name}/${src
|
|
794
|
-
.split(".")
|
|
795
|
-
.slice(0, -1)
|
|
796
|
-
.join(".")}/pitono`;
|
|
797
|
-
if (!fs.existsSync(reportDest)) {
|
|
798
|
-
fs.mkdirSync(reportDest, { recursive: true });
|
|
799
|
-
}
|
|
800
|
-
const logs = createLogStreams(reportDest, "node"); // Use node-style logs for pitono
|
|
801
|
-
try {
|
|
802
|
-
// Execute the Python test using the pitono runner
|
|
803
|
-
const { PitonoRunner } = await import('./pitonoRunner');
|
|
804
|
-
const runner = new PitonoRunner(this.configs, this.name);
|
|
805
|
-
await runner.run();
|
|
806
|
-
this.bddTestIsNowDone(src, 0);
|
|
807
|
-
statusMessagePretty(0, src, "pitono");
|
|
808
|
-
}
|
|
809
|
-
catch (error) {
|
|
810
|
-
logs.writeExitCode(-1, error);
|
|
811
|
-
console.log(ansiC.red(ansiC.inverse(`${src} errored with: ${error}. Check logs for more info`)));
|
|
812
|
-
this.bddTestIsNowDone(src, -1);
|
|
813
|
-
statusMessagePretty(-1, src, "pitono");
|
|
814
|
-
}
|
|
815
|
-
};
|
|
816
|
-
this.launchWeb = async (src, dest) => {
|
|
817
|
-
console.log(ansiC.green(ansiC.inverse(`web < ${src}`)));
|
|
818
|
-
this.bddTestIsRunning(src);
|
|
819
|
-
const reportDest = `testeranto/reports/${this.name}/${src
|
|
820
|
-
.split(".")
|
|
821
|
-
.slice(0, -1)
|
|
822
|
-
.join(".")}/web`;
|
|
823
|
-
if (!fs.existsSync(reportDest)) {
|
|
824
|
-
fs.mkdirSync(reportDest, { recursive: true });
|
|
825
|
-
}
|
|
826
|
-
const destFolder = dest.replace(".mjs", "");
|
|
827
|
-
const webArgz = JSON.stringify({
|
|
828
|
-
name: src,
|
|
829
|
-
ports: [].toString(),
|
|
830
|
-
fs: reportDest,
|
|
831
|
-
browserWSEndpoint: this.browser.wsEndpoint(),
|
|
832
|
-
});
|
|
833
|
-
const d = `${dest}?cacheBust=${Date.now()}`;
|
|
834
|
-
const logs = createLogStreams(reportDest, "web");
|
|
835
|
-
this.browser
|
|
836
|
-
.newPage()
|
|
837
|
-
.then((page) => {
|
|
838
|
-
page.on("console", (log) => {
|
|
839
|
-
var _a, _b, _c, _d;
|
|
840
|
-
const msg = `${log.text()}\n`;
|
|
841
|
-
switch (log.type()) {
|
|
842
|
-
case "info":
|
|
843
|
-
(_a = logs.info) === null || _a === void 0 ? void 0 : _a.write(msg);
|
|
844
|
-
break;
|
|
845
|
-
case "warn":
|
|
846
|
-
(_b = logs.warn) === null || _b === void 0 ? void 0 : _b.write(msg);
|
|
847
|
-
break;
|
|
848
|
-
case "error":
|
|
849
|
-
(_c = logs.error) === null || _c === void 0 ? void 0 : _c.write(msg);
|
|
850
|
-
break;
|
|
851
|
-
case "debug":
|
|
852
|
-
(_d = logs.debug) === null || _d === void 0 ? void 0 : _d.write(msg);
|
|
853
|
-
break;
|
|
854
|
-
default:
|
|
855
|
-
break;
|
|
856
|
-
}
|
|
857
|
-
});
|
|
858
|
-
page.on("close", () => {
|
|
859
|
-
logs.writeExitCode(0); // Web tests exit with 0 unless there's an error
|
|
860
|
-
logs.closeAll();
|
|
861
|
-
logs.closeAll();
|
|
862
|
-
});
|
|
863
|
-
this.mapping().forEach(async ([command, func]) => {
|
|
864
|
-
if (command === "page") {
|
|
865
|
-
page.exposeFunction(command, (x) => {
|
|
866
|
-
if (x) {
|
|
867
|
-
return func(x);
|
|
868
|
-
}
|
|
869
|
-
else {
|
|
870
|
-
return func(page.mainFrame()._id);
|
|
871
|
-
}
|
|
872
|
-
});
|
|
873
|
-
}
|
|
874
|
-
else {
|
|
875
|
-
return page.exposeFunction(command, func);
|
|
876
|
-
}
|
|
877
|
-
});
|
|
878
|
-
return page;
|
|
879
|
-
})
|
|
880
|
-
.then(async (page) => {
|
|
881
|
-
const close = () => {
|
|
882
|
-
if (!files[src]) {
|
|
883
|
-
files[src] = new Set();
|
|
884
|
-
}
|
|
885
|
-
// files[t].add(filepath);
|
|
886
|
-
// fs.writeFileSync(
|
|
887
|
-
// destFolder + "/manifest.json",
|
|
888
|
-
// JSON.stringify(Array.from(files[src]))
|
|
889
|
-
// );
|
|
890
|
-
delete files[src];
|
|
891
|
-
Promise.all(screenshots[src] || []).then(() => {
|
|
892
|
-
delete screenshots[src];
|
|
893
|
-
page.close();
|
|
894
|
-
});
|
|
895
|
-
return;
|
|
896
|
-
};
|
|
897
|
-
page.on("pageerror", (err) => {
|
|
898
|
-
logs.writeExitCode(-1, err);
|
|
899
|
-
console.log(ansiColors.red(`web ! ${src} failed to execute No "tests.json" file was generated. Check ${reportDest}/error.log for more info`));
|
|
900
|
-
this.bddTestIsNowDone(src, -1);
|
|
901
|
-
close();
|
|
902
|
-
});
|
|
903
|
-
// page.on("console", (log: ConsoleMessage) => {});
|
|
904
|
-
await page.goto(`file://${`${destFolder}.html`}`, {});
|
|
905
|
-
await page
|
|
906
|
-
.evaluate(`
|
|
907
|
-
import('${d}').then(async (x) => {
|
|
908
|
-
try {
|
|
909
|
-
return await (await x.default).receiveTestResourceConfig(${webArgz})
|
|
910
|
-
} catch (e) {
|
|
911
|
-
console.log("web run failure", e.toString())
|
|
912
|
-
}
|
|
913
|
-
})
|
|
914
|
-
`)
|
|
915
|
-
.then(async ({ fails, failed, features }) => {
|
|
916
|
-
statusMessagePretty(fails, src, "web");
|
|
917
|
-
this.bddTestIsNowDone(src, fails);
|
|
918
|
-
// close();
|
|
919
|
-
})
|
|
920
|
-
.catch((e) => {
|
|
921
|
-
console.log(ansiC.red(ansiC.inverse(e.stack)));
|
|
922
|
-
console.log(ansiC.red(ansiC.inverse(`web ! ${src} failed to execute. No "tests.json" file was generated. Check logs for more info`)));
|
|
923
|
-
this.bddTestIsNowDone(src, -1);
|
|
924
|
-
})
|
|
925
|
-
.finally(() => {
|
|
926
|
-
// process.exit(-1);
|
|
927
|
-
close();
|
|
928
|
-
});
|
|
929
|
-
return page;
|
|
930
|
-
});
|
|
931
|
-
};
|
|
932
|
-
this.receiveFeaturesV2 = (reportDest, srcTest, platform) => {
|
|
933
|
-
const featureDestination = path.resolve(process.cwd(), "reports", "features", "strings", srcTest.split(".").slice(0, -1).join(".") + ".features.txt");
|
|
934
|
-
// Read and parse the test report
|
|
935
|
-
const testReportPath = `${reportDest}/tests.json`;
|
|
936
|
-
if (!fs.existsSync(testReportPath)) {
|
|
937
|
-
console.error(`tests.json not found at: ${testReportPath}`);
|
|
938
|
-
return;
|
|
939
|
-
}
|
|
940
|
-
const testReport = JSON.parse(fs.readFileSync(testReportPath, "utf8"));
|
|
941
|
-
// Add full path information to each test
|
|
942
|
-
if (testReport.tests) {
|
|
943
|
-
testReport.tests.forEach((test) => {
|
|
944
|
-
// Add the full path to each test
|
|
945
|
-
test.fullPath = path.resolve(process.cwd(), srcTest);
|
|
946
|
-
});
|
|
947
|
-
}
|
|
948
|
-
// Add full path to the report itself
|
|
949
|
-
testReport.fullPath = path.resolve(process.cwd(), srcTest);
|
|
950
|
-
// Write the modified report back
|
|
951
|
-
fs.writeFileSync(testReportPath, JSON.stringify(testReport, null, 2));
|
|
952
|
-
testReport.features
|
|
953
|
-
.reduce(async (mm, featureStringKey) => {
|
|
954
|
-
const accum = await mm;
|
|
955
|
-
const isUrl = isValidUrl(featureStringKey);
|
|
956
|
-
if (isUrl) {
|
|
957
|
-
const u = new URL(featureStringKey);
|
|
958
|
-
if (u.protocol === "file:") {
|
|
959
|
-
const newPath = `${process.cwd()}/testeranto/features/internal/${path.relative(process.cwd(), u.pathname)}`;
|
|
960
|
-
// await fs.promises.mkdir(path.dirname(newPath), { recursive: true });
|
|
961
|
-
// try {
|
|
962
|
-
// await fs.unlinkSync(newPath);
|
|
963
|
-
// // console.log(`Removed existing link at ${newPath}`);
|
|
964
|
-
// } catch (error) {
|
|
965
|
-
// if (error.code !== "ENOENT") {
|
|
966
|
-
// // throw error;
|
|
967
|
-
// }
|
|
968
|
-
// }
|
|
969
|
-
// fs.symlink(u.pathname, newPath, (err) => {
|
|
970
|
-
// if (err) {
|
|
971
|
-
// // console.error("Error creating symlink:", err);
|
|
972
|
-
// } else {
|
|
973
|
-
// // console.log("Symlink created successfully");
|
|
974
|
-
// }
|
|
975
|
-
// });
|
|
976
|
-
accum.files.push(u.pathname);
|
|
977
|
-
}
|
|
978
|
-
else if (u.protocol === "http:" || u.protocol === "https:") {
|
|
979
|
-
const newPath = `${process.cwd()}/testeranto/features/external/${u.hostname}${u.pathname}`;
|
|
980
|
-
const body = await this.configs.featureIngestor(featureStringKey);
|
|
981
|
-
writeFileAndCreateDir(newPath, body);
|
|
982
|
-
accum.files.push(newPath);
|
|
983
|
-
}
|
|
984
|
-
}
|
|
985
|
-
else {
|
|
986
|
-
await fs.promises.mkdir(path.dirname(featureDestination), {
|
|
987
|
-
recursive: true,
|
|
988
|
-
});
|
|
989
|
-
accum.strings.push(featureStringKey);
|
|
990
|
-
}
|
|
991
|
-
return accum;
|
|
992
|
-
}, Promise.resolve({ files: [], strings: [] }))
|
|
993
|
-
.then(({ files, strings }) => {
|
|
994
|
-
// Markdown files must be referenced in the prompt but string style features are already present in the tests.json file
|
|
995
|
-
fs.writeFileSync(`testeranto/reports/${this.name}/${srcTest
|
|
996
|
-
.split(".")
|
|
997
|
-
.slice(0, -1)
|
|
998
|
-
.join(".")}/${platform}/featurePrompt.txt`, files
|
|
999
|
-
.map((f) => {
|
|
1000
|
-
return `/read ${f}`;
|
|
1001
|
-
})
|
|
1002
|
-
.join("\n"));
|
|
1003
|
-
});
|
|
1004
|
-
// const f: Record<string, string> = {};
|
|
1005
|
-
testReport.givens.forEach((g) => {
|
|
1006
|
-
if (g.failed === true) {
|
|
1007
|
-
this.summary[srcTest].failingFeatures[g.key] = g.features;
|
|
1008
|
-
}
|
|
1009
|
-
});
|
|
1010
|
-
// this.summary[srcTest].failingFeatures = f;
|
|
1011
|
-
this.writeBigBoard();
|
|
1012
|
-
};
|
|
1013
|
-
this.checkForShutdown = () => {
|
|
1014
|
-
// console.log(ansiC.inverse(JSON.stringify(this.summary, null, 2)));
|
|
1015
|
-
this.checkQueue();
|
|
1016
|
-
console.log(ansiC.inverse(`The following jobs are awaiting resources: ${JSON.stringify(this.queue)}`));
|
|
1017
|
-
console.log(ansiC.inverse(`The status of ports: ${JSON.stringify(this.ports)}`));
|
|
1018
|
-
this.writeBigBoard();
|
|
1019
|
-
if (this.mode === "dev")
|
|
1020
|
-
return;
|
|
1021
|
-
let inflight = false;
|
|
1022
|
-
Object.keys(this.summary).forEach((k) => {
|
|
1023
|
-
if (this.summary[k].prompt === "?") {
|
|
1024
|
-
console.log(ansiC.blue(ansiC.inverse(`🕕 prompt ${k}`)));
|
|
1025
|
-
inflight = true;
|
|
1026
|
-
}
|
|
1027
|
-
});
|
|
1028
|
-
Object.keys(this.summary).forEach((k) => {
|
|
1029
|
-
if (this.summary[k].runTimeErrors === "?") {
|
|
1030
|
-
console.log(ansiC.blue(ansiC.inverse(`🕕 runTimeError ${k}`)));
|
|
1031
|
-
inflight = true;
|
|
1032
|
-
}
|
|
1033
|
-
});
|
|
1034
|
-
Object.keys(this.summary).forEach((k) => {
|
|
1035
|
-
if (this.summary[k].staticErrors === "?") {
|
|
1036
|
-
console.log(ansiC.blue(ansiC.inverse(`🕕 staticErrors ${k}`)));
|
|
1037
|
-
inflight = true;
|
|
1038
|
-
}
|
|
1039
|
-
});
|
|
1040
|
-
Object.keys(this.summary).forEach((k) => {
|
|
1041
|
-
if (this.summary[k].typeErrors === "?") {
|
|
1042
|
-
console.log(ansiC.blue(ansiC.inverse(`🕕 typeErrors ${k}`)));
|
|
1043
|
-
inflight = true;
|
|
1044
|
-
}
|
|
1045
|
-
});
|
|
1046
|
-
this.writeBigBoard();
|
|
1047
|
-
if (!inflight) {
|
|
1048
|
-
if (this.browser) {
|
|
1049
|
-
if (this.browser) {
|
|
1050
|
-
this.browser.disconnect().then(() => {
|
|
1051
|
-
console.log(ansiC.inverse(`${this.name} has been tested. Goodbye.`));
|
|
1052
|
-
process.exit();
|
|
1053
|
-
});
|
|
1054
|
-
}
|
|
1055
|
-
}
|
|
1056
|
-
}
|
|
1057
|
-
};
|
|
1058
|
-
this.launchers = {};
|
|
1059
|
-
this.ports = {};
|
|
1060
|
-
this.queue = [];
|
|
1061
|
-
this.nodeSidecars = {};
|
|
1062
|
-
this.webSidecars = {};
|
|
1063
|
-
this.pureSidecars = {};
|
|
1064
|
-
this.configs.ports.forEach((element) => {
|
|
1065
|
-
this.ports[element] = ""; // set ports as open
|
|
1066
|
-
});
|
|
1067
|
-
// Create HTTP server
|
|
1068
|
-
this.httpServer = http.createServer(this.requestHandler.bind(this));
|
|
1069
|
-
// Start WebSocket server attached to the HTTP server
|
|
1070
|
-
this.wss = new WebSocketServer({ server: this.httpServer });
|
|
1071
|
-
this.wss.on("connection", (ws) => {
|
|
1072
|
-
this.clients.add(ws);
|
|
1073
|
-
console.log("Client connected");
|
|
1074
|
-
ws.on("message", (data) => {
|
|
1075
|
-
var _a, _b;
|
|
1076
|
-
try {
|
|
1077
|
-
const message = JSON.parse(data.toString());
|
|
1078
|
-
if (message.type === "executeCommand") {
|
|
1079
|
-
// Validate the command starts with 'aider'
|
|
1080
|
-
if (message.command && message.command.trim().startsWith("aider")) {
|
|
1081
|
-
console.log(`Executing command: ${message.command}`);
|
|
1082
|
-
// Execute the command
|
|
1083
|
-
const processId = Date.now().toString();
|
|
1084
|
-
const child = spawn(message.command, {
|
|
1085
|
-
shell: true,
|
|
1086
|
-
cwd: process.cwd(),
|
|
1087
|
-
});
|
|
1088
|
-
// Track the process in both maps
|
|
1089
|
-
this.runningProcesses.set(processId, child);
|
|
1090
|
-
this.allProcesses.set(processId, {
|
|
1091
|
-
child,
|
|
1092
|
-
status: "running",
|
|
1093
|
-
command: message.command,
|
|
1094
|
-
pid: child.pid,
|
|
1095
|
-
timestamp: new Date().toISOString(),
|
|
1096
|
-
});
|
|
1097
|
-
// Initialize logs for this process
|
|
1098
|
-
this.processLogs.set(processId, []);
|
|
1099
|
-
// Broadcast process started
|
|
1100
|
-
this.broadcast({
|
|
1101
|
-
type: "processStarted",
|
|
1102
|
-
processId,
|
|
1103
|
-
command: message.command,
|
|
1104
|
-
timestamp: new Date().toISOString(),
|
|
1105
|
-
logs: [],
|
|
1106
|
-
});
|
|
1107
|
-
// Capture stdout and stderr
|
|
1108
|
-
(_a = child.stdout) === null || _a === void 0 ? void 0 : _a.on("data", (data) => {
|
|
1109
|
-
const logData = data.toString();
|
|
1110
|
-
// Add to stored logs
|
|
1111
|
-
const logs = this.processLogs.get(processId) || [];
|
|
1112
|
-
logs.push(logData);
|
|
1113
|
-
this.processLogs.set(processId, logs);
|
|
1114
|
-
this.broadcast({
|
|
1115
|
-
type: "processStdout",
|
|
1116
|
-
processId,
|
|
1117
|
-
data: logData,
|
|
1118
|
-
timestamp: new Date().toISOString(),
|
|
1119
|
-
});
|
|
1120
|
-
});
|
|
1121
|
-
(_b = child.stderr) === null || _b === void 0 ? void 0 : _b.on("data", (data) => {
|
|
1122
|
-
const logData = data.toString();
|
|
1123
|
-
// Add to stored logs
|
|
1124
|
-
const logs = this.processLogs.get(processId) || [];
|
|
1125
|
-
logs.push(logData);
|
|
1126
|
-
this.processLogs.set(processId, logs);
|
|
1127
|
-
this.broadcast({
|
|
1128
|
-
type: "processStderr",
|
|
1129
|
-
processId,
|
|
1130
|
-
data: logData,
|
|
1131
|
-
timestamp: new Date().toISOString(),
|
|
1132
|
-
});
|
|
1133
|
-
});
|
|
1134
|
-
child.on("error", (error) => {
|
|
1135
|
-
console.error(`Failed to execute command: ${error}`);
|
|
1136
|
-
this.runningProcesses.delete(processId);
|
|
1137
|
-
// Update the process status to error
|
|
1138
|
-
const processInfo = this.allProcesses.get(processId);
|
|
1139
|
-
if (processInfo) {
|
|
1140
|
-
this.allProcesses.set(processId, Object.assign(Object.assign({}, processInfo), { status: "error", error: error.message }));
|
|
1141
|
-
}
|
|
1142
|
-
this.broadcast({
|
|
1143
|
-
type: "processError",
|
|
1144
|
-
processId,
|
|
1145
|
-
error: error.message,
|
|
1146
|
-
timestamp: new Date().toISOString(),
|
|
1147
|
-
});
|
|
1148
|
-
});
|
|
1149
|
-
child.on("exit", (code) => {
|
|
1150
|
-
console.log(`Command exited with code ${code}`);
|
|
1151
|
-
// Remove from running processes but keep in allProcesses
|
|
1152
|
-
this.runningProcesses.delete(processId);
|
|
1153
|
-
// Update the process status to exited
|
|
1154
|
-
const processInfo = this.allProcesses.get(processId);
|
|
1155
|
-
if (processInfo) {
|
|
1156
|
-
this.allProcesses.set(processId, Object.assign(Object.assign({}, processInfo), { status: "exited", exitCode: code }));
|
|
1157
|
-
}
|
|
1158
|
-
this.broadcast({
|
|
1159
|
-
type: "processExited",
|
|
1160
|
-
processId,
|
|
1161
|
-
exitCode: code,
|
|
1162
|
-
timestamp: new Date().toISOString(),
|
|
1163
|
-
});
|
|
1164
|
-
});
|
|
1165
|
-
}
|
|
1166
|
-
else {
|
|
1167
|
-
console.error('Invalid command: must start with "aider"');
|
|
1168
|
-
}
|
|
1169
|
-
}
|
|
1170
|
-
else if (message.type === "getRunningProcesses") {
|
|
1171
|
-
// Send list of all processes (both running and completed) with their full logs
|
|
1172
|
-
const processes = Array.from(this.allProcesses.entries()).map(([id, procInfo]) => ({
|
|
1173
|
-
processId: id,
|
|
1174
|
-
command: procInfo.command,
|
|
1175
|
-
pid: procInfo.pid,
|
|
1176
|
-
status: procInfo.status,
|
|
1177
|
-
exitCode: procInfo.exitCode,
|
|
1178
|
-
error: procInfo.error,
|
|
1179
|
-
timestamp: procInfo.timestamp,
|
|
1180
|
-
logs: this.processLogs.get(id) || [],
|
|
1181
|
-
}));
|
|
1182
|
-
ws.send(JSON.stringify({
|
|
1183
|
-
type: "runningProcesses",
|
|
1184
|
-
processes,
|
|
1185
|
-
}));
|
|
1186
|
-
}
|
|
1187
|
-
else if (message.type === "getProcess") {
|
|
1188
|
-
// Send specific process with full logs
|
|
1189
|
-
const processId = message.processId;
|
|
1190
|
-
const procInfo = this.allProcesses.get(processId);
|
|
1191
|
-
if (procInfo) {
|
|
1192
|
-
ws.send(JSON.stringify({
|
|
1193
|
-
type: "processData",
|
|
1194
|
-
processId,
|
|
1195
|
-
command: procInfo.command,
|
|
1196
|
-
pid: procInfo.pid,
|
|
1197
|
-
status: procInfo.status,
|
|
1198
|
-
exitCode: procInfo.exitCode,
|
|
1199
|
-
error: procInfo.error,
|
|
1200
|
-
timestamp: procInfo.timestamp,
|
|
1201
|
-
logs: this.processLogs.get(processId) || [],
|
|
1202
|
-
}));
|
|
1203
|
-
}
|
|
1204
|
-
}
|
|
1205
|
-
else if (message.type === "stdin") {
|
|
1206
|
-
// Handle stdin input for a process
|
|
1207
|
-
const processId = message.processId;
|
|
1208
|
-
const data = message.data;
|
|
1209
|
-
console.log("Received stdin for process", processId, ":", data);
|
|
1210
|
-
const childProcess = this.runningProcesses.get(processId);
|
|
1211
|
-
if (childProcess && childProcess.stdin) {
|
|
1212
|
-
console.log("Writing to process stdin");
|
|
1213
|
-
childProcess.stdin.write(data);
|
|
1214
|
-
}
|
|
1215
|
-
else {
|
|
1216
|
-
console.log("Cannot write to stdin - process not found or no stdin:", {
|
|
1217
|
-
processExists: !!childProcess,
|
|
1218
|
-
stdinExists: (childProcess === null || childProcess === void 0 ? void 0 : childProcess.stdin) ? true : false,
|
|
1219
|
-
});
|
|
1220
|
-
}
|
|
1221
|
-
}
|
|
1222
|
-
else if (message.type === "killProcess") {
|
|
1223
|
-
// Handle killing a process
|
|
1224
|
-
const processId = message.processId;
|
|
1225
|
-
console.log("Received killProcess for process", processId);
|
|
1226
|
-
const childProcess = this.runningProcesses.get(processId);
|
|
1227
|
-
if (childProcess) {
|
|
1228
|
-
console.log("Killing process");
|
|
1229
|
-
childProcess.kill("SIGTERM");
|
|
1230
|
-
// The process exit handler will update the status and broadcast the change
|
|
1231
|
-
}
|
|
1232
|
-
else {
|
|
1233
|
-
console.log("Cannot kill process - process not found:", {
|
|
1234
|
-
processExists: !!childProcess,
|
|
1235
|
-
});
|
|
1236
|
-
}
|
|
1237
|
-
}
|
|
1238
|
-
}
|
|
1239
|
-
catch (error) {
|
|
1240
|
-
console.error("Error handling WebSocket message:", error);
|
|
1241
|
-
}
|
|
1242
|
-
});
|
|
1243
|
-
ws.on("close", () => {
|
|
1244
|
-
this.clients.delete(ws);
|
|
1245
|
-
console.log("Client disconnected");
|
|
1246
|
-
});
|
|
1247
|
-
ws.on("error", (error) => {
|
|
1248
|
-
console.error("WebSocket error:", error);
|
|
1249
|
-
this.clients.delete(ws);
|
|
1250
|
-
});
|
|
1251
|
-
});
|
|
1252
|
-
// Start HTTP server
|
|
1253
|
-
const httpPort = Number(process.env.HTTP_PORT) || 3000;
|
|
1254
|
-
this.httpServer.listen(httpPort, () => {
|
|
1255
|
-
console.log(`HTTP server running on http://localhost:${httpPort}`);
|
|
1256
|
-
});
|
|
1257
|
-
}
|
|
1258
|
-
async stopSideCar(uid) {
|
|
1259
|
-
console.log(ansiC.green(ansiC.inverse(`stopSideCar ${uid}`)));
|
|
1260
|
-
Object.entries(this.pureSidecars).forEach(async ([k, v]) => {
|
|
1261
|
-
if (Number(k) === uid) {
|
|
1262
|
-
await this.pureSidecars[Number(k)].stop();
|
|
1263
|
-
delete this.pureSidecars[Number(k)];
|
|
1264
|
-
}
|
|
1265
|
-
});
|
|
1266
|
-
Object.entries(this.nodeSidecars).forEach(async ([k, v]) => {
|
|
1267
|
-
if (Number(k) === uid) {
|
|
1268
|
-
await this.nodeSidecars[Number(k)].send("stop");
|
|
1269
|
-
delete this.nodeSidecars[Number(k)];
|
|
1270
|
-
}
|
|
1271
|
-
});
|
|
1272
|
-
Object.entries(this.webSidecars).forEach(async ([k, v]) => {
|
|
1273
|
-
if (Number(k) === uid) {
|
|
1274
|
-
(await this.browser.pages()).forEach(async (p) => {
|
|
1275
|
-
if (p.mainFrame()._id === k) {
|
|
1276
|
-
await this.webSidecars[Number(k)].close();
|
|
1277
|
-
delete this.webSidecars[Number(k)];
|
|
1278
|
-
}
|
|
1279
|
-
});
|
|
1280
|
-
}
|
|
1281
|
-
});
|
|
1282
|
-
return;
|
|
1283
|
-
}
|
|
1284
|
-
async launchSideCar(n, name) {
|
|
1285
|
-
const c = this.configs.tests.find(([v, r]) => {
|
|
1286
|
-
return v === name;
|
|
1287
|
-
});
|
|
1288
|
-
const s = c[3][n];
|
|
1289
|
-
const r = s[1];
|
|
1290
|
-
if (r === "node") {
|
|
1291
|
-
return this.launchNodeSideCar(s);
|
|
1292
|
-
}
|
|
1293
|
-
else if (r === "web") {
|
|
1294
|
-
return this.launchWebSideCar(s);
|
|
1295
|
-
}
|
|
1296
|
-
else if (r === "pure") {
|
|
1297
|
-
return this.launchPureSideCar(s);
|
|
1298
|
-
}
|
|
1299
|
-
else {
|
|
1300
|
-
throw `unknown runtime ${r}`;
|
|
1301
|
-
}
|
|
1302
|
-
}
|
|
1303
|
-
mapping() {
|
|
1304
|
-
return [
|
|
1305
|
-
["$", this.$],
|
|
1306
|
-
["click", this.click],
|
|
1307
|
-
["closePage", this.closePage],
|
|
1308
|
-
["createWriteStream", this.createWriteStream],
|
|
1309
|
-
["customclose", this.customclose],
|
|
1310
|
-
["customScreenShot", this.customScreenShot.bind(this)],
|
|
1311
|
-
["end", this.end],
|
|
1312
|
-
["existsSync", this.existsSync],
|
|
1313
|
-
["focusOn", this.focusOn],
|
|
1314
|
-
["getAttribute", this.getAttribute],
|
|
1315
|
-
["getInnerHtml", this.getInnerHtml],
|
|
1316
|
-
// ["setValue", this.setValue],
|
|
1317
|
-
["goto", this.goto.bind(this)],
|
|
1318
|
-
["isDisabled", this.isDisabled],
|
|
1319
|
-
["launchSideCar", this.launchSideCar.bind(this)],
|
|
1320
|
-
["mkdirSync", this.mkdirSync],
|
|
1321
|
-
["newPage", this.newPage],
|
|
1322
|
-
["page", this.page],
|
|
1323
|
-
["pages", this.pages],
|
|
1324
|
-
["screencast", this.screencast],
|
|
1325
|
-
["screencastStop", this.screencastStop],
|
|
1326
|
-
["stopSideCar", this.stopSideCar.bind(this)],
|
|
1327
|
-
["typeInto", this.typeInto],
|
|
1328
|
-
["waitForSelector", this.waitForSelector],
|
|
1329
|
-
["write", this.write],
|
|
1330
|
-
["writeFileSync", this.writeFileSync],
|
|
1331
|
-
];
|
|
1332
|
-
}
|
|
1333
|
-
async start() {
|
|
1334
|
-
// set up the "pure" listeners
|
|
1335
|
-
this.mapping().forEach(async ([command, func]) => {
|
|
1336
|
-
globalThis[command] = func;
|
|
1337
|
-
});
|
|
1338
|
-
if (!fs.existsSync(`testeranto/reports/${this.name}`)) {
|
|
1339
|
-
fs.mkdirSync(`testeranto/reports/${this.name}`);
|
|
1340
|
-
}
|
|
1341
|
-
const executablePath = "/opt/homebrew/bin/chromium";
|
|
1342
|
-
try {
|
|
1343
|
-
this.browser = await puppeteer.launch({
|
|
1344
|
-
slowMo: 1,
|
|
1345
|
-
waitForInitialPage: false,
|
|
1346
|
-
executablePath,
|
|
1347
|
-
headless: true,
|
|
1348
|
-
defaultViewport: null, // Disable default 800x600 viewport
|
|
1349
|
-
dumpio: false,
|
|
1350
|
-
devtools: false,
|
|
1351
|
-
args: [
|
|
1352
|
-
"--allow-file-access-from-files",
|
|
1353
|
-
"--allow-insecure-localhost",
|
|
1354
|
-
"--allow-running-insecure-content",
|
|
1355
|
-
"--auto-open-devtools-for-tabs",
|
|
1356
|
-
"--disable-dev-shm-usage",
|
|
1357
|
-
"--disable-extensions",
|
|
1358
|
-
"--disable-features=site-per-process",
|
|
1359
|
-
"--disable-gpu",
|
|
1360
|
-
"--disable-setuid-sandbox",
|
|
1361
|
-
"--disable-site-isolation-trials",
|
|
1362
|
-
"--disable-web-security",
|
|
1363
|
-
"--no-first-run",
|
|
1364
|
-
"--no-sandbox",
|
|
1365
|
-
"--no-startup-window",
|
|
1366
|
-
"--reduce-security-for-testing",
|
|
1367
|
-
"--remote-allow-origins=*",
|
|
1368
|
-
"--start-maximized",
|
|
1369
|
-
"--unsafely-treat-insecure-origin-as-secure=*",
|
|
1370
|
-
`--remote-debugging-port=3234`,
|
|
1371
|
-
// "--disable-features=IsolateOrigins,site-per-process",
|
|
1372
|
-
// "--disable-features=IsolateOrigins",
|
|
1373
|
-
// "--disk-cache-dir=/dev/null",
|
|
1374
|
-
// "--disk-cache-size=1",
|
|
1375
|
-
// "--no-zygote",
|
|
1376
|
-
// "--remote-allow-origins=ws://localhost:3234",
|
|
1377
|
-
// "--single-process",
|
|
1378
|
-
// "--start-maximized",
|
|
1379
|
-
// "--unsafely-treat-insecure-origin-as-secure",
|
|
1380
|
-
// "--unsafely-treat-insecure-origin-as-secure=ws://192.168.0.101:3234",
|
|
1381
|
-
],
|
|
1382
|
-
});
|
|
1383
|
-
}
|
|
1384
|
-
catch (e) {
|
|
1385
|
-
console.error(e);
|
|
1386
|
-
console.error("could not start chrome via puppeter. Check this path: ", executablePath);
|
|
1387
|
-
}
|
|
1388
|
-
const { nodeEntryPoints, webEntryPoints, pureEntryPoints, pitonoEntryPoints } = this.getRunnables(this.configs.tests, this.name);
|
|
1389
|
-
[
|
|
1390
|
-
[
|
|
1391
|
-
nodeEntryPoints,
|
|
1392
|
-
this.launchNode,
|
|
1393
|
-
"node",
|
|
1394
|
-
(w) => {
|
|
1395
|
-
this.nodeMetafileWatcher = w;
|
|
1396
|
-
},
|
|
1397
|
-
],
|
|
1398
|
-
[
|
|
1399
|
-
webEntryPoints,
|
|
1400
|
-
this.launchWeb,
|
|
1401
|
-
"web",
|
|
1402
|
-
(w) => {
|
|
1403
|
-
this.webMetafileWatcher = w;
|
|
1404
|
-
},
|
|
1405
|
-
],
|
|
1406
|
-
[
|
|
1407
|
-
pureEntryPoints,
|
|
1408
|
-
this.launchPure,
|
|
1409
|
-
"pure",
|
|
1410
|
-
(w) => {
|
|
1411
|
-
this.importMetafileWatcher = w;
|
|
1412
|
-
},
|
|
1413
|
-
],
|
|
1414
|
-
[
|
|
1415
|
-
pitonoEntryPoints,
|
|
1416
|
-
this.launchPitono,
|
|
1417
|
-
"pitono",
|
|
1418
|
-
(w) => {
|
|
1419
|
-
this.pitonoMetafileWatcher = w;
|
|
1420
|
-
},
|
|
1421
|
-
],
|
|
1422
|
-
].forEach(async ([eps, launcher, runtime, watcher]) => {
|
|
1423
|
-
let metafile;
|
|
1424
|
-
if (runtime === "pitono") {
|
|
1425
|
-
metafile = `./testeranto/metafiles/python/core.json`;
|
|
1426
|
-
// Ensure the directory exists before trying to watch
|
|
1427
|
-
const metafileDir = path.dirname(metafile);
|
|
1428
|
-
if (!fs.existsSync(metafileDir)) {
|
|
1429
|
-
fs.mkdirSync(metafileDir, { recursive: true });
|
|
1430
|
-
}
|
|
1431
|
-
}
|
|
1432
|
-
else {
|
|
1433
|
-
metafile = `./testeranto/metafiles/${runtime}/${this.name}.json`;
|
|
1434
|
-
}
|
|
1435
|
-
// Only poll for file if it's not a pitono runtime
|
|
1436
|
-
if (runtime !== "pitono") {
|
|
1437
|
-
await pollForFile(metafile);
|
|
1438
|
-
}
|
|
1439
|
-
Object.entries(eps).forEach(async ([inputFile, outputFile]) => {
|
|
1440
|
-
// await pollForFile(outputFile);\
|
|
1441
|
-
this.launchers[inputFile] = () => launcher(inputFile, outputFile);
|
|
1442
|
-
this.launchers[inputFile]();
|
|
1443
|
-
try {
|
|
1444
|
-
watch(outputFile, async (e, filename) => {
|
|
1445
|
-
const hash = await fileHash(outputFile);
|
|
1446
|
-
if (fileHashes[inputFile] !== hash) {
|
|
1447
|
-
fileHashes[inputFile] = hash;
|
|
1448
|
-
console.log(ansiC.yellow(ansiC.inverse(`< ${e} ${filename}`)));
|
|
1449
|
-
// launcher(inputFile, outputFile);
|
|
1450
|
-
this.launchers[inputFile]();
|
|
1451
|
-
}
|
|
1452
|
-
});
|
|
1453
|
-
}
|
|
1454
|
-
catch (e) {
|
|
1455
|
-
console.error(e);
|
|
1456
|
-
}
|
|
1457
|
-
});
|
|
1458
|
-
this.metafileOutputs(runtime);
|
|
1459
|
-
// For pitono, we need to wait for the file to be created
|
|
1460
|
-
if (runtime === "pitono") {
|
|
1461
|
-
// Use polling to wait for the file to exist
|
|
1462
|
-
const checkFileExists = () => {
|
|
1463
|
-
if (fs.existsSync(metafile)) {
|
|
1464
|
-
console.log(ansiC.green(ansiC.inverse(`Pitono metafile found: ${metafile}`)));
|
|
1465
|
-
// Set up the watcher once the file exists
|
|
1466
|
-
watcher(watch(metafile, async (e, filename) => {
|
|
1467
|
-
console.log(ansiC.yellow(ansiC.inverse(`< ${e} ${filename} (${runtime})`)));
|
|
1468
|
-
this.metafileOutputs(runtime);
|
|
1469
|
-
}));
|
|
1470
|
-
// Read the metafile immediately
|
|
1471
|
-
this.metafileOutputs(runtime);
|
|
1472
|
-
}
|
|
1473
|
-
else {
|
|
1474
|
-
// Check again after a delay
|
|
1475
|
-
setTimeout(checkFileExists, 1000);
|
|
1476
|
-
}
|
|
1477
|
-
};
|
|
1478
|
-
// Start checking for the file
|
|
1479
|
-
checkFileExists();
|
|
1480
|
-
}
|
|
1481
|
-
else {
|
|
1482
|
-
// For other runtimes, only set up watcher if the file exists
|
|
1483
|
-
if (fs.existsSync(metafile)) {
|
|
1484
|
-
watcher(watch(metafile, async (e, filename) => {
|
|
1485
|
-
console.log(ansiC.yellow(ansiC.inverse(`< ${e} ${filename} (${runtime})`)));
|
|
1486
|
-
this.metafileOutputs(runtime);
|
|
1487
|
-
}));
|
|
1488
|
-
}
|
|
1489
|
-
}
|
|
1490
|
-
});
|
|
1491
|
-
// Object.keys(this.configs.externalTests).forEach((et) => {
|
|
1492
|
-
// this.launchExternalTest(et, this.configs.externalTests[et]);
|
|
1493
|
-
// });
|
|
1494
|
-
}
|
|
1495
|
-
// async launchExternalTest(
|
|
1496
|
-
// externalTestName: string,
|
|
1497
|
-
// externalTest: {
|
|
1498
|
-
// watch: string[];
|
|
1499
|
-
// exec: string;
|
|
1500
|
-
// }
|
|
1501
|
-
// ) {
|
|
1502
|
-
// // fs.mkdirSync(`testeranto/externalTests/${externalTestName}`);
|
|
1503
|
-
// // exec(externalTest.exec, (error, stdout, stderr) => {
|
|
1504
|
-
// // if (error) {
|
|
1505
|
-
// // fs.writeFileSync(
|
|
1506
|
-
// // `testeranto/externalTests/${externalTestName}/exitcode.txt`,
|
|
1507
|
-
// // `${error.name}\n${error.message}\n${error.code}\n`
|
|
1508
|
-
// // );
|
|
1509
|
-
// // } else {
|
|
1510
|
-
// // fs.writeFileSync(
|
|
1511
|
-
// // `testeranto/externalTests/${externalTestName}/exitcode.txt`,
|
|
1512
|
-
// // `0`
|
|
1513
|
-
// // );
|
|
1514
|
-
// // }
|
|
1515
|
-
// // fs.writeFileSync(
|
|
1516
|
-
// // `testeranto/externalTests/${externalTestName}/stdout.txt`,
|
|
1517
|
-
// // stdout
|
|
1518
|
-
// // );
|
|
1519
|
-
// // fs.writeFileSync(
|
|
1520
|
-
// // `testeranto/externalTests/${externalTestName}/stderr.txt`,
|
|
1521
|
-
// // stderr
|
|
1522
|
-
// // );
|
|
1523
|
-
// // });
|
|
1524
|
-
// }
|
|
1525
|
-
async stop() {
|
|
1526
|
-
console.log(ansiC.inverse("Testeranto-Run is shutting down gracefully..."));
|
|
1527
|
-
this.mode = "once";
|
|
1528
|
-
this.nodeMetafileWatcher.close();
|
|
1529
|
-
this.webMetafileWatcher.close();
|
|
1530
|
-
this.importMetafileWatcher.close();
|
|
1531
|
-
if (this.pitonoMetafileWatcher) {
|
|
1532
|
-
this.pitonoMetafileWatcher.close();
|
|
1533
|
-
}
|
|
1534
|
-
// Close any remaining log streams
|
|
1535
|
-
Object.values(this.logStreams || {}).forEach((logs) => logs.closeAll());
|
|
1536
|
-
// Close WebSocket server
|
|
1537
|
-
this.wss.close(() => {
|
|
1538
|
-
console.log("WebSocket server closed");
|
|
1539
|
-
});
|
|
1540
|
-
// Close all client connections
|
|
1541
|
-
this.clients.forEach((client) => {
|
|
1542
|
-
client.terminate();
|
|
1543
|
-
});
|
|
1544
|
-
this.clients.clear();
|
|
1545
|
-
// Close HTTP server
|
|
1546
|
-
this.httpServer.close(() => {
|
|
1547
|
-
console.log("HTTP server closed");
|
|
1548
|
-
});
|
|
1549
|
-
this.checkForShutdown();
|
|
1550
|
-
}
|
|
1551
|
-
async metafileOutputs(platform) {
|
|
1552
|
-
let metafilePath;
|
|
1553
|
-
if (platform === "pitono") {
|
|
1554
|
-
metafilePath = `./testeranto/metafiles/python/core.json`;
|
|
1555
|
-
}
|
|
1556
|
-
else {
|
|
1557
|
-
metafilePath = `./testeranto/metafiles/${platform}/${this.name}.json`;
|
|
1558
|
-
}
|
|
1559
|
-
// Check if the file exists
|
|
1560
|
-
if (!fs.existsSync(metafilePath)) {
|
|
1561
|
-
if (platform === "pitono") {
|
|
1562
|
-
console.log(ansiC.yellow(ansiC.inverse(`Pitono metafile not found yet: ${metafilePath}`)));
|
|
1563
|
-
}
|
|
1564
|
-
return;
|
|
1565
|
-
}
|
|
1566
|
-
let metafile;
|
|
1567
|
-
try {
|
|
1568
|
-
const fileContent = fs.readFileSync(metafilePath).toString();
|
|
1569
|
-
const parsedData = JSON.parse(fileContent);
|
|
1570
|
-
// Handle different metafile structures
|
|
1571
|
-
if (platform === "pitono") {
|
|
1572
|
-
// Pitono metafile might be the entire content or have a different structure
|
|
1573
|
-
metafile = parsedData.metafile || parsedData;
|
|
1574
|
-
}
|
|
1575
|
-
else {
|
|
1576
|
-
metafile = parsedData.metafile;
|
|
1577
|
-
}
|
|
1578
|
-
if (!metafile) {
|
|
1579
|
-
console.log(ansiC.yellow(ansiC.inverse(`No metafile found in ${metafilePath}`)));
|
|
1580
|
-
return;
|
|
1581
|
-
}
|
|
1582
|
-
}
|
|
1583
|
-
catch (error) {
|
|
1584
|
-
console.error(`Error reading metafile at ${metafilePath}:`, error);
|
|
1585
|
-
return;
|
|
1586
|
-
}
|
|
1587
|
-
const outputs = metafile.outputs;
|
|
1588
|
-
Object.keys(outputs).forEach(async (k) => {
|
|
1589
|
-
const pattern = `testeranto/bundles/${platform}/${this.name}/${this.configs.src}`;
|
|
1590
|
-
if (!k.startsWith(pattern)) {
|
|
1591
|
-
return false;
|
|
1592
|
-
}
|
|
1593
|
-
const addableFiles = Object.keys(outputs[k].inputs).filter((i) => {
|
|
1594
|
-
if (!fs.existsSync(i))
|
|
1595
|
-
return false;
|
|
1596
|
-
if (i.startsWith("node_modules"))
|
|
1597
|
-
return false;
|
|
1598
|
-
if (i.startsWith("./node_modules"))
|
|
1599
|
-
return false;
|
|
1600
|
-
return true;
|
|
1601
|
-
});
|
|
1602
|
-
const f = `${k.split(".").slice(0, -1).join(".")}/`;
|
|
1603
|
-
if (!fs.existsSync(f)) {
|
|
1604
|
-
fs.mkdirSync(f);
|
|
1605
|
-
}
|
|
1606
|
-
const entrypoint = outputs[k].entryPoint;
|
|
1607
|
-
if (entrypoint) {
|
|
1608
|
-
const changeDigest = await filesHash(addableFiles);
|
|
1609
|
-
if (changeDigest === changes[entrypoint]) {
|
|
1610
|
-
// skip
|
|
1611
|
-
}
|
|
1612
|
-
else {
|
|
1613
|
-
changes[entrypoint] = changeDigest;
|
|
1614
|
-
this.tscCheck({
|
|
1615
|
-
platform,
|
|
1616
|
-
addableFiles,
|
|
1617
|
-
entrypoint: entrypoint,
|
|
1618
|
-
});
|
|
1619
|
-
this.eslintCheck(entrypoint, platform, addableFiles);
|
|
1620
|
-
this.makePrompt(entrypoint, addableFiles, platform);
|
|
1621
|
-
}
|
|
1622
|
-
}
|
|
1623
|
-
});
|
|
1624
|
-
}
|
|
1625
|
-
requestHandler(req, res) {
|
|
1626
|
-
// Parse the URL
|
|
1627
|
-
const parsedUrl = url.parse(req.url || "/");
|
|
1628
|
-
let pathname = parsedUrl.pathname || "/";
|
|
1629
|
-
// Handle root path
|
|
1630
|
-
if (pathname === "/") {
|
|
1631
|
-
pathname = "/index.html";
|
|
1632
|
-
}
|
|
1633
|
-
// Remove leading slash
|
|
1634
|
-
let filePath = pathname.substring(1);
|
|
1635
|
-
// Determine which directory to serve from
|
|
1636
|
-
if (filePath.startsWith("reports/")) {
|
|
1637
|
-
// Serve from reports directory
|
|
1638
|
-
filePath = `testeranto/${filePath}`;
|
|
1639
|
-
}
|
|
1640
|
-
else if (filePath.startsWith("metafiles/")) {
|
|
1641
|
-
// Serve from metafiles directory
|
|
1642
|
-
filePath = `testeranto/${filePath}`;
|
|
1643
|
-
}
|
|
1644
|
-
else if (filePath === "projects.json") {
|
|
1645
|
-
// Serve projects.json
|
|
1646
|
-
filePath = `testeranto/${filePath}`;
|
|
1647
|
-
}
|
|
1648
|
-
else {
|
|
1649
|
-
// For frontend assets, try multiple possible locations
|
|
1650
|
-
// First, try the dist directory
|
|
1651
|
-
const possiblePaths = [
|
|
1652
|
-
`dist/${filePath}`,
|
|
1653
|
-
`testeranto/dist/${filePath}`,
|
|
1654
|
-
`../dist/${filePath}`,
|
|
1655
|
-
`./${filePath}`,
|
|
1656
|
-
];
|
|
1657
|
-
// Find the first existing file
|
|
1658
|
-
let foundPath = null;
|
|
1659
|
-
for (const possiblePath of possiblePaths) {
|
|
1660
|
-
if (fs.existsSync(possiblePath)) {
|
|
1661
|
-
foundPath = possiblePath;
|
|
1662
|
-
break;
|
|
1663
|
-
}
|
|
1664
|
-
}
|
|
1665
|
-
if (foundPath) {
|
|
1666
|
-
filePath = foundPath;
|
|
1667
|
-
}
|
|
1668
|
-
else {
|
|
1669
|
-
// If no file found, serve index.html for SPA routing
|
|
1670
|
-
const indexPath = this.findIndexHtml();
|
|
1671
|
-
if (indexPath) {
|
|
1672
|
-
fs.readFile(indexPath, (err, data) => {
|
|
1673
|
-
if (err) {
|
|
1674
|
-
res.writeHead(404, { "Content-Type": "text/plain" });
|
|
1675
|
-
res.end("404 Not Found");
|
|
1676
|
-
return;
|
|
1677
|
-
}
|
|
1678
|
-
res.writeHead(200, { "Content-Type": "text/html" });
|
|
1679
|
-
res.end(data);
|
|
1680
|
-
});
|
|
1681
|
-
return;
|
|
1682
|
-
}
|
|
1683
|
-
else {
|
|
1684
|
-
res.writeHead(404, { "Content-Type": "text/plain" });
|
|
1685
|
-
res.end("404 Not Found");
|
|
1686
|
-
return;
|
|
1687
|
-
}
|
|
1688
|
-
}
|
|
1689
|
-
}
|
|
1690
|
-
// Check if file exists
|
|
1691
|
-
fs.exists(filePath, (exists) => {
|
|
1692
|
-
if (!exists) {
|
|
1693
|
-
// For SPA routing, serve index.html if the path looks like a route
|
|
1694
|
-
if (!pathname.includes(".") && pathname !== "/") {
|
|
1695
|
-
const indexPath = this.findIndexHtml();
|
|
1696
|
-
if (indexPath) {
|
|
1697
|
-
fs.readFile(indexPath, (err, data) => {
|
|
1698
|
-
if (err) {
|
|
1699
|
-
res.writeHead(404, { "Content-Type": "text/plain" });
|
|
1700
|
-
res.end("404 Not Found");
|
|
1701
|
-
return;
|
|
1702
|
-
}
|
|
1703
|
-
res.writeHead(200, { "Content-Type": "text/html" });
|
|
1704
|
-
res.end(data);
|
|
1705
|
-
});
|
|
1706
|
-
return;
|
|
1707
|
-
}
|
|
1708
|
-
else {
|
|
1709
|
-
// Serve a simple message if index.html is not found
|
|
1710
|
-
res.writeHead(200, { "Content-Type": "text/html" });
|
|
1711
|
-
res.end(`
|
|
1712
|
-
<html>
|
|
1713
|
-
<body>
|
|
1714
|
-
<h1>Testeranto is running</h1>
|
|
1715
|
-
<p>Frontend files are not built yet. Run 'npm run build' to build the frontend.</p>
|
|
1716
|
-
</body>
|
|
1717
|
-
</html>
|
|
1718
|
-
`);
|
|
1719
|
-
return;
|
|
1720
|
-
}
|
|
1721
|
-
}
|
|
1722
|
-
res.writeHead(404, { "Content-Type": "text/plain" });
|
|
1723
|
-
res.end("404 Not Found");
|
|
1724
|
-
return;
|
|
1725
|
-
}
|
|
1726
|
-
// Read and serve the file
|
|
1727
|
-
fs.readFile(filePath, (err, data) => {
|
|
1728
|
-
if (err) {
|
|
1729
|
-
res.writeHead(500, { "Content-Type": "text/plain" });
|
|
1730
|
-
res.end("500 Internal Server Error");
|
|
1731
|
-
return;
|
|
1732
|
-
}
|
|
1733
|
-
// Get MIME type
|
|
1734
|
-
const mimeType = mime.lookup(filePath) || "application/octet-stream";
|
|
1735
|
-
res.writeHead(200, { "Content-Type": mimeType });
|
|
1736
|
-
res.end(data);
|
|
1737
|
-
});
|
|
1738
|
-
});
|
|
1739
|
-
}
|
|
1740
|
-
findIndexHtml() {
|
|
1741
|
-
const possiblePaths = [
|
|
1742
|
-
"dist/index.html",
|
|
1743
|
-
"testeranto/dist/index.html",
|
|
1744
|
-
"../dist/index.html",
|
|
1745
|
-
"./index.html",
|
|
1746
|
-
];
|
|
1747
|
-
for (const path of possiblePaths) {
|
|
1748
|
-
if (fs.existsSync(path)) {
|
|
1749
|
-
return path;
|
|
1750
|
-
}
|
|
1751
|
-
}
|
|
1752
|
-
return null;
|
|
1753
|
-
}
|
|
1754
|
-
broadcast(message) {
|
|
1755
|
-
const data = typeof message === "string" ? message : JSON.stringify(message);
|
|
1756
|
-
this.clients.forEach((client) => {
|
|
1757
|
-
if (client.readyState === 1) {
|
|
1758
|
-
// WebSocket.OPEN
|
|
1759
|
-
client.send(data);
|
|
1760
|
-
}
|
|
1761
|
-
});
|
|
1762
|
-
}
|
|
1763
|
-
checkQueue() {
|
|
1764
|
-
const x = this.queue.pop();
|
|
1765
|
-
if (!x) {
|
|
1766
|
-
ansiC.inverse(`The following queue is empty`);
|
|
1767
|
-
return;
|
|
1768
|
-
}
|
|
1769
|
-
const test = this.configs.tests.find((t) => t[0] === x);
|
|
1770
|
-
if (!test)
|
|
1771
|
-
throw `test is undefined ${x}`;
|
|
1772
|
-
// const [src, runtime, ...xx]: [string, IRunTime, ...any] = test;
|
|
1773
|
-
this.launchers[test[0]]();
|
|
1774
|
-
}
|
|
1775
|
-
}
|