imgui_bundle icon indicating copy to clipboard operation
imgui_bundle copied to clipboard

test engine logging and headless

Open csuckow opened this issue 1 year ago • 3 comments
trafficstars

Hi again!

I looked at the example for exporting the results and wanted to reproduce the same behavior in python with the following line: imgui.test_engine.get_io(hello_imgui.get_imgui_test_engine()).export_results_filename = "output_file.xml" However, it does not seem to be accessible at the moment. Is there a way to use the native logging with imgui_bundle? Also, I'd be really interested in a way to run the test engine headless, but I was not quite sure how to achieve that when using hello_imgui, so if you have any advice on this topic, I'd be very thankful.

Thanks a lot!

csuckow avatar Apr 30 '24 15:04 csuckow

Hi,

  • export_results_filename: this recent commit enables you to call export_results_filename_set(...)

  • headless: this commit lets you use a "null" backend

Example:

runner_params.platform_backend_type = hello_imgui.PlatformBackendType.null
runner_params.renderer_backend_type = hello_imgui.RendererBackendType.null

Please tell me if that helps

pthom avatar May 04 '24 05:05 pthom

Hi,

To get a successful export, you will need to do this:

    engine = hello_imgui.get_imgui_test_engine()

    engine.io.export_results_filename_set("output.xml")
    engine.io.export_results_format = imgui.test_engine.TestEngineExportFormat.j_unit_xml

This issue took me half a day of work. Can you give me more information about the context in which you are using the test engine?

Thanks!

pthom avatar May 06 '24 07:05 pthom

Hey there,

thank you very much for the effort, I really appreciate it. I'll test it as soon as I can next week when I'm back from my vacation, but this looks like it should do the trick.

For context: we have built a simple 3d viewer for debug purposes using just the pure python OpenGL backends. With the time, we have added more and more functionality, but are prone to regressions as we don't have any tests at the moment. That's why I'm experimenting with a prototype in hello-imgui to see if a migration to it would be feasible. I currently imagine some sort of headless automatized ui Tests and manual viewer tests whenever we changed something, as it probably still needs our OpenGL context. This is something I'll have to look into next week.

Again, thank you very much for your dedication to this project.

csuckow avatar May 06 '24 08:05 csuckow

I just tried out the newest version and this is working pretty well. Thanks a lot!🥇

csuckow avatar May 17 '24 15:05 csuckow