Skip to content

TESTING.adoc: add a document that describes how ELBE is tested - #486

Open
kanavin wants to merge 1 commit into
Linutronix:masterfrom
kanavin:add-testing-doc
Open

TESTING.adoc: add a document that describes how ELBE is tested#486
kanavin wants to merge 1 commit into
Linutronix:masterfrom
kanavin:add-testing-doc

Conversation

@kanavin

@kanavin kanavin commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Note that I didn't try to make the formatting perfect (or even basically correct): for a start I wanted to write the content down, so we can get that right first.

@koalo Please take a look too.

Note that I didn't try to make the formatting perfect (or even correct):
for a start I wanted to write the content down, so we can get that right
first.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
@t-8ch

t-8ch commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Before looking at the contents, I think instead of adoc we should use ReST.
Then we can actually integrate the document into the actual documentation.
The same goes for the other adoc files at some point.

Comment thread TESTING.adoc

To redirect output to somewhere else, use the `--basetemp` option:

$ pytest --basetemp=$HOME/elbe-tests/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have also fought with this aspect for some time and it ended up in this patch suggestion:

015af66

Comment thread TESTING.adoc
not recommended in local development as it will take many hours. It's better to run
particular relevant slow tests, for example:

$ pytest -s -k "test_base_extended_build[simple-validation-image.xml]" --runslow --elbe-use-initvm=existing

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this --elbe-use-initvm=existing should be explained a little more. I repeatedly ran against walls with this. When I skipped it, I often had the issue that it collides with the initvm that I have already set up (is it even possible to have more than one ELBE initvm at the same time?). When I used the existing VM, I repeatedly forgot to rebuild the VM properly after doing changes to ELBE that were then not integrated into the VM. There is also the elbe initvm sync command that should help to avoid rebuilding the initvm from scratch, but it failed for strange reasons I did not want to dig deeper into. I ended up spawning fresh VMs with support for nested VMs inside, so I could cleanly rebuild the initvm inside, for every test run to sidestep all these issues, but I think these issues deserve more documentation.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it even possible to have more than one ELBE initvm at the same time?

Yes, but you need to fiddle with ports. Theoretically the tests could do this automatically though.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is also the elbe initvm sync command that should help to avoid rebuilding the initvm from scratch

This should be mentioned for sure.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but it failed for strange reasons I did not want to dig deeper into

If this happens again, please let me know.

Comment thread TESTING.adoc

On the top level, there are pytest test cases, defined in `elbepack/tests/test_xml.py`.

They're visible in list of tests provided by `pytest --co`:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use the long-form arguments. pytest --collect-only

Comment thread TESTING.adoc
@pytest.mark.slow
@pytest.mark.parametrize('check_build', ('schema', 'cdrom', 'img', 'sdk'))
def test_simple_build(simple_build, check_build):
run_elbe_subcommand(['check-build', check_build, simple_build])

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please no copy of source code. If we need to show source code it should be included from the actual file.

Comment thread TESTING.adoc
<action><login>root</login></action>
</check>
<check-script location="simple-validation-image-test.py" />
</check-image-list>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We (should) have dedicated docs for elbe check-build, let's link to that instead.

Comment thread TESTING.adoc
<Function test_check_updates[simple-validation-image.xml]>
<Function test_base_extended_build[simple-validation-image.xml]>

The same set of tests is provided for every `tests\simple-*.xml` image.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forward slash in the file path.

Comment thread TESTING.adoc
not recommended in local development as it will take many hours. It's better to run
particular relevant slow tests, for example:

$ pytest -s -k "test_base_extended_build[simple-validation-image.xml]" --runslow --elbe-use-initvm=existing

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should explain --elbe-use-initvm somewhere.

Comment thread TESTING.adoc
not recommended in local development as it will take many hours. It's better to run
particular relevant slow tests, for example:

$ pytest -s -k "test_base_extended_build[simple-validation-image.xml]" --runslow --elbe-use-initvm=existing

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it even possible to have more than one ELBE initvm at the same time?

Yes, but you need to fiddle with ports. Theoretically the tests could do this automatically though.

Comment thread TESTING.adoc
not recommended in local development as it will take many hours. It's better to run
particular relevant slow tests, for example:

$ pytest -s -k "test_base_extended_build[simple-validation-image.xml]" --runslow --elbe-use-initvm=existing

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is also the elbe initvm sync command that should help to avoid rebuilding the initvm from scratch

This should be mentioned for sure.

Comment thread TESTING.adoc
not recommended in local development as it will take many hours. It's better to run
particular relevant slow tests, for example:

$ pytest -s -k "test_base_extended_build[simple-validation-image.xml]" --runslow --elbe-use-initvm=existing

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but it failed for strange reasons I did not want to dig deeper into

If this happens again, please let me know.

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.

3 participants