This is an archive of the discontinued LLVM Phabricator instance.

Added utility to launch tests on a target remotely.
ClosedPublic

Authored by aorlov on Oct 13 2020, 4:32 PM.

Details

Summary

Runs an executable on a remote host.
This is meant to be used as an executor when running the LLVM and the Libraries tests on a target.

This follows the discussion in https://reviews.llvm.org/D83429, and the code is based on libcxx/utils/ssh.py.

Diff Detail

Event Timeline

aorlov created this revision.Oct 13 2020, 4:32 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 13 2020, 4:32 PM
aorlov requested review of this revision.Oct 13 2020, 4:32 PM
aorlov updated this revision to Diff 298750.Oct 16 2020, 2:04 PM

Changed the parameter --test-executable to --exec-pattern;
Used regex instead of fnmatch;
Fixed bugs that appeared in case of complicated command line.
Note I used the following command line for tests:
python remote-exec.py --host user@host --execdir llvm-project/build/runtimes/runtimes-bins/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/Output/cin.sh.cpp.dir --codesign_identity "" --env "" -- echo "123" "|" llvm-project/build/runtimes/runtimes-bins/libcxx/test/std/input.output/iostream.objects/narrow.stream.objects/Output/cin.sh.cpp.dir/t.tmp.exe ">" t.tmp.out "&&" grep -e "The number is 123!" t.tmp.out

vvereschaka accepted this revision.Oct 22 2020, 8:31 PM

LGTM,

also tested with the aarch64/armv7 compiler-rt tests on Windows cross builders.

This revision is now accepted and ready to land.Oct 22 2020, 8:31 PM

Do we still need this utility if we add --test-executable (or as you did --exec-pattern) to the original libcxx ssh.py?

Do we still need this utility if we add --test-executable (or as you did --exec-pattern) to the original libcxx ssh.py?

Note, what happened is that I spoke with @broadwaylamb offline and he made a point that supporting --test-executable was worthwhile, and it would remove existing hacks in ssh.py. In the meantime, I also came across other use cases that would be helped by having --test-executable, which is why I came back and changed my mind on D83429.

Since we use this utility in multiple projects now, it is better to have it outside the libc++ project, so we would not introduce unneeded inter-project dependencies just because of shared tools.

It might make sense to change the libc++ tests to use this utility, to remove the redundancy. I’ll be glad to propose a patch for that if you would like me to. Please let me know.

Since we use this utility in multiple projects now, it is better to have it outside the libc++ project, so we would not introduce unneeded inter-project dependencies just because of shared tools.

It might make sense to change the libc++ tests to use this utility, to remove the redundancy. I’ll be glad to propose a patch for that if you would like me to. Please let me know.

Out of curiosity, where do you use it?

This revision was landed with ongoing or failed builds.Oct 23 2020, 9:53 AM
This revision was automatically updated to reflect the committed changes.