Skip to content

Add go unit tests to our CI

Rasmus Dahlberg requested to merge rgdd/repair-unit-tests into main

TL;DR: make whatever unit tests we have run in our CI. It might make sense to review each small commit (since it's split into 4 separate ones) rather than using the "Changes" UI.

The slightly longer description:

  1. Minor renaming
  2. Make the tests that require sudo work again (EFI-NVRAM spraying)
  3. Put the tests that require sudo in comments because that's not a nice thing to run on one's computer and complicates the CI setup. Yes, this basically undo:s the changes fixed in (2), but at least it is possible to run that if you really want to (by removing the comments).
  4. Finally run the tests that we do have in our CI.

Not perfect by any means, but I prefer running everything we can in our CI and is happy to a larger overhaul of stprov unit tests at some point in the future.

FWIW: I'm open to other suggestions than the above, e.g., options I see: completely drop the tests that we're not planning to run in our CI instead of putting them in comments; or make the CI be able to handle EFI-NVRAM writes somehow. I would like to avoid excessive refactoring of things at this stage and just do the bare minimum to make unit tests run again, and for them to be run:able in our CI.

A historical comment: why would anyone put spraying of EFI-NVRAM in unit tests like this? Because that's what was not working at some point due to u-root bugs.

Closes #12 (closed).

Edited by Rasmus Dahlberg

Merge request reports