Skip to content

Get the coverage

msporna edited this page Jan 8, 2019 · 18 revisions

prerequisites

Make sure you completed all of the LAVA setup steps prior to attempting to get the coverage

how to get the coverage : flow

  1. setup your project by detecting sources and injecting probes into it. The setup differs slightly for various project types:
  1. go to localhost:5000/dashboard (port 5000 is default port, can be changed via settings-look for settings page in this wiki to see how. LAVA should be running at this step already (if you didn't skip step1) but if it's not: do 'python instrument_server.py' from repo_root/server)
  2. there is a list of coverage sessions, if any created before, if not , the list will be empty for now
  3. note that currently you can have only 1 active session at the time
  4. Setup modules (required)
  5. Setup desired tags
  6. Setup users
  7. start a new test session:
    • click on 'Start new' button located on dashboard
    • you'll see popup:
    • fill all of the fields
      • name of the session must be unique
      • type in build number, must be integer build numbers are unique within tag but not across different tags. You can have one instance of let's say build [1] in tag [A] but you can have build [1] also in tag [B].
      • select tag, for example release name. Tag is like a parent for build numbers.
      • select owner of the session
    • choose at least one module - test coverage will be gathered only for source files related to the selected modules. For example, if you have settings and feature1 in tested app and select only settings module then code related to feature1 triggered by your tests will not be shown on the report. Only one related to settings. You'll get the coverage for it and will know more or less how much of settings your tests covered. You can also select all modules.
  8. run your automated tests or test manually
  9. coverage is being gathered as interaction with software injected with probes is made
  10. stop the session by clicking on a stop icon in the session's row. This can also be done directly via rest api if you want to automate it (see integration with ci)
  • keep in mind that by default test session can be ended if 10 seconds passed since stats stopped coming in. It can be changed to 0 to disable or to other time value in config table - see settings section (you'll get http 400 and error message that buffer time did not pass yet and you attempt to end session too soon. All you have to do is retry in a few seconds or keep retrying every x seconds and x depends from your config)
  1. click on a test session to view coverage report
  2. enjoy the coverage report.
Clone this wiki locally