Skip to content

Commit f389331

Browse files
Deploy ETP server and run unit test against it in CI
Put src files in a fetpapi folder to better mimic the installation folders layout
1 parent 169ec04 commit f389331

61 files changed

Lines changed: 159 additions & 70 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/github-actions.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ jobs:
9393
shell: bash
9494
run: |
9595
dir1="${{ github.workspace }}/src"
96-
dir2="${{ github.workspace }}/../build/install/include/fetpapi"
96+
dir2="${{ github.workspace }}/../build/install/include"
9797
diff <(cd "$dir1" && find . -type f -name "*.h" | grep -v "./etp/ssl/ssl_stream.h" | sort) <(cd "$dir2" && find . -type f -name "*.h" | grep -v "./etp/ssl/ssl_stream.h" | sort)
9898
if [ $? -ne 0 ]; then
9999
echo "❌ The directories have not the same .h files"
@@ -175,6 +175,7 @@ jobs:
175175
with:
176176
distribution: 'temurin' # See 'Supported distributions' for available options
177177
java-version: '11'
178+
- uses: docker/setup-compose-action@v2
178179
- name: APT install
179180
run: |
180181
sudo apt update
@@ -205,8 +206,16 @@ jobs:
205206
cd ${{ github.workspace }}/..
206207
mkdir build
207208
cd build
208-
cmake -DAVRO_ROOT=${{ runner.temp }}/avro-cpp-install -DAVRO_USE_STATIC_LIBS=TRUE -DWITH_FESAPI=TRUE -DFESAPI_ROOT=${{ runner.temp }}/fesapi-install -DFESAPI_JAR=${{ runner.temp }}/fesapi-install/lib/fesapiJava-2.14.1.0.jar -DWITH_JAVA_WRAPPING=TRUE ${{ github.workspace }} -DCMAKE_C_COMPILER=${{ matrix.cc }} -DCMAKE_CXX_COMPILER=${{ matrix.cxx }}
209+
cmake -DAVRO_ROOT=${{ runner.temp }}/avro-cpp-install -DAVRO_USE_STATIC_LIBS=TRUE -DWITH_FESAPI=TRUE -DFESAPI_ROOT=${{ runner.temp }}/fesapi-install -DFESAPI_JAR=${{ runner.temp }}/fesapi-install/lib/fesapiJava-2.14.1.0.jar -DWITH_JAVA_WRAPPING=TRUE -DWITH_TEST=TRUE ${{ github.workspace }} -DCMAKE_C_COMPILER=${{ matrix.cc }} -DCMAKE_CXX_COMPILER=${{ matrix.cxx }}
209210
cmake --build . --config Release -j2
211+
- name: Deploy an ETP server
212+
run: |
213+
docker compose -f ${{ github.workspace }}/docker/docker-compose.yml up -d
214+
until [ "$(docker inspect -f '{{.State.Health.Status}}' open-etp-server)" = "healthy" ]; do sleep 1; done
215+
until curl -s -o /dev/null -w "%{http_code}" http://localhost:9002/.well-known/etp-server-capabilities?GetVersion=etp12.energistics.org | grep -q "200"; do sleep 2; done
216+
- name: Run Unit tests
217+
run: |
218+
${{ github.workspace }}/../build/test/unitTest
210219
build_wheels_windows:
211220
name: Build wheels on windows-latest
212221
runs-on: windows-latest

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
/cs/fetpapiCs.csproj
33
/swig/setup.py
44
/swig/swigEtp1_2Include.i
5-
/src/macroDefinitions.h
6-
/src/version_config.h
5+
/src/fetpapi/macroDefinitions.h
6+
/src/fetpapi/version_config.h
77

88
## Ignore csharp swig generated files
99
/swig/swigGeneratedCsWrapper.cpp

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ set (Fetpapi_VERSION_TWEAK 0)
2222
set (Fetpapi_VERSION ${Fetpapi_VERSION_MAJOR}.${Fetpapi_VERSION_MINOR}.${Fetpapi_VERSION_PATCH}.${Fetpapi_VERSION_TWEAK})
2323

2424
# Create the version config header file in order for FETPAPI users to know the FETPAPI version at runtime.
25-
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/version_config.h.in ${CMAKE_CURRENT_SOURCE_DIR}/src/version_config.h)
25+
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/version_config.h.in ${CMAKE_CURRENT_SOURCE_DIR}/src/fetpapi/version_config.h)
2626

2727
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
2828
set (CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/install CACHE PATH "${PROJECT_NAME} install prefix" FORCE)
@@ -170,7 +170,7 @@ endif ()
170170

171171
# Namespaces definitions
172172
set (FETPAPI_ETP_NS etp CACHE STRING "Namespace for etp objects")
173-
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/macroDefinitions.h.in ${CMAKE_CURRENT_SOURCE_DIR}/src/macroDefinitions.h @ONLY) # Overwrite if different
173+
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/macroDefinitions.h.in ${CMAKE_CURRENT_SOURCE_DIR}/src/fetpapi/macroDefinitions.h @ONLY) # Overwrite if different
174174

175175
# ============================================================================
176176
# SWIG wrapping
@@ -197,7 +197,7 @@ endif (WITH_PYTHON_WRAPPING)
197197
# Getting source files
198198
# ============================================================================
199199

200-
include(${CMAKE_CURRENT_SOURCE_DIR}/src/CMakeLists.txt)
200+
include(${CMAKE_CURRENT_SOURCE_DIR}/src/fetpapi/CMakeLists.txt)
201201
set (ALL_SOURCES_AND_HEADERS
202202
${FETPAPI_HEADERS}
203203
${FETPAPI_ETP_SOURCES}

cmake/swigEtp1_2Include.i.in

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ under the License.
4040
%include "stdint.i"
4141
%include "std_string.i"
4242

43-
%include "../src/macroDefinitions.h"
43+
%include "../src/fetpapi/macroDefinitions.h"
4444

4545
//************************/
4646
// JAVA
@@ -147,14 +147,14 @@ under the License.
147147
typedef long long time_t;
148148

149149
%{
150-
#include "../src/etp/ClientSessionLaunchers.h"
151-
#include "../src/etp/EtpHelpers.h"
150+
#include "../src/fetpapi/etp/ClientSessionLaunchers.h"
151+
#include "../src/fetpapi/etp/EtpHelpers.h"
152152
%}
153153

154154
#ifdef WITH_FESAPI
155155
%{
156-
#include "../src/etp/fesapi/FesapiHdfProxy.h"
157-
#include "../src/etp/fesapi/FesapiHelpers.h"
156+
#include "../src/fetpapi/etp/fesapi/FesapiHdfProxy.h"
157+
#include "../src/fetpapi/etp/fesapi/FesapiHelpers.h"
158158
%}
159159
#endif
160160

docker/docker-compose.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: etpserver
2+
services:
3+
open-etp-postgresql:
4+
container_name: open-etp-postgresql
5+
image: postgres
6+
environment:
7+
POSTGRES_USER: tester
8+
POSTGRES_PASSWORD: tester
9+
POSTGRES_DB: postkv
10+
restart: unless-stopped
11+
healthcheck:
12+
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
13+
interval: 10s
14+
timeout: 5s
15+
retries: 5
16+
start_period: 5s
17+
open-etp-server:
18+
container_name: open-etp-server
19+
image: community.opengroup.org:5555/osdu/platform/domain-data-mgmt-services/reservoir/open-etp-server/open-etp-server-main
20+
command: openETPServer server --start --log_level debug --jobs 4
21+
depends_on:
22+
open-etp-postgresql:
23+
condition: service_healthy
24+
environment:
25+
RDMS_DATA_PARTITION_MODE: single
26+
ENABLE_ANY_NUMBER_OF_THREADS: true
27+
POSTGRESQL_CONN_STRING: host=open-etp-postgresql port=5432 dbname=postkv user=tester password=tester
28+
ports:
29+
- "9002:9002"
30+
restart: unless-stopped

example/withFesapi/etpClient.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ under the License.
2828
#include <fesapi/resqml2_0_1/ContinuousProperty.h>
2929
#include <fesapi/resqml2_0_1/LocalDepth3dCrs.h>
3030

31-
#include "etp/ClientSessionLaunchers.h"
32-
#include "etp/fesapi/FesapiHdfProxy.h"
33-
#include "etp/fesapi/FesapiHelpers.h"
31+
#include "fetpapi/etp/ClientSessionLaunchers.h"
32+
#include "fetpapi/etp/fesapi/FesapiHdfProxy.h"
33+
#include "fetpapi/etp/fesapi/FesapiHelpers.h"
3434

3535
namespace {
3636
std::vector<std::string> tokenize(const std::string& str, char delimiter) {
File renamed without changes.

0 commit comments

Comments
 (0)