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

feat(doc): bao test framework #65

Closed
wants to merge 18 commits into from
Closed

feat(doc): bao test framework #65

wants to merge 18 commits into from

Conversation

Diogo21Costa
Copy link
Member

PR Description

Description

This PR introduces a description of a testing framework for the Bao hypervisor project. The framework enables developers to conduct unit tests on system components and assess interactions between different layers by leveraging a Python-based test framework API that handles build system interaction, test setup generation, test runner invocation, and result logging.

Changes Made

  • Provided an overview of the framework's concepts, configuration options, and Nix recipes.
  • Explained the test definition process using the BAO_TEST macro and integrated assertion functions.
  • Recommended directory structure and integration instructions for the build system.
  • Included instructions for writing tests, running tests locally, and setting up CI with GitHub Actions.

The documentation provides a comprehensive guide on the purpose, features, and usage of the framework. It includes step-by-step instructions for integrating the framework and utilizing it effectively for testing.
Please review this PR and provide your feedback.

@josecm
Copy link
Member

josecm commented Jul 26, 2023

I believe you forked your feature branch from the wrong branch. The first commit, which is not part of this PR, is not in the main branch.

@danielRep danielRep self-assigned this Jul 26, 2023
Copy link
Member

@danielRep danielRep left a comment

Choose a reason for hiding this comment

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

Broadly speaking, I feel that the only problem of the document is redirecting the information for a specific use-case where the test framework can be used. I would strive to broadly explain the framework without being to specific to a particular repository where it was tested or it is already applied. My comments will evidence the places where I felt that.

source/development/testing.rst Outdated Show resolved Hide resolved
source/development/testing.rst Outdated Show resolved Hide resolved
logs the test results. This typically includes information such as the test
status (pass/fail) and any error messages.

.. figure:: img/framework-overview.png
Copy link
Member

Choose a reason for hiding this comment

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

I would try to use the .svg format for the image. Despite we don't have any guidelines specific for image formats, it seems that this particular image as a really small resolution. On draw.io you can export it as an .svg file.

source/development/testing.rst Outdated Show resolved Hide resolved
source/development/testing.rst Outdated Show resolved Hide resolved
source/development/testing.rst Outdated Show resolved Hide resolved
Comment on lines +379 to +378
- **platform**: The target platform to perform the tests. See
`Appendix I <#appendix-i>`__ to check supported platforms.
Copy link
Member

Choose a reason for hiding this comment

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

Here you are being to specific. I would say something as "Please consult the documentation of the MUT to see the supporting platforms". That information seems more plausible to be located there.

`Appendix I <#appendix-i>`__ to check supported platforms.

- **nix_file**: A nix recipe that describes the software stack to be used.
This will select a pre configured bao.config or point to one of your own.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
This will select a pre configured bao.config or point to one of your own.
This will select a pre-configured ``.config`` or point to one of your own.


- **testes/suites**: The suites and tests to be run.

- **log_level**: Test related configurations, e.g., log level ...etc.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- **log_level**: Test related configurations, e.g., log level ...etc.
- **log_level**: Test-related configurations, e.g., log level, verbosity, etc.

Comment on lines +405 to +413
Appendix I
----------

.. table:: Supported Platforms
:widths: 25 25 50

+---------------------+-------------------+----------------------+
| | PLATFORM | ARCH |
+=====================+===================+======================+
| QEMU Aarch64 virt | qemu-aarch64-virt | aarch64 |
+---------------------+-------------------+----------------------+
Copy link
Member

Choose a reason for hiding this comment

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

Like I mentioned before, this documentation should explain generally the testing framework and not being to specific regarding a particular repository. I would remove this.

@danielRep
Copy link
Member

I believe you forked your feature branch from the wrong branch. The first commit, which is not part of this PR, is not in the main branch.

Just to reinforce this @Diogo21Costa

@@ -34,3 +34,6 @@ Glossary
invited by a maintainer to oversee the development of one or multiple
subsystems in a repository. More information
:ref:`here <contrib_roles>`.

MUT
Module Under Test. More information :ref:`here <bao_tests>`.
Copy link
Member

Choose a reason for hiding this comment

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

Try to give a proper definition to the term. Something as "...refers to the specific component of the system that is currently being subjected to testing to ensure its proper functionality and correctness. " Or something more clear and specific of the testing framework.

Copy link
Member

Choose a reason for hiding this comment

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

Besides, a newline must be in-place between terms or this will trigger an error on the build.

miguelafsilva5 and others added 18 commits September 15, 2023 12:56
Co-Authored-By: Cristiano Rodrigues <[email protected]>
Co-Authored-By: Cristiano Rodrigues <[email protected]>
Co-Authored-By: miguelafsilva5 <[email protected]>
Added a step regarding the source files that need to be included in the
makefiles.

Signed-off-by: Miguel Silva <[email protected]>
Added some words that appeared mostly on code blocks.
Additionally, removed a line from the 1st paragraph that was supposed to be
commented.

Signed-off-by: Miguel Silva <[email protected]>
Moved the bao-tests/ and software-stack (TBD)/ folders inside the tests/
tree to minimize the overhead in the parent directory.
Changed the example in step 3 of the how-to guide to reflect these changes.

Signed-off-by: Miguel Silva <[email protected]>
Signed-off-by: ESCristiano <[email protected]>
Signed-off-by: ESCristiano <[email protected]>
@josecm
Copy link
Member

josecm commented Sep 15, 2023

I believe you forked your feature branch from the wrong branch. The first commit, which is not part of this PR, is not in the main branch.

I've removed that commit and rebased this on main.

@josecm josecm marked this pull request as draft September 15, 2023 14:15
Comment on lines +8 to +11
hypervisor, virtual machine (VM), and virtual machine monitor (VMM)), as well
as assess interactions between different components/layers.
Copy link
Member

Choose a reason for hiding this comment

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

So, integration tests?

Some mention to regression testing and the fact this is purpose to integrate the CI pipeline also would be welcome

Comment on lines +4 to +8
In order to tackle the challenge of testing new functionalities on the Bao
hypervisor, we are actively working on the development of a comprehensive
testing framework. The primary objective of this framework is to enable
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this should be said. The documentation should be written as if the
framework is operational.It should just start with something like "The primary
objective of the Bao Test Framework".

Overview
***********

The test framework API is a Python tool that acts as the control center for the
Copy link
Member

Choose a reason for hiding this comment

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

Is it an API or a tool? This is really confusing.

@josecm
Copy link
Member

josecm commented Oct 26, 2023

I believe the documentation introduced in this PR will be developed in wip/testing, right @Diogo21Costa? If so, let's close this.

@Diogo21Costa
Copy link
Member Author

I believe the documentation introduced in this PR will be developed in wip/testing, right @Diogo21Costa? If so, let's close this.

Yes, you're right @josecm.

@josecm josecm closed this Oct 27, 2023
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.

5 participants