Skip to content

Commit

Permalink
579 enhance dev_env_setup.md
Browse files Browse the repository at this point in the history
  • Loading branch information
cverbiest committed Sep 28, 2024
1 parent 2c2a3a0 commit ecd0aae
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 16 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ resources/oe/oeSocket.pro
docker/.builder/**
.scannerwork
connectionPF.pf
resources/oe/results.xml
target/**
24 changes: 16 additions & 8 deletions build.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<project name="ProBro" default="compile">
<property environment="env" />
<taskdef resource="PCT.properties" classpath="${user.home}/.ant/lib/PCT.jar;/usr/share/ant/lib/PCT.jar" />
<typedef resource="types.properties" classpath="${user.home}/.ant/lib/PCT.jar;/usr/share/ant/lib/PCT.jar" />
<taskdef resource="PCT.properties"
classpath="${user.home}/.ant/lib/PCT.jar;/usr/share/ant/lib/PCT.jar,${env.DLC}/pct/PCT.jar" />
<typedef resource="types.properties"
classpath="${user.home}/.ant/lib/PCT.jar;/usr/share/ant/lib/PCT.jar,${env.DLC}/pct/PCT.jar" />
<DlcHome value="${env.DLC}" />
<echo>DLC=${env.DLC}</echo>

Expand All @@ -12,14 +14,19 @@
<pathelement location="${env.DLC}/tty/OpenEdge.Core.pl" />
</path>

<condition property="DB_DIR" value="/psc/wrk/sp2k" else="target/db/sp2k" >
<condition property="DB_DIR" value="/psc/wrk/sp2k" else="target/db/sp2k">
<os family="unix" />
</condition>

<property name="tempDir" value="target/temp" />

<target name="create_db">
<mkdir dir="${DB_DIR}" />
<PCTCreateDatabase sourceDb="${env.DLC}/sports2020" dbName="sp2k" destDir="${DB_DIR}" />
</target>

<target name="compile">
<echo message="Compiling ProBro Back-End"/>
<echo message="Compiling ProBro Back-End" />
<PCTCompile destDir="target/rcode" keepXref="true" xmlXref="true" forceCompile="true">
<fileset dir="resources/oe/src" includes="**/*.cls,**/*.p" />
<fileset dir="resources/oe/tests" includes="**/*.cls,**/*.p" />
Expand All @@ -28,12 +35,13 @@
</PCTCompile>
</target>

<target name="test" depends="compile">
<condition property="fileset.includes" value="${file}" else="**/*Test.cls,**/*Test.p" >
<target name="test" depends="compile">
<condition property="fileset.includes" value="${file}" else="**/*Test.cls,**/*Test.p">
<isset property="file" />
</condition>
<mkdir dir="${tempDir}" />
<ABLUnit writeLog="true" destDir="target" failOnError="true" haltOnFailure="true" tempDir="${tempDir}">
<ABLUnit writeLog="true" destDir="target" failOnError="true" haltOnFailure="true"
tempDir="${tempDir}">
<fileset dir="resources/oe/tests" includes="**/*.p,**/*.cls" />
<propath refid="propath" />
<Profiler enabled="true" outputDir="target/profiler" coverage="true" />
Expand Down
35 changes: 30 additions & 5 deletions resources/markdown/dev_env_setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
11 changes: 9 additions & 2 deletions resources/oe/ablunitRunWin/launch_unit.bat
Original file line number Diff line number Diff line change
@@ -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 "</failure>" ..\results.xml > nul
if %errorlevel%==0 (
Expand All @@ -10,4 +15,6 @@ echo Seems there are failing tests...

echo Finished! Check 'results.xml'

pause
pause

:END
1 change: 0 additions & 1 deletion resources/oe/ablunitRunWin/propath.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
[Startup]
DLC=C:\Progress\OpenEdge
PROPATH=..,..\
1 change: 1 addition & 0 deletions resources/oe/ablunitRunWin/sports2020.pf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-db ../../../target/db/sp2k/sp2k -1

0 comments on commit ecd0aae

Please sign in to comment.