<div dir="ltr">Awesome!<div><br></div><div>As a contributor, what I am I supposed to do when a test fails due to some error of mine?</div><div>What's the procedure to be able to run a test "under my own control" (be able to see what's actually being executed, and what's failing in the diff) so that I can fix my error? <br></div><div>That is, I want to be able to "back out of the test harness" to be able to debug a failure myself.</div><div><br></div><div>This following is what I would try, given my limited knowledge of how things work and after a quick scan of the docs. Is this as intended or is there an easier way?</div><div><br></div><div>--------------------------------------------------</div><div><br></div><div>I make some seemingly-innocuous changes to the code. (In this case I literally change nothing in master.)<br></div><div><br></div><div>I want to run all the tests to make sure I didn't break something that I don't understand, so I look at the User Manual and copy and run this command: </div><div><br></div>   make -f gmakefile.test test<div><br></div><div>I go away for a while and come back and see that some (3) tests have failed, and that the harness gives me instructions on how to re-run them. </div><div><br></div><div><div>    # -------------</div><div>    #   Summary</div><div>    # -------------</div><div>    # FAILED ts_tutorials-ex11_adv_2d_quad_0 diff-sys_classes_viewer_tests-ex4_4 ts_tutorials-ex11_adv_2d_quad_1</div><div>    # success 3051/3915 tests (77.9%)</div><div>    # failed 3/3915 tests (0.1%)</div><div>    # todo 91/3915 tests (2.3%)</div><div>    # skip 770/3915 tests (19.7%)</div><div>    #</div><div>    # To rerun failed tests:</div><div>    #     /opt/local/bin/gmake -f gmakefile test search='ts_tutorials-runex11_adv_2d_quad_0 sys_classes_viewer_tests-runex4_4 ts_tutorials-runex11_adv_2d_quad'</div></div><div><br></div><div>I want to take a look at the output so I can see what's happening - I see that I'm given instructions on how to get more verbose output, so I run one of the tests again with V=1 : </div><div><br></div><div>    /opt/local/bin/gmake V=1 -f gmakefile test search='ts_tutorials-runex11_adv_2d_quad_0'<br></div><div><br></div><div>This tells me that this is failing because of a timeout</div><div><br></div><div>    #<span class="gmail-Apple-tab-span" style="white-space:pre">        </span>Exceeded timeout limit of 60 s</div><div><br></div>I poke around in the dev manual (note that "make -f gmakefile help" and "make -f gmakefile.test help" say nothing about TIMEOUT as promised) <div>and eventually run</div><div><br></div><div>     /opt/local/bin/gmake V=1 TIMEOUT=1000 -f gmakefile test search='ts_tutorials-runex11_adv_2d_quad_0'</div><div><br></div><div>and get success. Sweet - my assumption that this failed because I'm running a debug build on a slow laptop is confirmed.</div><div><br></div><div>    # -------------</div><div>    #   Summary</div><div>    # -------------</div><div>   # success 2/2 tests (100.0%)</div><div>    # failed 0/2 tests (0.0%)</div><div>    # todo 0/2 tests (0.0%)</div><div>    # skip 0/2 tests (0.0%)</div><div><br></div><div>I then look at the other failed test. </div><div><br></div><div>     /opt/local/bin/gmake V=1 -f gmakefile test search='sys_classes_viewer_tests-runex4_4'</div><div><br></div><div>This one seems to be failing because of the diff:</div><div><br><div>    arch-darwin-master-double-debug/tests/src/sys/classes/viewer/examples/tests/runex4_4.sh  -v</div><div>    ok sys_classes_viewer_tests-ex4_4 cat ex4_4.tmp | > /dev/null; cat ex4a1.tmp > ex4_4.tmp.tmp 2>> runex4_4.err && mv ex4_4.tmp.tmp ex4_4.tmp</div><div>    not ok diff-sys_classes_viewer_tests-ex4_4 /Users/patrick/petsc-master/bin/petscdiff  /Users/patrick/petsc-master/src/sys/classes/viewer/examples/tests/output/ex4a.out ex4_4.tmp > diff-runex4_4.out 2> diff-runex4_4.out</div><div>    #<span class="gmail-Apple-tab-span" style="white-space:pre">  </span>2a3,14</div><div>    #<span class="gmail-Apple-tab-span" style="white-space:pre">  </span>> Testing PetscViewerASCIIPrintf 0</div><div>    #<span class="gmail-Apple-tab-span" style="white-space:pre">   </span>> Testing PetscViewerASCIIPrintf 1</div><div>    #<span class="gmail-Apple-tab-span" style="white-space:pre">   </span>> Testing PetscViewerASCIIPrintf 0</div><div>    #<span class="gmail-Apple-tab-span" style="white-space:pre">   </span>> Testing PetscViewerASCIIPrintf 1</div><div>    #<span class="gmail-Apple-tab-span" style="white-space:pre">   </span>> Testing PetscViewerASCIIPrintf 0</div><div>    #<span class="gmail-Apple-tab-span" style="white-space:pre">   </span>> Testing PetscViewerASCIIPrintf 1</div><div>    #<span class="gmail-Apple-tab-span" style="white-space:pre">   </span>> Testing PetscViewerASCIIPrintf 0</div><div>    #<span class="gmail-Apple-tab-span" style="white-space:pre">   </span>> Testing PetscViewerASCIIPrintf 1</div><div>    #<span class="gmail-Apple-tab-span" style="white-space:pre">   </span>> Testing PetscViewerASCIIPrintf 0</div><div>    #<span class="gmail-Apple-tab-span" style="white-space:pre">   </span>> Testing PetscViewerASCIIPrintf 1</div><div>    #<span class="gmail-Apple-tab-span" style="white-space:pre">   </span>> Testing PetscViewerASCIIPrintf 0</div><div>    #<span class="gmail-Apple-tab-span" style="white-space:pre">   </span>> Testing PetscViewerASCIIPrintf 1</div><div><br></div><div>I go to take a look at the output of the test to see if I can run the actual executable myself. </div><div><br></div><div>  cd arch-darwin-master-double-debug/tests/src/sys/classes/viewer/examples/tests</div></div><div><br></div><div>runex4_4.sh in that directory isn't so informative as far as the command I should run. It does tell me where I might look for reference output, though</div><div><br></div><div>     /Users/patrick/petsc-master/src/sys/classes/viewer/examples/tests/output/ex4a.out</div><div><br></div><div> If I look in the runex4_4 directory, I find sys_classes_viewer_tests-ex4_4.sh which gives me something to copy and paste and use my actual knowledge/reasoning to fix:</div><div><br></div><div>   /Users/patrick/petsc-master/arch-darwin-master-double-debug/bin/mpiexec  -n 1 ../ex4 -myviewer ascii:ex4a1.tmp::append<br></div><div><br></div><div>(I'm not going to try to debug this failure further, but I'm confident I'd be able to given the information I have now)<br></div><div><br></div><div>This is pretty close to what I want, which is a way to "back out of the test harness" to be able to debug the failed test myself. I was hoping that running this from the PETSc root directory would more directly tell me that:</div><div><br></div><div>   arch-darwin-master-double-debug/tests/src/sys/classes/viewer/examples/tests/runex4_4.sh  -v</div><div><br></div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2018-01-25 5:47 GMT+01:00 Smith, Barry F. <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
   PETSc developers,<br>
<br>
     We have completed moving all PETSc examples over from the old test system (where tests were written in the makefile) to a new system, provided by Scott Kruger, where the test rules are written in bottom of the source file of the example. Directions for usage and adding new tests can be found in the PETSc developers manual <a href="http://www.mcs.anl.gov/petsc/petsc-dev/docs/developers.pdf" rel="noreferrer" target="_blank">http://www.mcs.anl.gov/petsc/<wbr>petsc-dev/docs/developers.pdf</a> chapter 7.<br>
<span class="HOEnZb"><font color="#888888"><br>
  Barry<br>
<br>
<br>
</font></span></blockquote></div><br></div>