Skip to content

Commit

Permalink
Merge branch 'fix/perms' into 'master'
Browse files Browse the repository at this point in the history
Improve CI infrastructure and testability

See merge request multicore/drace!124
  • Loading branch information
fmoessbauer committed May 4, 2020
2 parents 2510bb9 + b539244 commit 0bbdfeb
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 29 deletions.
56 changes: 33 additions & 23 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@
variables:
PROJECT_NAME: "DRace"
GIT_SUBMODULE_STRATEGY: "normal"
DRRUN_EXE: "C:\\opt\\DynamoRIO-Windows-7.91.18219-0\\bin64\\drrun.exe"
DR_VERSION: "7.91.18369"
_NT_SYMBOL_PATH: "SRV*c:\\symbolcache\\*https://msdl.microsoft.com/download/symbols"
http_proxy: $CODE_PROXY
https_proxy: $CODE_PROXY
no_proxy: code.siemens.com,docker.siemens.com,devops.bt.siemens.com

stages:
- inspect
- build
- test
- package
- inspect
- build
- test
- package

### non architecture dependent tasks ###
cppcheck:
Expand Down Expand Up @@ -86,13 +86,13 @@ linux_x64:compile:
image: docker.siemens.com/multicore/drace:buildamd64-ci
script:
- echo "Release build..."
- if [ ! -d "DynamoRIO-x86_64-Linux-7.91.18271-0" ]; then wget https://github.com/DynamoRIO/dynamorio/releases/download/cronbuild-7.91.18271/DynamoRIO-x86_64-Linux-7.91.18271-0.tar.gz; fi
- if [ ! -d "DynamoRIO-x86_64-Linux-7.91.18271-0" ]; then tar -xf DynamoRIO-x86_64-Linux-7.91.18271-0.tar.gz; fi
- if [ ! -d "DynamoRIO-Linux-${DR_VERSION}" ]; then wget https://github.com/DynamoRIO/dynamorio/releases/download/cronbuild-${DR_VERSION}/DynamoRIO-Linux-${DR_VERSION}.tar.gz; fi
- if [ ! -d "DynamoRIO-Linux-${DR_VERSION}" ]; then tar -xf DynamoRIO-Linux-${DR_VERSION}.tar.gz; fi
- sh ./contrib/compile-linux-x64.sh
cache:
key: dynamorio-cache-x64
key: dynamorio-cache-linux
paths:
- ./DynamoRIO-x86_64-Linux-7.91.18271-0
- ./DynamoRIO-Linux-${DR_VERSION}
artifacts:
paths:
- build64
Expand All @@ -105,13 +105,13 @@ linux_i386:compile:
image: docker.siemens.com/multicore/drace:buildi386-ci
script:
- echo "Release build..."
- if [ ! -d "DynamoRIO-i386-Linux-7.91.18271-0" ]; then wget https://github.com/DynamoRIO/dynamorio/releases/download/cronbuild-7.91.18271/DynamoRIO-i386-Linux-7.91.18271-0.tar.gz; fi
- if [ ! -d "DynamoRIO-i386-Linux-7.91.18271-0" ]; then tar -xfDynamoRIO-i386-Linux-7.91.18271-0.tar.gz; fi
- if [ ! -d "DynamoRIO-Linux-${DR_VERSION}" ]; then wget https://github.com/DynamoRIO/dynamorio/releases/download/cronbuild-${DR_VERSION}/DynamoRIO-Linux-${DR_VERSION}.tar.gz; fi
- if [ ! -d "DynamoRIO-Linux-${DR_VERSION}" ]; then tar -xfDynamoRIO-Linux-${DR_VERSION}.tar.gz; fi
- sh ./contrib/compile-linux-i386.sh
cache:
key: dynamorio-cache-i386
key: dynamorio-cache-linux
paths:
- ./DynamoRIO-i386-Linux-7.91.18271-0
- ./DynamoRIO-Linux-${DR_VERSION}
artifacts:
paths:
- build32
Expand All @@ -130,8 +130,8 @@ windows_x64:test:
- ./bin/drace-system-tests.exe --gtest_output="xml:test-system-results.xml" --gtest_filter="*/0"
artifacts:
paths:
- build-dr791/test-system-results.xml
- build-dr791/Testing/**/Test.xml
- build-dr791/test-system-results.xml
- build-dr791/Testing/**/Test.xml
reports:
junit:
- build-dr791/test-system-results.xml
Expand Down Expand Up @@ -187,13 +187,19 @@ linux_i386:test:
windows_x64:bundle:
<<: *globals
stage: package
tags:
- DOCKER
# for packaging, we just need NPM, hence run in linux container
image: docker.siemens.com/multicore/drace:buildamd64-ci
script:
- Copy-Item "contrib/package.json" -Destination "."
- Copy-Item "contrib/package-lock.json" -Destination "."
- cp "contrib/package.json" "."
- cp "contrib/package-lock.json" "."
- echo "Generate Changelog"
- npx generate-changelog
- Copy-Item "CHANGELOG.md" -Destination "build-dr791/package/doc/"
needs: ["windows_x64:compile"]
- cp "CHANGELOG.md" "build-dr791/package/doc/"
dependencies:
- windows_x64:compile
- windows_x64:test
artifacts:
paths:
- build-dr791/package
Expand All @@ -202,11 +208,15 @@ pages:
stage: package
variables:
GIT_STRATEGY: "none"
needs: ["windows_x64:compile"]
needs:
- job: "windows_x64:compile"
artifacts: true
- job: "windows_x64:test"
artifacts: false
script:
- mv build-dr791/doc/html/ public/
- mv build-dr791/doc/html/ public/
artifacts:
paths:
- public
- public
only:
- master
- master
2 changes: 1 addition & 1 deletion contrib/compile-linux-i386.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
root=$(pwd)
dynamorio32=${root}"/DynamoRIO-i386-Linux-7.91.18271-0/cmake"
dynamorio32=${root}"/DynamoRIO-Linux-${DR_VERSION}/cmake"

mkdir build32
cd build32
Expand Down
2 changes: 1 addition & 1 deletion contrib/compile-linux-x64.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
root=$(pwd)
dynamorio64=${root}"/DynamoRIO-x86_64-Linux-7.91.18271-0/cmake"
dynamorio64=${root}"/DynamoRIO-Linux-${DR_VERSION}/cmake"

mkdir build64
cd build64
Expand Down
5 changes: 2 additions & 3 deletions contrib/compile-win-x64.bat
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Too
set CC=cl.exe
set CXX=cl.exe

echo "=== Generate drace DR 7.91.x ==="
echo "=== Generate drace DR %DR_VERSION% ==="
mkdir build-dr791
cd build-dr791
cmake -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DDRACE_XML_EXPORTER=1 -DBOOST_ROOT=C:\\opt\\boost_1_71_0 -DCMAKE_PREFIX_PATH=C:\\Qt\\Qt5.13.1\\5.13.1\\msvc2017_64\\lib\\cmake\\Qt5 -DBUILD_TESTING=1 -DDRACE_ENABLE_BENCH=1 -DDynamoRIO_DIR=C:/opt/DynamoRIO-Windows-7.91.18219-0/cmake -DCMAKE_INSTALL_PREFIX:PATH=package ..
cmake -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DDRACE_XML_EXPORTER=1 -DBOOST_ROOT=C:\\opt\\boost_1_71_0 -DCMAKE_PREFIX_PATH=C:\\Qt\\Qt5.13.1\\5.13.1\\msvc2017_64\\lib\\cmake\\Qt5 -DBUILD_TESTING=1 -DDRACE_ENABLE_BENCH=1 -DDynamoRIO_DIR=C:/opt/DynamoRIO-Windows-%DR_VERSION%/cmake -DCMAKE_INSTALL_PREFIX:PATH=package ..

echo "=== Build drace-TSAN DR 7.91.x ==="
cmake --build . || goto :error
cmake --build . --target install || goto :error
cmake --build . --target doc || goto :error
Expand Down
2 changes: 1 addition & 1 deletion contrib/dockerbuild/linux-x86-64-ci/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM debian:buster

RUN apt-get update -y && \
apt-get install -y wget tar cmake git libboost-filesystem-dev gcc g++
apt-get install -y wget tar cmake git libboost-filesystem-dev gcc g++ npm
4 changes: 4 additions & 0 deletions test/include/IntegrationTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ class Integration : public ::testing::Test {
std::cout << "DRace crashed sporadically, probably to allocation "
"error. Retry "
<< startup_retries - i - 1 << std::endl;
std::ofstream dst(logfile + ".retry" + std::to_string(i));
dst << output;
std::this_thread::sleep_for(std::chrono::seconds(15));
} else {
ADD_FAILURE() << "Race-Summary not found";
Expand All @@ -107,6 +109,8 @@ class Integration : public ::testing::Test {
for (int i = 1; i < t_argc; ++i) {
if (i < (t_argc - 1) && strncmp(t_argv[i], "--dr", 8) == 0) {
drrun = t_argv[i + 1];
} else if (i < (t_argc - 1) && strncmp(t_argv[i], "-c", 8) == 0) {
drclient = t_argv[i + 1];
} else if (strncmp(t_argv[i], "-v", 4) == 0) {
verbose = true;
}
Expand Down

0 comments on commit 0bbdfeb

Please sign in to comment.