PlotJuggler CI with build from source (#20166)
* CI attempt
* fixing location
* fix
* fixes
* hardcode test_url for CI
* fixes
* cd fix
* Update tools/plotjuggler/juggle.py
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
* Update tools/plotjuggler/test_plotjuggler.py
* fixes
* fixes
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 9144dd7c2f
commatwo_master
parent
d74d0d69b3
commit
36ecc144ff
5 changed files with 76 additions and 10 deletions
@ -1,6 +1,12 @@ |
||||
#!/bin/bash -e |
||||
|
||||
sudo snap install plotjuggler |
||||
mkdir -p bin |
||||
cd bin |
||||
|
||||
wget https://github.com/commaai/PlotJuggler/releases/download/latest/libDataLoadRlog.so.tar.gz |
||||
tar -xf libDataLoadRlog.so.tar.gz |
||||
rm libDataLoadRlog.so.tar.gz |
||||
|
||||
wget https://github.com/commaai/PlotJuggler/releases/download/latest/plotjuggler.tar.gz |
||||
tar -xf plotjuggler.tar.gz |
||||
rm plotjuggler.tar.gz |
||||
|
@ -0,0 +1,40 @@ |
||||
#!/usr/bin/env python3 |
||||
import os |
||||
import signal |
||||
import subprocess |
||||
import time |
||||
import unittest |
||||
|
||||
from common.basedir import BASEDIR |
||||
from common.timeout import Timeout |
||||
from selfdrive.test.openpilotci import get_url |
||||
|
||||
class TestPlotJuggler(unittest.TestCase): |
||||
|
||||
def test_install(self): |
||||
exit_code = os.system(os.path.join(BASEDIR, "tools/plotjuggler/install.sh")) |
||||
self.assertEqual(exit_code, 0) |
||||
|
||||
def test_run(self): |
||||
|
||||
test_url = get_url("ffccc77938ddbc44|2021-01-04--16-55-41", 0) |
||||
|
||||
# Launch PlotJuggler with the executable in the bin directory |
||||
os.environ["PLOTJUGGLER_PATH"] = f'{os.path.join(BASEDIR, "tools/plotjuggler/bin/plotjuggler")}' |
||||
p = subprocess.Popen(f'QT_QPA_PLATFORM=offscreen {os.path.join(BASEDIR, "tools/plotjuggler/juggle.py")} \ |
||||
"{test_url}"', stderr=subprocess.PIPE, shell=True, |
||||
start_new_session=True) |
||||
|
||||
# Wait max 60 seconds for the "Done reading Rlog data" signal from the plugin |
||||
output = "\n" |
||||
with Timeout(60, error_msg=output): |
||||
while output.splitlines()[-1] != "Done reading Rlog data": |
||||
output += p.stderr.readline().decode("utf-8") |
||||
|
||||
# ensure plotjuggler didn't crash after exiting the plugin |
||||
time.sleep(15) |
||||
self.assertEqual(p.poll(), None) |
||||
os.killpg(os.getpgid(p.pid), signal.SIGTERM) |
||||
|
||||
if __name__ == "__main__": |
||||
unittest.main() |
Loading…
Reference in new issue