robotframework-jupyterlibrary icon indicating copy to clipboard operation
robotframework-jupyterlibrary copied to clipboard

Add coverage keywords

Open bollwyvl opened this issue 2 years ago • 0 comments

Elevator Pitch

Capture client, server, and kernel coverage with robot tests.

Motivation

Being able to gather fine-grained coverage of JS, python, and maybe other languages from a single test increases the value of executed robot tests.

Design Ideas

Client coverage:

  • https://github.com/deathbeds/jyg/blob/v0.1.2/atest/resources/Coverage.resource
    • this requires a labextension to have been built with e.g.
      • https://github.com/deathbeds/jyg/blob/v0.1.2/package.json#L41
      • https://github.com/deathbeds/jyg/blob/v0.1.2/webpack.config.js#L11

Server coverage:

  • https://github.com/deathbeds/jyg/blob/v0.1.2/atest/suites/lab/init.robot#L45

Kernel coverage could be gathered by copyinh a custom kernel.json, and adding some more data:

{
 "argv": [
  "$PREFIX/bin/python",
  "-m",
  "coverage", "run", "-m", // ... add this line, with more args
  "ipykernel_launcher",
  "-f",
  "{connection_file}"
 ],
 "display_name": "Python 3 (ipykernel)", // add the context name?
 "language": "python",
 "metadata": {
  "debugger": true
 }
}

Finally, some reporting keywords could be added, optionally embedding the reports inside the robot HTML if they can be generated as a single file.

bollwyvl avatar Feb 15 '23 02:02 bollwyvl