Skip to content

Commit bd0ab79

Browse files
committed
[Azure]Add FV Win network test job
Add job and script for Windows build/test job. It will rung nightly on Azure pipelines. Resolves: OLPEDGE-928 Signed-off-by: Yaroslav Stefinko <ext-yaroslav.stefinko@here.com>
1 parent abf5284 commit bd0ab79

File tree

3 files changed

+82
-4
lines changed

3 files changed

+82
-4
lines changed

azure-pipelines.yml

+13-3
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,21 @@ jobs:
2222
displayName: 'Commit checker script'
2323
- job: Windows_build
2424
pool:
25-
vmImage: 'vs2017-win2016'
25+
vmImage: 'windows-latest'
2626
steps:
27-
- bash: scripts/windows/build.sh
27+
- bash: curl https://raw.githubusercontent.com/mock-server/mockserver/master/mockserver-core/src/main/resources/org/mockserver/socket/CertificateAuthorityCertificate.pem --output mock-server-cert.cer
28+
displayName: 'Get cert'
29+
- powershell: Import-Certificate -FilePath mock-server-cert.cer -CertStoreLocation Cert:\LocalMachine\Root
30+
displayName: 'Import cert'
31+
- powershell: dir Cert:\CurrentUser\Root
32+
displayName: 'Check cert CurrentUser'
33+
- powershell: dir Cert:\LocalMachine\Root
34+
displayName: 'Check cert LocalMachine'
35+
- bash: whoami && scripts/windows/build.sh
2836
displayName: 'Windows Build'
29-
37+
- bash: sudo scripts/windows/test_fv_network.sh
38+
displayName: 'Windows FV Network test'
39+
condition: in(variables['Build.Reason'], 'Schedule', 'Manual')
3040
- job: MacOS_build
3141
pool:
3242
vmImage: 'macOS-10.14'

scripts/windows/build.sh

+6-1
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,14 @@
1717
# SPDX-License-Identifier: Apache-2.0
1818
# License-Filename: LICENSE
1919

20+
echo ">>> Installing mock server SSL certificate into OS... >>>"
21+
curl https://raw.githubusercontent.com/mock-server/mockserver/master/mockserver-core/src/main/resources/org/mockserver/socket/CertificateAuthorityCertificate.pem --output mock-server-cert.cer
22+
certutil -enterprise -f -v -addstore "Root" mock-server-cert.cer
23+
certutil -enterprise -f -v -addstore "CA" mock-server-cert.cer
24+
2025

2126
[[ -d "build" ]] && rm -rf build
2227
mkdir build && cd build
23-
cmake .. -G "Visual Studio 15 2017 Win64" \
28+
cmake .. -G "Visual Studio 16 2019" -A "x64" \
2429
-DCMAKE_BUILD_TYPE=$BUILD_TYPE
2530
cmake --build . --config $BUILD_TYPE

scripts/windows/test_fv_network.sh

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
#!/bin/bash -ex
2+
#
3+
# Copyright (C) 2020 HERE Europe B.V.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
# SPDX-License-Identifier: Apache-2.0
18+
# License-Filename: LICENSE
19+
20+
# Set workspace location
21+
if [[ ${CI_PROJECT_DIR} == "" ]]; then
22+
export CI_PROJECT_DIR=`pwd`
23+
fi
24+
25+
[[ -d "reports" ]] && rm -rf reports
26+
27+
#echo ">>> Installing mock server SSL certificate into OS... >>>"
28+
#curl https://raw.githubusercontent.com/mock-server/mockserver/master/mockserver-core/src/main/resources/org/mockserver/socket/CertificateAuthorityCertificate.pem --output mock-server-cert.cer
29+
#certutil -enterprise -f -v -addstore "Root" mock-server-cert.cer
30+
#certutil -enterprise -f -v -addstore "CA" mock-server-cert.cer
31+
32+
33+
echo ">>> Starting Mock Server... >>>"
34+
pushd tests/utils/mock-server
35+
npm install
36+
node server.js & export SERVER_PID=$!
37+
popd
38+
39+
# Node can start server in 1 second, but not faster.
40+
# Add waiter for server to be started. No other way to solve that.
41+
# Curl returns code 1 - means server still down. Curl returns 0 when server is up
42+
RC=1
43+
while [[ ${RC} -ne 0 ]];
44+
do
45+
set +e
46+
curl -s http://localhost:1080
47+
RC=$?
48+
sleep 0.2
49+
set -e
50+
done
51+
52+
echo ">>> Start network tests ... >>>"
53+
$CI_PROJECT_DIR/build/tests/functional/network/RelWithDebInfo/olp-cpp-sdk-functional-network-tests \
54+
--gtest_output="xml:$CI_PROJECT_DIR/reports/olp-functional-network-test-report.xml"
55+
result=$?
56+
echo ">>> Finished network tests >>>"
57+
58+
# Terminate the mock server
59+
kill -TERM $SERVER_PID
60+
61+
wait
62+
63+
exit ${result}

0 commit comments

Comments
 (0)