diff --git a/common/rfb/benchmark.cxx b/common/rfb/benchmark.cxx index 8f8946e..f4ec3dd 100644 --- a/common/rfb/benchmark.cxx +++ b/common/rfb/benchmark.cxx @@ -181,9 +181,21 @@ void benchmark(const std::string &path) { auto add_benchmark_item = [&doc, &test_suit, &total_tests](const char *name, auto value) { auto *test_case = doc.NewElement("testcase"); test_case->SetAttribute("name", name); - test_case->SetAttribute("filename", value); + test_case->SetAttribute("file", value); test_case->SetAttribute("runs", 1); test_case->SetAttribute("classname", "KasmVNC"); + + auto *props = doc.NewElement("properties"); + + auto *prop = doc.NewElement("property"); + prop->SetAttribute("name", name); + props->InsertEndChild(prop); + + prop = doc.NewElement("property"); + prop->SetAttribute("value", value); + props->InsertEndChild(prop); + + test_case->InsertEndChild(props); test_suit->InsertEndChild(test_case); ++total_tests; diff --git a/spec/vncserver_adv_benchmarking_spec.py b/spec/vncserver_adv_benchmarking_spec.py index 053eeb2..2b805ca 100644 --- a/spec/vncserver_adv_benchmarking_spec.py +++ b/spec/vncserver_adv_benchmarking_spec.py @@ -1,6 +1,6 @@ from mamba import description, context, it, fit, before, after from expects import expect, equal, contain, match -from helper.spec_helper import run_cmd, clean_env, kill_xvnc, clean_locks +from helper.spec_helper import run_cmd, clean_env, kill_xvnc with description("Benchmarking"): with before.each: @@ -10,4 +10,6 @@ with description("Benchmarking"): with it("runs benchmarks"): run_cmd("wget --no-check-certificate https://kasmweb-build-artifacts.s3.us-east-1.amazonaws.com/kasmvnc/static/127072-737747495_small.mp4 -O /tmp/video.mp4") completed_process = run_cmd("Xvnc -interface 0.0.0.0 :1 -Benchmark /tmp/video.mp4") + command = '''sed -i "s/KasmVNC/$(grep -E '^ID=' /etc/os-release | cut -d= -f2 | tr -d '"') $(grep -E '^VERSION_CODENAME=' /etc/os-release | cut -d= -f2 | tr -d '"')/g" Benchmark.xml''' + run_cmd(command) expect(completed_process.returncode).to(equal(0))