Skip to content

Conversation

@PerMac
Copy link
Owner

@PerMac PerMac commented May 25, 2023

No description provided.

gopiotr and others added 24 commits May 23, 2023 17:10
Add initial version of pytest plugin dedicated to run pytest tests in
Zephyr project.

Co-authored-by: Lukasz Fundakowski <lukasz.fundakowski@nordicsemi.no>
Signed-off-by: Piotr Golyzniak <piotr.golyzniak@nordicsemi.no>
Add exemplary shell tests basing on added pytest plugin.

Signed-off-by: Piotr Golyzniak <piotr.golyzniak@nordicsemi.no>
Change name of pytest plugin to more meaningful one.

Signed-off-by: Piotr Golyzniak <piotr.golyzniak@nordicsemi.no>
Initial work for pytest-twister-ext plugin. Removed legacy pytest
support. Modified Pytest-Harness to generate internal pytest
command for hardware-adapter. Modified logic with HarnessImporter,
getting harness only once in Runner and passing it to proper Handler.

Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
Ported from TwisterV2 logging module.

Co-authored-by: Katarzyna Giadla <katarzyna.giadla@nordicsemi.no>
Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
Integrated QemuAdapter from TwisterV2

Co-authored-by: Lukasz Fundakowski <lukasz.fundakowski@nordicsemi.no>
Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
Integrated SimulatorAdapters from TwisterV2.

Co-authored-by: Lukasz Fundakowski <lukasz.fundakowski@nordicsemi.no>
Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
Added sample showing interaction with shell.

Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
Some of tests for pytest-twister-ext plugin ported from twisterV2

Co-authored-by: Lukasz Fundakowski <lukasz.fundakowski@nordicsemi.no>
Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
Fix minor typos, add Apache licenses to the files.

Signed-off-by: Piotr Golyzniak <piotr.golyzniak@nordicsemi.no>
Make else if conditional statement simpler.

Signed-off-by: Piotr Golyzniak <piotr.golyzniak@nordicsemi.no>
Add possibility to printing pytest output by Twister when it is call
with -vv option.

Signed-off-by: Piotr Golyzniak <piotr.golyzniak@nordicsemi.no>
Remove requirements, which are not used in this plugin version.

Signed-off-by: Piotr Golyzniak <piotr.golyzniak@nordicsemi.no>
To be able to install plugin in editable mode without egg-link file,
I added this pyproject.toml file to indicate to use only setuptools.

Signed-off-by: Piotr Golyzniak <piotr.golyzniak@nordicsemi.no>
When pytest plugin is not installed, then extend pytest command and
export PYTHONPATH during call by Twister.

Co-authored-by: Piotr Golyzniak <piotr.golyzniak@nordicsemi.no>
Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
At this moment only hardware, QEMU and native_posix are handled by
pytest plugin so in other cases test should be build only.

Signed-off-by: Piotr Golyzniak <piotr.golyzniak@nordicsemi.no>
Add integration platforms to exemplary pytest shell sample.

Signed-off-by: Piotr Golyzniak <piotr.golyzniak@nordicsemi.no>
As per Twister maintainer suggestion, name of plugin was renamed from
pytest-twister-ext to pytest-twister-harness.

Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
Enforce on users using by default non-installed plugin version when
they call it by Twister. If they would like to use them intentionally,
then they can use --allow-installed-plugin option.

Signed-off-by: Piotr Golyzniak <piotr.golyzniak@nordicsemi.no>
Remove requirements.txt files dedicated for pytest plugin to keep only
one requirements.txt files dedicated for whole Zephyr project.

Signed-off-by: Piotr Golyzniak <piotr.golyzniak@nordicsemi.no>
Remove possibility of using additional linters like flake8, isort or
mypy to be aligned with Zephyr/Twister coding standard.

Signed-off-by: Piotr Golyzniak <piotr.golyzniak@nordicsemi.no>
Remove information about possibility of installing pytest plugin by
pip.

Signed-off-by: Piotr Golyzniak <piotr.golyzniak@nordicsemi.no>
This is an initial documentation for integration of twister with pytest
plugin.

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
Was causing compliance issues. This commit will be squashed
before the PR is merged

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
@PerMac PerMac force-pushed the dev/pytest_plugin branch from b5cef98 to 2bd9733 Compare May 25, 2023 12:00
The test was incorrect and is removed.

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
PerMac added 2 commits May 25, 2023 15:49
As suggested in the review. Will be squashed.

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
Add a stage to twister unit test workflow where tests for
pytest-twister-harness are executed.

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
@PerMac PerMac force-pushed the dev/pytest_plugin branch from d962898 to 1b6863a Compare May 25, 2023 13:49
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