.appveyor.yml 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. version: "#{build}"
  2. pull_requests:
  3. do_not_increment_build_number: true
  4. clone_depth: 5
  5. cache:
  6. - C:\projects\binaries -> .appveyor.yml, .appveyor
  7. configuration:
  8. - Release
  9. - Debug
  10. before_build:
  11. - cmd: call .appveyor\appveyor_helper.bat %CONFIGURATION%
  12. build_script:
  13. - cmd: call "%VS90COMNTOOLS%vsvars32.bat"
  14. - cmd: vcbuild win_configure\pbs_windows_VS2008.sln "%CONFIGURATION%|Win32"
  15. after_build:
  16. - cmd: call .appveyor\generate_installer.bat %CONFIGURATION%
  17. before_test:
  18. - cmd: net user %USERNAME% pbS@123
  19. - ps: copy c:\projects\win_build\msi\PBSPro_*.msi PBSPro.msi
  20. - cmd: msiexec /quiet /qn /norestart /i c:\projects\pbspro\PBSPro.msi
  21. - cmd: refreshenv
  22. - cmd: C:\PROGRA~2\PBS\exec\python\python.exe C:\PROGRA~2\PBS\exec\etc\win_postinstall.py -u %USERNAME% -p pbS@123
  23. test_script:
  24. - ps: . C:\projects\pbspro\.appveyor\Retry-Command.ps1
  25. - ps: pbs_password ${Env:USERNAME} pbS@123
  26. - ps: qstat -Bf
  27. - ps: qstat -Qf
  28. - ps: pbsnodes -av
  29. - ps: qmgr -c "s s acl_roots = ${Env:USERNAME}"
  30. - ps: qmgr -c "c h simple_hook event = 'resvsub,resv_end,queuejob,movejob,modifyjob,runjob,periodic,execjob_begin,execjob_prologue,execjob_launch,execjob_attach,execjob_preterm,execjob_epilogue,execjob_end,exechost_startup,exechost_periodic', freq = 35"
  31. - ps: qmgr -c "i h simple_hook application/x-python default C:\projects\pbspro\.appveyor\simple_hook.py"
  32. - ps: qmgr -c "l h"
  33. - ps: $TODAY=Get-Date -UFormat "%Y%m%d"
  34. - ps: Retry-Command { grep -Hn 'successfully sent hook file' C:\PROGRA~2\PBS\home\server_logs\$TODAY }
  35. - ps: Retry-Command { grep -Hn 'copy hook-related file request received' C:\PROGRA~2\PBS\home\mom_logs\$TODAY }
  36. - ps: qmgr -c "c r myncpus type=long,flag=nh"
  37. - ps: qmgr -c "s n ${Env:COMPUTERNAME} resources_available.myncpus = 2"
  38. - ps: (Get-Content C:\PROGRA~2\PBS\home\sched_priv\sched_config).Replace(', eoe"', ', eoe, myncpus"') | Set-Content C:\PROGRA~2\PBS\home\sched_priv\sched_config
  39. - ps: net stop pbs_sched
  40. - ps: net start pbs_sched
  41. - ps: qmgr -c "s q workq started = False"
  42. - ps: $current_time = (Get-Date)
  43. - ps: $next_min = $current_time.AddSeconds(10)
  44. - ps: $current_time.ToString();$next_min.ToString()
  45. - ps: pbs_rsub -lselect=myncpus=2 -R $next_min.ToString("ddHHmm.ss") -D 00:00:15
  46. - ps: pbs_rstat -f
  47. - ps: pbs_rstat -f | grep -E '^Resource_List.ncpus = 1$'
  48. - ps: pbs_rstat -f | grep -E '^Resource_List.myncpus = 2$'
  49. - ps: qsub -f -l myncpus=1 -- pbs_attach -c pbsdsh hostname
  50. - ps: qstat -f
  51. - ps: qstat -f | grep -E '^ job_state = Q$'
  52. - ps: qstat -f | grep -E '^ queue = workq$'
  53. - ps: qstat -f | grep -E '^ Resource_List.ncpus = 1$'
  54. - ps: qstat -f | grep -E '^ Resource_List.myncpus = 1$'
  55. - ps: qstat -f | grep -E '^ Submit_arguments = -f -l myncpus=1 -- pbs_attach -c pbsdsh hostname$'
  56. - ps: qalter -lmyncpus=2 1
  57. - ps: qstat -f | grep -E '^ Resource_List.ncpus = 1$'
  58. - ps: qstat -f | grep -E '^ Resource_List.myncpus = 2$'
  59. - ps: qmove R0 1
  60. - ps: qstat -f | grep -E '^ queue = R0$'
  61. - ps: qmgr -c "s s scheduling = True"
  62. - ps: qstat -f
  63. - ps: Retry-Command {
  64. if ((qstat -f | Measure-Object -Character).Characters -gt 0) {
  65. throw
  66. }
  67. } -Timeout 5000
  68. - ps: Retry-Command {
  69. if ((pbs_rstat -f | Measure-Object -Character).Characters -gt 0) {
  70. throw
  71. }
  72. } -Timeout 5000
  73. - ps: tracejob 1
  74. - cmd: dir STDIN*
  75. - cmd: hostname > my
  76. - cmd: diff my STDIN.o1
  77. - ps: Retry-Command { grep -Hn 'hook event type is resvsub' C:\PROGRA~2\PBS\home\server_logs\$TODAY }
  78. - ps: Retry-Command { grep -Hn 'hook event type is resv_end' C:\PROGRA~2\PBS\home\server_logs\$TODAY }
  79. - ps: Retry-Command { grep -Hn 'hook event type is queuejob' C:\PROGRA~2\PBS\home\server_logs\$TODAY }
  80. - ps: Retry-Command { grep -Hn 'hook event type is movejob' C:\PROGRA~2\PBS\home\server_logs\$TODAY }
  81. - ps: Retry-Command { grep -Hn 'hook event type is modifyjob' C:\PROGRA~2\PBS\home\server_logs\$TODAY }
  82. - ps: Retry-Command { grep -Hn 'hook event type is execjob_begin' C:\PROGRA~2\PBS\home\mom_logs\$TODAY }
  83. - ps: Retry-Command { grep -Hn 'hook event type is execjob_prologue' C:\PROGRA~2\PBS\home\mom_logs\$TODAY }
  84. - ps: Retry-Command { grep -Hn 'hook event type is execjob_launch' C:\PROGRA~2\PBS\home\mom_logs\$TODAY }
  85. - ps: Retry-Command { grep -Hn 'hook event type is execjob_attach' C:\PROGRA~2\PBS\home\mom_logs\$TODAY }
  86. - ps: Retry-Command { grep -Hn 'hook event type is execjob_epilogue' C:\PROGRA~2\PBS\home\mom_logs\$TODAY }
  87. - ps: Retry-Command { grep -Hn 'hook event type is execjob_end' C:\PROGRA~2\PBS\home\mom_logs\$TODAY }
  88. - ps: qmgr -c "s q workq started = True"
  89. - ps: qmgr -c "c q equeue queue_type = Execution"
  90. - ps: qmgr -c "s q equeue priority = 151"
  91. - ps: qmgr -c "s q equeue enabled = True"
  92. - ps: qmgr -c "s q equeue started = True"
  93. - ps: qmgr -c "c q rqueue queue_type = Route"
  94. - ps: qmgr -c "s q rqueue route_destinations = equeue@${Env:COMPUTERNAME}"
  95. - ps: qmgr -c "s q rqueue enabled = True"
  96. - ps: qmgr -c "s q rqueue started = False"
  97. - ps: qsub -f -l myncpus=2 -- pbs_sleep 1000
  98. - ps: qstat -f 2 | grep -E '^ queue = workq$'
  99. - ps: qstat -f 2 | grep -E '^ Resource_List.myncpus = 2$'
  100. - ps: Retry-Command {
  101. qstat -f 2 | grep -E '^ job_state = R$';
  102. $err1 = $LastExitCode;
  103. qstat -f 2 | grep -E '^ substate = 42$';
  104. $err2 = $LastExitCode;
  105. if ($err1 -ne 0 -or $err2 -ne 0) {
  106. qmgr -c "s s scheduling = True";
  107. throw
  108. }
  109. }
  110. - ps: qsub -f -q rqueue -l myncpus=2 -- pbs_sleep 1000
  111. - ps: qstat -f 3 | grep -E '^ queue = rqueue$'
  112. - ps: qstat -f 3 | grep -E '^ Resource_List.myncpus = 2$'
  113. - ps: qmgr -c "s q rqueue started = True"
  114. - ps: Retry-Command {
  115. qstat -f 3 | grep -E '^ queue = equeue$';
  116. if ($LastExitCode -ne 0) {
  117. qmgr -c "s s scheduling = True";
  118. throw
  119. }
  120. } -Timeout 2000
  121. - ps: Retry-Command {
  122. qstat -f 3 | grep -E '^ job_state = R$';
  123. $err1 = $LastExitCode;
  124. qstat -f 3 | grep -E '^ substate = 42$';
  125. $err2 = $LastExitCode;
  126. qstat -f 2 | grep -E '^ job_state = S$';
  127. $err3 = $LastExitCode;
  128. if ($err1 -ne 0 -or $err2 -ne 0 -or $err3 -ne 0) {
  129. qmgr -c "s s scheduling = True";
  130. throw
  131. }
  132. } -Timeout 2000
  133. - ps: qstat -f 2
  134. - ps: qdel 3
  135. - ps: Retry-Command {
  136. qstat -f 2 | grep -E '^ job_state = R$';
  137. $err1 = $LastExitCode;
  138. qstat -f 2 | grep -E '^ substate = 42$';
  139. $err2 = $LastExitCode;
  140. if ($err1 -ne 0 -or $err2 -ne 0) {
  141. qmgr -c "s s scheduling = True";
  142. throw
  143. }
  144. } -Timeout 5000
  145. - ps: qsub -J1-2 -f -- pbs_sleep 1000
  146. - ps: Retry-Command {
  147. if ((Get-Process pbs_sleep).Length -ne 2) {
  148. qmgr -c "s s scheduling = True";
  149. throw
  150. }
  151. } -Timeout 2000
  152. - ps: qdel 2 4[]
  153. - ps: Retry-Command { grep -Hn 'hook event type is execjob_preterm' C:\PROGRA~2\PBS\home\mom_logs\$TODAY }
  154. - ps: Retry-Command {
  155. if ((qstat -f | Measure-Object -Character).Characters -gt 0) {
  156. throw
  157. }
  158. } -Timeout 5000
  159. # Uncomment below 3 line once https://pbspro.atlassian.net/browse/PP-1298 and https://pbspro.atlassian.net/browse/PP-1299 gets fixed
  160. # - ps: net stop pbs_mom
  161. # - ps: net start pbs_mom
  162. # - ps: Retry-Command { grep -Hn 'hook event type is exechost_startup' C:\PROGRA~2\PBS\home\mom_logs\$TODAY }
  163. - ps: Start-Sleep -Seconds 40
  164. - ps: Retry-Command { grep -Hn 'hook event type is exechost_periodic' C:\PROGRA~2\PBS\home\mom_logs\$TODAY }
  165. # Uncomment below line once https://pbspro.atlassian.net/browse/PP-1302 get fixed
  166. # - ps: Retry-Command { grep -Hn 'hook event type is periodic' C:\PROGRA~2\PBS\home\server_logs\$TODAY }
  167. - ps: cmd /c "grep -Hn 'hook event type is unknown' C:\PROGRA~2\PBS\home\mom_logs\$TODAY && exit /b 1 || exit /b 0"
  168. after_test:
  169. - ps: rm PBSPro.msi
  170. - ps: copy c:\projects\win_build\msi\PBSPro_*.msi .
  171. artifacts:
  172. - path: '*.msi'
  173. deploy: off