mirror of
https://github.com/abap2UI5/abap2UI5.git
synced 2025-04-29 15:26:16 +08:00
update uni ttest action
This commit is contained in:
parent
d462241490
commit
d864639213
2
.github/workflows/test_unit.yaml
vendored
2
.github/workflows/test_unit.yaml
vendored
|
@ -15,6 +15,6 @@ jobs:
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: '16'
|
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 build
|
||||||
- run: npm run unit
|
- run: npm run unit
|
||||||
|
|
26
ci/abap_transpile.json
Normal file
26
ci/abap_transpile.json
Normal 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"}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
36
ci/abaplint-downport-samples.jsonc
Normal file
36
ci/abaplint-downport-samples.jsonc
Normal 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
|
||||||
|
}
|
||||||
|
}
|
31
ci/abaplint-downport.jsonc
Normal file
31
ci/abaplint-downport.jsonc
Normal 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
8
ci/setup.mjs
Normal 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);
|
||||||
|
}
|
|
@ -10,7 +10,12 @@
|
||||||
"auto_abaplint": "npx abaplint .github/abaplint/auto_abaplint_fix.jsonc --fix",
|
"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 ",
|
"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",
|
"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": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|
20
srv/express.mjs
Normal file
20
srv/express.mjs
Normal 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
19
srv/zcl_sicf.clas.abap
Normal 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.
|
Loading…
Reference in New Issue
Block a user