Pavel Labath via llvm-dev
2017-May-26 15:17 UTC
[llvm-dev] Running lit (googletest) tests remotely
Hello all, we are trying to convert some of the lldb tests to lit (for these specific tests we are using the googletest format). One of our requirements is that we are able to run these tests remotely, so that we are able to verify that we can debug e.g. android arm binaries even though our development environment runs x86 linux). As far as I am aware, right now there is no support for that in lit: running check-lldb-unit target in a cross-compile situation will attempt to run the run the test binaries as if they were native and fail horribly. Based on a not-too-detailed examination of the lit codebase, it does not seem that it would be too difficult to add this capability: During test discovery phase, we could copy the required files to the remote host. Then, when we run the test, we could just prefix the run command similarly to how it is done for running the tests under valgrind. It would be up to the user to provide a suitable command for copying and running files on the remote host (using rsync, ssh, telnet or any other transport he chooses). What do you think? Would something like that be a welcome addition to the llvm testing infrastructure? Has anyone tried to do something like that and hit major road blocks I did not anticipate? Or, if you have any suggestions on how to run tests in cross-compile setting differently, I'd love to hear about them. regards, pavel
Reid Kleckner via llvm-dev
2017-May-26 16:07 UTC
[llvm-dev] [lldb-dev] Running lit (googletest) tests remotely
You might want to look at the compiler-rt tests, which have support for remote runs. Search for the '%run' substitution. It's probably not directly applicable to gtest tests, though. On Fri, May 26, 2017 at 8:17 AM, Pavel Labath via lldb-dev < lldb-dev at lists.llvm.org> wrote:> Hello all, > > we are trying to convert some of the lldb tests to lit (for these > specific tests we are using the googletest format). One of our > requirements is that we are able to run these tests remotely, so that > we are able to verify that we can debug e.g. android arm binaries even > though our development environment runs x86 linux). > > As far as I am aware, right now there is no support for that in lit: > running check-lldb-unit target in a cross-compile situation will > attempt to run the run the test binaries as if they were native and > fail horribly. > > Based on a not-too-detailed examination of the lit codebase, it does > not seem that it would be too difficult to add this capability: During > test discovery phase, we could copy the required files to the remote > host. Then, when we run the test, we could just prefix the run command > similarly to how it is done for running the tests under valgrind. It > would be up to the user to provide a suitable command for copying and > running files on the remote host (using rsync, ssh, telnet or any > other transport he chooses). > > What do you think? Would something like that be a welcome addition to > the llvm testing infrastructure? Has anyone tried to do something like > that and hit major road blocks I did not anticipate? > > Or, if you have any suggestions on how to run tests in cross-compile > setting differently, I'd love to hear about them. > > regards, > pavel > _______________________________________________ > lldb-dev mailing list > lldb-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170526/c8469f5e/attachment.html>
Matthias Braun via llvm-dev
2017-May-26 18:11 UTC
[llvm-dev] Running lit (googletest) tests remotely
> On May 26, 2017, at 8:17 AM, Pavel Labath via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > Hello all, > > we are trying to convert some of the lldb tests to lit (for these > specific tests we are using the googletest format). One of our > requirements is that we are able to run these tests remotely, so that > we are able to verify that we can debug e.g. android arm binaries even > though our development environment runs x86 linux). > > As far as I am aware, right now there is no support for that in lit: > running check-lldb-unit target in a cross-compile situation will > attempt to run the run the test binaries as if they were native and > fail horribly. > > Based on a not-too-detailed examination of the lit codebase, it does > not seem that it would be too difficult to add this capability: During > test discovery phase, we could copy the required files to the remote > host. Then, when we run the test, we could just prefix the run command > similarly to how it is done for running the tests under valgrind. It > would be up to the user to provide a suitable command for copying and > running files on the remote host (using rsync, ssh, telnet or any > other transport he chooses).This seems to be the crux to me: What does "required files" mean? - All the executables mentioned in the RUN line? What llvm was compiled as a library, will we copy those too? - Can tests include other files? Do they need special annotations for that? As another example: The llvm-testsuite can perform remote runs (test-suite/litsupport/remote.py if you want to see the implementation) that code makes the assumption that the remote devices has an NFS mount so the relevant parts of the filesystem look alike on the host and remote device. I'm not sure that is the best solution as NFS introduces its own sort of flakiness and potential skew in I/O heavy benchmarks but it avoids the question of what to copy to the device. - Matthias
Mehdi AMINI via llvm-dev
2017-May-31 04:58 UTC
[llvm-dev] Running lit (googletest) tests remotely
2017-05-26 8:17 GMT-07:00 Pavel Labath via llvm-dev <llvm-dev at lists.llvm.org>:> Hello all, > > we are trying to convert some of the lldb tests to lit (for these > specific tests we are using the googletest format). One of our > requirements is that we are able to run these tests remotely, so that > we are able to verify that we can debug e.g. android arm binaries even > though our development environment runs x86 linux). > > As far as I am aware, right now there is no support for that in lit: > running check-lldb-unit target in a cross-compile situation will > attempt to run the run the test binaries as if they were native and > fail horribly. > > Based on a not-too-detailed examination of the lit codebase, it does > not seem that it would be too difficult to add this capability: During > test discovery phase, we could copy the required files to the remote > host. Then, when we run the test, we could just prefix the run command > similarly to how it is done for running the tests under valgrind. It > would be up to the user to provide a suitable command for copying and > running files on the remote host (using rsync, ssh, telnet or any > other transport he chooses). > > What do you think? Would something like that be a welcome addition to > the llvm testing infrastructure? Has anyone tried to do something like > that and hit major road blocks I did not anticipate? >You may have a look at libcxx/utils/libcxx/test/executor.py ; it contains a "SSHExecutor" that can be used when running the lit tests for libcxx. -- Mehdi -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170530/48c00b90/attachment.html>
Pavel Labath via llvm-dev
2017-May-31 11:06 UTC
[llvm-dev] Running lit (googletest) tests remotely
Thank you all for the pointers. I am going to look at these to see if there is anything that we could reuse, and come back. In the mean time, I'll reply to Mathiass's comments: On 26 May 2017 at 19:11, Matthias Braun <mbraun at apple.com> wrote:>> Based on a not-too-detailed examination of the lit codebase, it does >> not seem that it would be too difficult to add this capability: During >> test discovery phase, we could copy the required files to the remote >> host. Then, when we run the test, we could just prefix the run command >> similarly to how it is done for running the tests under valgrind. It >> would be up to the user to provide a suitable command for copying and >> running files on the remote host (using rsync, ssh, telnet or any >> other transport he chooses). > > This seems to be the crux to me: What does "required files" mean? > - All the executables mentioned in the RUN line? What llvm was compiled as a library, will we copy those too?For executables, I was considering just listing them explicitly (in lit.local.cfg, I guess), although parsing the RUN line should be possible as well. Even with RUN parsing, I expect we would some way to explicitly add files to the copy list (e.g. for lldb tests we also need to copy the program we are going to debug). As for libraries, I see a couple of solutions: - declare these configurations unsupported for remote executions - copy over ALL shared libraries - have automatic tracking of runtime dependencies - all of this information should pass through llvm_add_library macro, so it should be mostly a matter of exporting this information out of cmake. These can be combined in the sense that we can start in the "unsupported" state, and then add some support for it once there is a need for it (we don't need it right now).> - Can tests include other files? Do they need special annotations for that?My initial idea was to just copy over all files in the Inputs folder. Do you know of any other dependencies that I should consider?> > As another example: The llvm-testsuite can perform remote runs (test-suite/litsupport/remote.py if you want to see the implementation) that code makes the assumption that the remote devices has an NFS mount so the relevant parts of the filesystem look alike on the host and remote device. I'm not sure that is the best solution as NFS introduces its own sort of flakiness and potential skew in I/O heavy benchmarks but it avoids the question of what to copy to the device.Requiring an NFS mount is a non-starter for us (no way to get an android device to create one), although if we would be able to hook in a custom script which does a copy to simulate the "mount", we might be able to work with it. Presently I am mostly thinking about correctness tests, and I am not worried about benchmark skews regards, pl