Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hypervisor updates: Mainly test coverage #49

Merged
merged 10 commits into from
Feb 7, 2025
Merged

Hypervisor updates: Mainly test coverage #49

merged 10 commits into from
Feb 7, 2025

Conversation

MofX
Copy link
Collaborator

@MofX MofX commented Feb 6, 2025

Changes

Changes affecting everything:

  • exclude protocol classes from coverage analysis
  • Update devcontainer to 1.4.11

Some minor function changes to the hypervisor generator:

  • keep trailing newline in jinja templates
  • change order of includes to be top-button and depth-first
  • use builtin modules.list.j2

Apert from that this PR mainly increase the test coverage for the hypervisor config generator to100%.
There are also some tests now, that do end-to-end testing. That is providing a config file and an extension folder and verifying the generated files against expected results.

Dependencies:

None

Tests results

Not part of robot tests

Developer Checklist:

  • Test: Changes are tested
  • Git: Informative git commit message(s)

Reviewer checklist:

  • Review: Changes are reviewed
  • Review: Tested by the reviewer

MofX added 10 commits February 5, 2025 09:56
A protocoll class is never executed and contains only signatures of function.
This exclude all classes that are derived only from Protocol from the coverage report
Jinja by-default strips all newlines at the end of the output.
For conformance reasons, the last new line shouldn't be stripped
I.e. move the conversion to path out of the function.
That simplifies the tests and increases readability.
There is no need to keep the parameter around.
It is empty anyway.
modules is a set and the order of elements in a set is not derministic in python.
So covnert it to a property and return a sorted list for rendering in jinja
 * mark class variables as ClassVar
 * remove typo in invalid enum message
 * change type check for values to be exact instead of isinstance (bool is an instance of int, but should fail)
 * Report all missing keys instead of terminating for the first missing key
 * Make messages deterministic by sorting the values
Previously the incldues were parsed depth-first but bottom-top.
I.e. the list in base in each file was parsed in the wrong and unintuitive order.

In the example
```
bases:
 - file_a
 - file_b
 ```
 One would expect a value that is set in file_a and file_b will be used from file_b,
 but it was the other way around.
The file exists and can very well be used if it is not overwritten by a specialization.
This shouldn't do any harm, because all configurations that use the generator
ship their own modules.list.j2
This excludes some lines from the coverage report, that just cannot be tested
either because they are only possible in theory (and mypy would complain without a condition)
or because they are only called in special szenarios (i.e. `if __name__ == "__main__":`)
@MofX
Copy link
Collaborator Author

MofX commented Feb 6, 2025

I will test the changes again using the ebclfsa sample later. Please do not merge before I verified, that nothing is borken

@MofX
Copy link
Collaborator Author

MofX commented Feb 6, 2025

I will test the changes again using the ebclfsa sample later. Please do not merge before I verified, that nothing is borken

With #50 merged, this works fine -> Ready to merge

@MofX MofX requested review from simone-weiss and thir820 February 6, 2025 14:08
@MofX MofX force-pushed the hypervisor_updates branch 2 times, most recently from b95c8b6 to 9171b6d Compare February 6, 2025 14:30
@MofX MofX merged commit 00462d6 into main Feb 7, 2025
2 checks passed
@MofX MofX deleted the hypervisor_updates branch February 7, 2025 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants