Skip to content

Commit 8fa0187

Browse files
committed
Add leak detection to CentOS builds.
1 parent 1e0534a commit 8fa0187

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

netci.groovy

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,21 +145,29 @@ def addPushJob(String project, String branch, String os, String configuration, b
145145

146146
def shortJobName = "${os}_Tarball_${configuration}";
147147
def contextString = "${os} Tarball ${configuration}";
148+
def poisonProductionBuildArgument = ""
149+
def poisonConsumptionBuildArugment = ""
148150

149151
if (portable) {
150152
shortJobName += "_Portable"
151153
contextString += " Portable"
152154
}
153155

156+
// only run poisoning on one platform for now
157+
if (os == "CentOS7.1") {
158+
poisonProductionBuildArgument = "--enable-leak-detection"
159+
poisonConsumptionBuildArugment = "/p:EnablePoison=true"
160+
}
161+
154162
def triggerPhrase = "(?i).*test\\W+${contextString}.*";
155163

156164
def newJob = job(Utilities.getFullJobName(project, shortJobName, isPR)){
157165
steps{
158166
shell("cd ./source-build;git submodule update --init --recursive");
159167
shell("cd ./source-build;./build.sh /p:ArchiveDownloadedPackages=true /p:Configuration=${configuration} /p:PortableBuild=${portable} ${loggingOptions}");
160-
shell("cd ./source-build;./build-source-tarball.sh ../tarball-output --skip-build");
168+
shell("cd ./source-build;./build-source-tarball.sh ../tarball-output --skip-build ${poisonProductionBuildArgument}");
161169

162-
shell("cd ./tarball-output;./build.sh /p:Configuration=${configuration} /p:PortableBuild=${portable} /p:FailOnPrebuiltBaselineError=true ${loggingOptions}")
170+
shell("cd ./tarball-output;./build.sh /p:Configuration=${configuration} /p:PortableBuild=${portable} /p:FailOnPrebuiltBaselineError=true ${poisonConsumptionBuildArugment} ${loggingOptions}")
163171
shell("cd ./tarball-output;./smoke-test.sh --minimal --configuration ${configuration}")
164172
}
165173
}
@@ -200,12 +208,20 @@ def addPushJob(String project, String branch, String os, String configuration, b
200208

201209
def shortJobName = "${os}_Unshared_${configuration}";
202210
def contextString = "${os} Unshared ${configuration}";
211+
def poisonProductionBuildArgument = ""
212+
def poisonConsumptionBuildArugment = ""
203213

204214
if (portable) {
205215
shortJobName += "_Portable"
206216
contextString += " Portable"
207217
}
208218

219+
// only run poisoning on one platform for now
220+
if (os == "CentOS7.1") {
221+
poisonProductionBuildArgument = "--enable-leak-detection"
222+
poisonConsumptionBuildArugment = "/p:EnablePoison=true"
223+
}
224+
209225
def triggerPhrase = "(?i).*test\\W+${contextString}.*";
210226
def imageName = getDockerImageForOs(os);
211227

@@ -217,9 +233,9 @@ def addPushJob(String project, String branch, String os, String configuration, b
217233
// Have to make this directory before volume-sharing it unlike non-docker build - existing directory is really only a warning in build-source-tarball.sh
218234
shell("mkdir tarball-output");
219235
// now build the tarball
220-
shell("docker run -u=\"\$(id -u):\$(id -g)\" -t --sig-proxy=true -e HOME=/opt/code/home --network none -v \$(pwd)/source-build:/opt/code -v \$(pwd)/tarball-output:/opt/tarball --rm -w /opt/code ${imageName} /opt/code/build-source-tarball.sh /opt/tarball --skip-build");
236+
shell("docker run -u=\"\$(id -u):\$(id -g)\" -t --sig-proxy=true -e HOME=/opt/code/home --network none -v \$(pwd)/source-build:/opt/code -v \$(pwd)/tarball-output:/opt/tarball --rm -w /opt/code ${imageName} /opt/code/build-source-tarball.sh /opt/tarball --skip-build ${poisonProductionBuildArgument}");
221237
// now build from the tarball offline and without access to the regular non-tarball build
222-
shell("docker run -u=\"\$(id -u):\$(id -g)\" -t --sig-proxy=true -e HOME=/opt/tarball/home --network none -v \$(pwd)/tarball-output:/opt/tarball --rm -w /opt/tarball ${imageName} /opt/tarball/build.sh /p:Configuration=${configuration} /p:PortableBuild=${portable} /p:FailOnPrebuiltBaselineError=true ${loggingOptions}");
238+
shell("docker run -u=\"\$(id -u):\$(id -g)\" -t --sig-proxy=true -e HOME=/opt/tarball/home --network none -v \$(pwd)/tarball-output:/opt/tarball --rm -w /opt/tarball ${imageName} /opt/tarball/build.sh /p:Configuration=${configuration} /p:PortableBuild=${portable} /p:FailOnPrebuiltBaselineError=true ${poisonConsumptionBuildArugment} ${loggingOptions}");
223239
// finally, run a smoke-test on the result
224240
shell("docker run -u=\"\$(id -u):\$(id -g)\" -t --sig-proxy=true -e HOME=/opt/tarball/home -v \$(pwd)/tarball-output:/opt/tarball --rm -w /opt/tarball ${imageName} /opt/tarball/smoke-test.sh --minimal --configuration ${configuration}");
225241
}

0 commit comments

Comments
 (0)