update uni ttest action

This commit is contained in:
oblomov-dev 2025-02-19 20:54:55 +00:00 committed by GitHub
parent d462241490
commit d864639213
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 5128 additions and 4983 deletions

View File

@ -15,6 +15,6 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: '16'
- run: git clone https://github.com/abap2UI5/abap2UI5-setup.git && cp -r abap2UI5-setup/* . && npm i
- run: npm ci
- run: npm run build
- run: npm run unit

26
ci/abap_transpile.json Normal file
View File

@ -0,0 +1,26 @@
{
"input_folder": "downport",
"output_folder": "output",
"libs": [
{
"url": "https://github.com/open-abap/open-abap-core"
},
{
"url": "https://github.com/open-abap/express-icf-shim"
}
],
"write_unit_tests": true,
"write_source_map": true,
"options": {
"ignoreSyntaxCheck": false,
"addFilenames": true,
"addCommonJS": true,
"extraSetup": "../ci/setup.mjs",
"unknownTypes": "runtimeError",
"skipReposrc": true,
"keywords": ["return", "in", "class", "for", "delete", "var"],
"skip": [
{"object": "Z2UI5_CL_AJSON", "class": "ltcl_parser_test", "method": "parse_error", "note": "NodeJS 20 does not set position of parsing error"}
]
}
}

View File

@ -0,0 +1,36 @@
{
"global": {
"files": "/../downport/**/*.*"
},
"dependencies": [
{
"url": "https://github.com/abapedia/steampunk-2305-api",
"folder": "/deps",
"files": "/src/**/*.*"
},
{
"url": "https://github.com/abap2UI5/abap2UI5-downport",
"folder": "/abap2UI5",
"files": "/src/**/*.*"
}
],
"syntax": {
"version": "v702",
"errorNamespace": "."
},
"rules": {
"downport": true,
"begin_end_names": true,
"check_ddic": true,
"check_include": true,
"check_syntax": true,
"global_class": true,
"definitions_top": true,
"implement_methods": true,
"method_implemented_twice": true,
"parser_error": true,
"superclass_final": true,
"unknown_types": true,
"xml_consistency": true
}
}

View File

@ -0,0 +1,31 @@
{
"global": {
"files": "/../downport/**/*.*"
},
"dependencies": [
{
"url": "https://github.com/open-abap/open-abap-core",
"folder": "/deps",
"files": "/src/**/*.*"
}
],
"syntax": {
"version": "v702",
"errorNamespace": "."
},
"rules": {
"downport": true,
"begin_end_names": true,
"check_ddic": true,
"check_include": true,
"check_syntax": true,
"global_class": true,
"definitions_top": true,
"implement_methods": true,
"method_implemented_twice": true,
"parser_error": true,
"superclass_final": true,
"unknown_types": true,
"xml_consistency": true
}
}

8
ci/setup.mjs Normal file
View File

@ -0,0 +1,8 @@
import {SQLiteDatabaseClient} from "@abaplint/database-sqlite";
export async function setup(abap, schemas, insert) {
abap.context.databaseConnections["DEFAULT"] = new SQLiteDatabaseClient();
await abap.context.databaseConnections["DEFAULT"].connect();
await abap.context.databaseConnections["DEFAULT"].execute(schemas.sqlite);
await abap.context.databaseConnections["DEFAULT"].execute(insert);
}

9962
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -10,7 +10,12 @@
"auto_abaplint": "npx abaplint .github/abaplint/auto_abaplint_fix.jsonc --fix",
"auto_transpile": "cp node/srv/*.abap src && mkdir -p node/src && abap_transpile .github/abaplint/auto_transpile.jsonc ",
"rename": "npm ci && abaplint .github/abaplint/rename_test.jsonc --rename",
"express": "node node/srv/express.mjs"
"express": "node node/srv/express.mjs",
"unit": "echo RUNNING && node output/index.mjs",
"downport": "rm -rf downport && cp -r src downport && abaplint --fix ./ci/abaplint-downport.jsonc && npm run syfixes",
"transpile": "rm -rf output && cp srv/*.abap downport && abap_transpile ./ci/abap_transpile.json",
"build" : "npm ci && npm run downport && npm run transpile && rm -rf src"
},
"repository": {
"type": "git",

20
srv/express.mjs Normal file
View File

@ -0,0 +1,20 @@
import express from 'express';
import {initializeABAP} from "../output/init.mjs";
import {cl_express_icf_shim} from "../output/cl_express_icf_shim.clas.mjs";
await initializeABAP();
const PORT = 3000;
const app = express();
app.disable('x-powered-by');
app.set('etag', false);
app.use(express.raw({type: "*/*"}));
// ------------------
app.all(["/", "/*"], async function (req, res) {
await cl_express_icf_shim.run({req, res, class: "ZCL_SICF"});
});
app.listen(PORT);
console.log("Listening on port http://localhost:" + PORT);

19
srv/zcl_sicf.clas.abap Normal file
View File

@ -0,0 +1,19 @@
CLASS zcl_sicf DEFINITION PUBLIC FINAL CREATE PUBLIC.
PUBLIC SECTION.
INTERFACES if_http_extension.
PROTECTED SECTION.
ENDCLASS.
CLASS zcl_sicf IMPLEMENTATION.
METHOD if_http_extension~handle_request.
data lo_server type ref to z2ui5_cl_http_handler.
lo_server = z2ui5_cl_http_handler=>factory( server ).
lo_server->main( ).
ENDMETHOD.
ENDCLASS.