diff --git a/.gitignore b/.gitignore index 17877614..f5e462e5 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,5 @@ resources/oe/oeSocket.pro docker/.builder/** .scannerwork connectionPF.pf +resources/oe/results.xml +target/** diff --git a/build.xml b/build.xml index e5fee50f..379b0c41 100644 --- a/build.xml +++ b/build.xml @@ -1,7 +1,9 @@ - - + + DLC=${env.DLC} @@ -12,14 +14,19 @@ - + - + + + + + + - + @@ -28,12 +35,13 @@ - - + + - + diff --git a/resources/markdown/dev_env_setup.md b/resources/markdown/dev_env_setup.md index 9b2a2314..f8e32026 100644 --- a/resources/markdown/dev_env_setup.md +++ b/resources/markdown/dev_env_setup.md @@ -23,21 +23,46 @@ To start vscode extension, you need to run project: - ```run -> start Debugging``` or run extension without debugging. - another instance of vsCode IDE runs with ProBro extension. Now you can test your code. +## Testing -## Launching OE tests (only for Windows) +### vscode config + +You can add DLC to your user or workspace `settings.json`, eliminating the need to specify DLC in each new terminal. +``` + "terminal.integrated.env.windows": { + "DLC": "path-to-progress" + } +``` + +`.vscode/settings.json` is part of the repo adding it there makes settings.json appear as changed in git. +Adding it to user settings may not be suitable if you work with multiple OpenEdge versions + +### Create sp2k db + +1. from vscode terminal in the workspace directory +2. execute +``` +$env:DLC="path-to-progress" +&$env:DLC\ant\bin\ant.bat create_db +``` + +### Launching OE tests (only for Windows) To test OE part communication with database, tests were written. Sports2020 (not modified) was selected as a testing database. To launch tests: -1. Set DLC parameter in ```resources/oe/propath.ini``` file 1. from vscode terminal get to ```resources/oe/ablunitRunWin``` directory -2. run ```./launch_unit.bat PathToPfFile``` +2. execute +``` +$env:DLC="path-to-progress" +./launch_unit.bat sports2020.pf +``` 3. test result will be saved in ```oe/results.xml``` file. -## Launching Node tests +### Launching Node tests TODO -## Launching scenario tests +### Launching scenario tests TODO \ No newline at end of file diff --git a/resources/oe/ablunitRunWin/launch_unit.bat b/resources/oe/ablunitRunWin/launch_unit.bat index f6bd19f3..26216c83 100644 --- a/resources/oe/ablunitRunWin/launch_unit.bat +++ b/resources/oe/ablunitRunWin/launch_unit.bat @@ -1,7 +1,12 @@ @ECHO OFF echo Starting tests... -C:\Progress\OpenEdge\bin\prowin.exe -basekey "INI" -ininame propath.ini -pf %1 -p ABLUnitCore.p -param "CFG=./ablunit.json" +if exist "%DLC%"\promsgs goto RUNTEST + echo DLC environment variable not set correctly - Please set DLC variable + goto END + +:RUNTEST +%DLC%\bin\prowin.exe -zdlc "%DLC%" -basekey "INI" -ininame propath.ini -pf %1 -p ABLUnitCore.p -param "CFG=./ablunit.json" findstr /m "" ..\results.xml > nul if %errorlevel%==0 ( @@ -10,4 +15,6 @@ echo Seems there are failing tests... echo Finished! Check 'results.xml' -pause \ No newline at end of file +pause + +:END diff --git a/resources/oe/ablunitRunWin/propath.ini b/resources/oe/ablunitRunWin/propath.ini index 3d46e77d..3282d027 100644 --- a/resources/oe/ablunitRunWin/propath.ini +++ b/resources/oe/ablunitRunWin/propath.ini @@ -1,3 +1,2 @@ [Startup] -DLC=C:\Progress\OpenEdge PROPATH=..,..\ \ No newline at end of file diff --git a/resources/oe/ablunitRunWin/sports2020.pf b/resources/oe/ablunitRunWin/sports2020.pf new file mode 100644 index 00000000..1e0d7a4d --- /dev/null +++ b/resources/oe/ablunitRunWin/sports2020.pf @@ -0,0 +1 @@ +-db ../../../target/db/sp2k/sp2k -1 \ No newline at end of file