@@ -6,6 +6,7 @@ def utils = new org.stan.Utils()
66def skipExpressionTests = false
77def skipRemainingStages = false
88def skipCompileTests = false
9+ def skipRebuildingBinaries = false
910def buildingAgentARM = " linux"
1011
1112/* Functions that runs a sh command and returns the stdout */
@@ -27,7 +28,13 @@ def tagName() {
2728pipeline {
2829 agent none
2930 parameters {
30- booleanParam(name :" compile_all" , defaultValue : false , description :" Try compiling all models in test/integration/good" )
31+ booleanParam(name :" skip_end_to_end" , defaultValue : false , description :" Skip end-to-end tests " )
32+ string(defaultValue : ' develop' , name : ' cmdstan_pr' ,
33+ description : " CmdStan PR to test against. Will check out this PR in the downstream Stan repo." )
34+ string(defaultValue : ' develop' , name : ' stan_pr' ,
35+ description : " Stan PR to test against. Will check out this PR in the downstream Stan repo." )
36+ string(defaultValue : ' develop' , name : ' math_pr' ,
37+ description : " Math PR to test against. Will check out this PR in the downstream Math repo." )
3138 }
3239 options {parallelsAlwaysFailFast()}
3340 stages {
@@ -46,15 +53,18 @@ pipeline {
4653 retry(3 ) { checkout scm }
4754 sh ' git clean -xffd'
4855
49- def stanMathSigs = [' test/integration/signatures/stan_math_sigs.expected ' ]. join(" " )
56+ def stanMathSigs = [' test/integration/signatures/stan_math_signatures.t ' ]. join(" " )
5057 skipExpressionTests = utils. verifyChanges(stanMathSigs)
5158
52- def sourceCodePaths = [' src' ]. join(" " )
53- skipRemainingStages = utils. verifyChanges(sourceCodePaths )
59+ def runTestPaths = [' src' , ' test/integration/good ' , ' test/stancjs ' ]. join(" " )
60+ skipRemainingStages = utils. verifyChanges(runTestPaths )
5461
5562 def compileTests = [' test/integration/good' ]. join(" " )
5663 skipCompileTests = utils. verifyChanges(compileTests)
5764
65+ def sourceCodePaths = [' src' ]. join(" " )
66+ skipRebuildingBinaries = utils. verifyChanges(sourceCodePaths)
67+
5868 if (buildingTag()) {
5969 buildingAgentARM = " arm-ec2"
6070 }
@@ -180,6 +190,11 @@ pipeline {
180190
181191 writeFile(file :" performance-tests-cmdstan/cmdstan/make/local" ,
182192 text :" O=0\n CXX=${ CXX} " )
193+
194+ utils. checkout_pr(" cmdstan" , " performance-tests-cmdstan/cmdstan" , params. cmdstan_pr)
195+ utils. checkout_pr(" stan" , " performance-tests-cmdstan/cmdstan/stan" , params. stan_pr)
196+ utils. checkout_pr(" math" , " performance-tests-cmdstan/cmdstan/stan/lib/stan_math" , params. math_pr)
197+
183198 sh """
184199 cd performance-tests-cmdstan
185200 mkdir cmdstan/bin
@@ -203,29 +218,39 @@ pipeline {
203218 stage(" Model end-to-end tests" ) {
204219 when {
205220 beforeAgent true
206- expression {
221+ allOf {
222+ expression {
207223 ! skipCompileTests
224+ }
225+ expression {
226+ ! params. skip_end_to_end
227+ }
208228 }
209229 }
210230 agent { label ' linux' }
211231 steps {
212- unstash ' ubuntu-exe'
213- sh """
214- git clone --recursive --depth 50 https://github.com/stan-dev/performance-tests-cmdstan
215- """
216- sh """
217- cd performance-tests-cmdstan
218- git show HEAD --stat
219- echo "example-models/regression_tests/mother.stan" > all.tests
220- cat known_good_perf_all.tests >> all.tests
221- echo "" >> all.tests
222- cat shotgun_perf_all.tests >> all.tests
223- cat all.tests
224- echo "CXXFLAGS+=-march=core2" > cmdstan/make/local
225- echo "PRECOMPILED_HEADERS=false" >> cmdstan/make/local
226- cd cmdstan; make clean-all; git show HEAD --stat; cd ..
227- CXX="${ CXX} " ./compare-compilers.sh "--tests-file all.tests --num-samples=10" "\$ (readlink -f ../bin/stanc)"
228- """
232+ script {
233+ unstash ' ubuntu-exe'
234+ sh """
235+ git clone --recursive --depth 50 https://github.com/stan-dev/performance-tests-cmdstan
236+ """
237+ utils. checkout_pr(" cmdstan" , " performance-tests-cmdstan/cmdstan" , params. cmdstan_pr)
238+ utils. checkout_pr(" stan" , " performance-tests-cmdstan/cmdstan/stan" , params. stan_pr)
239+ utils. checkout_pr(" math" , " performance-tests-cmdstan/cmdstan/stan/lib/stan_math" , params. math_pr)
240+ sh """
241+ cd performance-tests-cmdstan
242+ git show HEAD --stat
243+ echo "example-models/regression_tests/mother.stan" > all.tests
244+ cat known_good_perf_all.tests >> all.tests
245+ echo "" >> all.tests
246+ cat shotgun_perf_all.tests >> all.tests
247+ cat all.tests
248+ echo "CXXFLAGS+=-march=core2" > cmdstan/make/local
249+ echo "PRECOMPILED_HEADERS=false" >> cmdstan/make/local
250+ cd cmdstan; make clean-all; git show HEAD --stat; cd ..
251+ CXX="${ CXX} " ./compare-compilers.sh "--tests-file all.tests --num-samples=10" "\$ (readlink -f ../bin/stanc)"
252+ """
253+ }
229254
230255 xunit([GoogleTest (
231256 deleteOutputFiles : false ,
@@ -258,12 +283,15 @@ pipeline {
258283
259284 unstash ' ubuntu-exe'
260285
261- sh """
262- git clone --recursive https://github.com/stan-dev/math.git
263- cp bin/stanc math/test/expressions/stanc
264- """
265-
266286 script {
287+ sh """
288+ git clone --recursive https://github.com/stan-dev/math.git
289+ """
290+ utils. checkout_pr(" math" , " math" , params. math_pr)
291+ sh """
292+ cp bin/stanc math/test/expressions/stanc
293+ """
294+
267295 dir(" math" ) {
268296 sh """
269297 echo O=0 >> make/local
@@ -287,7 +315,7 @@ pipeline {
287315 when {
288316 beforeAgent true
289317 expression {
290- ! skipRemainingStages
318+ ! skipRebuildingBinaries
291319 }
292320 }
293321 agent { label " osx && ocaml" }
@@ -311,7 +339,7 @@ pipeline {
311339 when {
312340 beforeAgent true
313341 expression {
314- ! skipRemainingStages
342+ ! skipRebuildingBinaries
315343 }
316344 }
317345 agent {
@@ -338,7 +366,7 @@ pipeline {
338366 when {
339367 beforeAgent true
340368 expression {
341- ! skipRemainingStages
369+ ! skipRebuildingBinaries
342370 }
343371 }
344372 agent {
@@ -366,7 +394,7 @@ pipeline {
366394 when {
367395 beforeAgent true
368396 allOf {
369- expression { ! skipRemainingStages }
397+ expression { ! skipRebuildingBinaries }
370398 anyOf { buildingTag(); branch ' master' }
371399 }
372400 }
@@ -396,7 +424,7 @@ pipeline {
396424 when {
397425 beforeAgent true
398426 allOf {
399- expression { ! skipRemainingStages }
427+ expression { ! skipRebuildingBinaries }
400428 anyOf { buildingTag(); branch ' master' }
401429 }
402430 }
@@ -426,7 +454,7 @@ pipeline {
426454 when {
427455 beforeAgent true
428456 allOf {
429- expression { ! skipRemainingStages }
457+ expression { ! skipRebuildingBinaries }
430458 anyOf { buildingTag(); branch ' master' }
431459 }
432460 }
@@ -456,7 +484,7 @@ pipeline {
456484 when {
457485 beforeAgent true
458486 allOf {
459- expression { ! skipRemainingStages }
487+ expression { ! skipRebuildingBinaries }
460488 anyOf { buildingTag(); branch ' master' }
461489 }
462490 }
@@ -487,7 +515,7 @@ pipeline {
487515 when {
488516 beforeAgent true
489517 allOf {
490- expression { ! skipRemainingStages }
518+ expression { ! skipRebuildingBinaries }
491519 anyOf { buildingTag(); branch ' master' }
492520 }
493521 }
@@ -518,7 +546,7 @@ pipeline {
518546 when {
519547 beforeAgent true
520548 allOf {
521- expression { ! skipRemainingStages }
549+ expression { ! skipRebuildingBinaries }
522550 anyOf { buildingTag(); branch ' master' }
523551 }
524552 }
@@ -550,7 +578,7 @@ pipeline {
550578 when {
551579 beforeAgent true
552580 expression {
553- ! skipRemainingStages
581+ ! skipRebuildingBinaries
554582 }
555583 }
556584 agent {
@@ -583,6 +611,7 @@ pipeline {
583611 beforeAgent true
584612 allOf {
585613 expression { ! skipRemainingStages }
614+ expression { ! skipRebuildingBinaries }
586615 anyOf { buildingTag(); branch ' master' }
587616 }
588617 }
0 commit comments