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

test: fix the testcase strings to not include osinfo_template #680

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mvo5
Copy link
Collaborator

@mvo5 mvo5 commented Oct 17, 2024

This commit fixes the testcase string representation to not include the osinfo_template string and adds a test case to not accidentally regress here. Currently our test case strings look like:

<Dir bootc-image-builder>
  <Dir test>
    <Module test_build.py>
      <Function test_container_builds>
      <Function test_image_is_generated[quay.io/centos-bootc/centos-bootc:stream9,qcow2+raw+vmdk+vhd+gce,CentOS Stream 9 ({arch})]>
      <Function test_image_boots[quay.io/centos-bootc/centos-bootc:stream9,raw,CentOS Stream 9 ({arch})]>
...

which is an accident (not the {arch} part in the output above). A testcase should ideally only contain what

Instead of putting the osinfo_template into the testcase itself, have a function that generates it. It has downsides (now the osinfo_template is more disconnected from the testcase) so we could move it also back into testcase or we could exclude osinfo_template from the string generation. Ideas welcome here, my current approach feels okay but not like it's perfect yet.

This commit fixes the testcase string representation to not include
the `osinfo_template` string and adds a test case to not accidentally
regress here. Currently our test case strings look like:
```
<Dir bootc-image-builder>
  <Dir test>
    <Module test_build.py>
      <Function test_container_builds>
      <Function test_image_is_generated[quay.io/centos-bootc/centos-bootc:stream9,qcow2+raw+vmdk+vhd+gce,CentOS Stream 9 ({arch})]>
      <Function test_image_boots[quay.io/centos-bootc/centos-bootc:stream9,raw,CentOS Stream 9 ({arch})]>
...
```
which is an accident. A testcase should ideally only contain what

Instead of putting the osinfo_template into the testcase itself,
have a function that generates it. It has downsides (now the
osinfo_template is more disconnected from the testcase) so we could
move it also back into testcase or we could exclude osinfo_template
from the string generation. Ideas welcome here, my current approach
feels okay but not like it's perfect yet.
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.

1 participant