Skip to content

Commit e8627ad

Browse files
committed
Update FV scripts. Add extra error logs into console of crashed test
For more crash backtraces in case of signal Aborted add SEGFAULT_SIGNALS = all for linux builds. Tested and reproduced crash on Gitlab. Also changed fixed CPU core-number from hardcoded to flexible number. Relates-To: OLPEDGE-473, OLPEDGE-903, OLPEDGE-917 Signed-off-by: Yaroslav Stefinko <[email protected]>
1 parent 18784ab commit e8627ad

File tree

6 files changed

+22
-6
lines changed

6 files changed

+22
-6
lines changed

.gitlab-ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ image: ${DOCKER_REGISTRY}/${DOCKER_IMAGE}:${DOCKER_IMAGE_VERSION}
22

33
variables:
44
LD_PRELOAD: "/lib/x86_64-linux-gnu/libSegFault.so"
5+
SEGFAULT_SIGNALS: "all"
56

67
stages:
78
- build

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ dist: xenial
44
env:
55
global:
66
- LD_PRELOAD=/lib/x86_64-linux-gnu/libSegFault.so
7+
- SEGFAULT_SIGNALS=all
78
- WORKSPACE=$TRAVIS_BUILD_DIR
89
addons:
910
apt:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash -e
22
mkdir -p build && cd build
33
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -OLP_SDK_BUILD_EXAMPLES=ON -DOLP_SDK_BUILD_DOC=ON -DBUILD_SHARED_LIBS=ON ..
4-
make -j8
4+
make -j$(nproc)
55
make docs
66
cd ..

scripts/linux/fv/gitlab_test_fv.sh

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/bash -e
22
# Running every test one by one
33

4+
45
export REPO_HOME=$PWD
56
export FV_HOME=${REPO_HOME}/scripts/linux/fv
67
rm -rf reports && mkdir -p reports # folder for reports storage
@@ -13,6 +14,9 @@ fi
1314
TEST_FAILURE=0
1415
EXPECTED_REPORT_COUNT=6 # expected that we generate 6 reports
1516

17+
#for core dump backtrace
18+
ulimit -c unlimited
19+
1620
# Run unit tests
1721
${FV_HOME}/gitlab-olp-cpp-sdk-authentication-test.sh 2>> errors.txt || TEST_FAILURE=1
1822
${FV_HOME}/gitlab-olp-cpp-sdk-core-test.sh 2>> errors.txt || TEST_FAILURE=1
@@ -29,20 +33,25 @@ ${FV_HOME}/gitlab-olp-cpp-sdk-functional-test.sh 2>> errors.txt || TEST_FAILURE=
2933
if [[ ${TEST_FAILURE} == 1 ]]; then
3034
export REPORT_COUNT=$(ls ${REPO_HOME}/reports | wc -l)
3135
if [[ ${REPORT_COUNT} -ne ${EXPECTED_REPORT_COUNT} || ${REPORT_COUNT} == 0 ]]; then
36+
echo "Printing error.txt ###########################################"
37+
cat errors.txt
38+
echo "End of error.txt #############################################"
3239
echo "CRASH ERROR. One of test groups contains crash. Report was not generated for that group ! "
3340
fi
3441
else
3542
echo "OK. Full list of test reports was generated. "
3643
fi
3744

3845

39-
for failreport in `ls ${REPO_HOME}/reports/*-report.xml`
46+
for failreport in $(ls ${REPO_HOME}/reports/*.xml)
4047
do
41-
if [[ $(grep -q "<failure" ${failreport}) ]]; then
48+
echo "Parsing ${failreport} ..."
49+
if $(grep -q "<failure" "${failreport}" ) ; then
4250
echo "${failreport} contains errors : "
4351
cat ${failreport}
44-
echo "Full log contains errors : "
52+
echo "Printing error.txt ###########################################"
4553
cat errors.txt
54+
echo "End of error.txt #############################################"
4655
fi
4756
done
4857

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#!/bin/bash -xe
2+
#for core dump backtrace
3+
ulimit -c unlimited
4+
25
mkdir -p build
36
cd build
47
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE \
@@ -7,6 +10,5 @@ cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE \
710
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
811
..
912

10-
make -j8
11-
cd ..
13+
make -j$(nproc)
1214
ccache -s

scripts/linux/psv/travis_test_psv.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#!/bin/bash -e
2+
#for core dump backtrace
3+
ulimit -c unlimited
4+
25
CPP_TEST_SOURCE_AUTHENTICATION=build/olp-cpp-sdk-authentication/tests
36
CPP_TEST_SOURCE_CORE=build/olp-cpp-sdk-core/tests
47
CPP_TEST_SOURCE_DARASERVICE_READ=build/olp-cpp-sdk-dataservice-read/tests

0 commit comments

Comments
 (0)