Pytest Plugin for communicating test results and information to a FixturFab Test Runner GUI
Project description
pytest-f3ts
Use your pytest
test plans with the FixturFab Test Executor!
Manage, Execute, and Support your Hardware Test Plan Deployments
Leverage the amazingness that is pytest
and all of the community support to
implement hardware tests for circuit boards, sub-assemblies and more!
Simply add the pytest-f3ts
plugin and a f3ts.toml file to your test plan and
start executing your tests using the FixturFab Test Executor.
Installation into a Project using poetry
The built wheels are stored within a Google Cloud Artifact Registry. To access
this registry and install the package, you will need to install the
gcloud
command line tool and
authenticate with the registry.
- Install
gcloud
CLI Application - Add the Google Artifact Registry as a
poetry
pluginpoetry self add keyrings.google-artifactregistry-auth
- Authenticate with the Google Artifact Registry. Copy and paste the following into your
pyproject.toml
file:gcloud auth login
- Verify that you are connected to the
[test-runner-404519]
project.
- Verify that you are connected to the
- Add the Google Artifact Registry as a
poetry
repository[[tool.poetry.source]] name = "pytest-f3ts" url = "https://us-west1-python.pkg.dev/test-runner-404519/pytest-f3ts/simple/" secondary = true
- Install the package
poetry add pytest-f3ts
Note: If you're having issues installing the package, you can double check the URL by running the following command:
gcloud artifacts print-settings python \
--project=test-runner-404519 \
--repository=pytest-f3ts \
--location=us-west1
Resources:
Development
Environment Setup
poetry
is used for dependency management and
pre-commit
is used to identify simple issues
before submission for code review. Once installed, run the following commands
to setup your development environment:
poetry install
pre-commit install
Making changes
Use the following process when making changes to the module:
- Create new test cases
- Write new feature code and/or bugfixes
- Write documentation for new features
- Run pre-commit checks and tests prior to committing
To run the pre-commit checks, simply run the following:
poetry run pre-commit run --all-files
Git Commit Message Format
We use Conventional Commits for our commit messages. This allows us to automatically generate changelogs and version numbers.
Brief Overview:
fix:
- Fixes a bugfeat:
- Adds a new featuredocs:
- Updates documentationstyle:
- Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)refactor:
- A code change that neither fixes a bug nor adds a featureperf:
- A code change that improves performancetest:
- Adding missing tests or correcting existing testschore:
- Changes to the build process or auxiliary tools and libraries such as documentation generationci:
- Changes to our CI configuration files and scriptsBREAKING CHANGE:
- A commit that has a footerBREAKING CHANGE:
, or appends a!
after the type/scope, introduces a breaking API change (correlating with MAJOR in semantic versioning).
Code Quality Tools
black
black
is used for code formatting, this is configured within pyproject.toml
To run black
manually, run:
poetry run black .
flake8
flake8
is used to enforce additional
style guidelines.
To run flake8
manually, run:
poetry run flake8 ./pytest_f3ts
isort
isort
is used to automatically reformat
python module import statements.
To run isort
manually, run:
poetry run isort .
pre-commit
To automatically check if code is ready to be committed and pushed to Gitlab
pre-commit
is used. This is configured via the
.pre-commit-config.yml
file.
To run pre-commit
manually, run:
poetry run pre-commit run --all-files
Documentation Generation
mkdocs
is utilized along with mkdocs-material
to generate documentation for
this project.
The docs
directory contains the general structure for the documentation in
the form of markdown files. To autogenerate additional documentation from
docstrings, the mkdocstrings
module is
used.
Developing documentation with the live server
When creating additional documentation it's useful to run the mkdocs
server
which will live-reload the webpages as you make changes. To start this server,
run the following in a terminal: ### pre-commit
poetry run mkdocs serve
Adding a new file for autodocumentation
To add a new python file to the autodocumentation, open the docs/reference.md
file. Add a new header to the file, and then add the line
::: pytest_f3ts.{new_file_name}
, this will signal to mkdocstrings
to
process the new file when building the documentation
Manually building and uploading a wheel
poetry config repositories.pytest-f3ts https://us-west1-python.pkg.dev/test-runner-404519/pytest-f3ts/
# On windows you will need to run the following command as two separate commands
# and paste the token into the password prompt for the second command.
gcloud auth print-access-token | poetry config http-basic.pytest-f3ts oauth2accesstoken
poetry publish --repository pytest-f3ts --build
Pipeline Setup
The pipeline is configured via the .gitlab-ci.yml
file. The pipeline is
configured to run the following stages:
linting
: Runs theblack
,flake8
, andisort
checks- Occurs on all merge requests and is required to pass before a merge request can be merged
version
: Runs thegen-semver.py
command to update the version number- Occurs after a merge request is accepted.
[skip ci]
is added to a new Git Commit to prevent the pipeline from running again
build
: Builds the package and uploads it to the Gitlab package registry- Triggered by new tags, which are created by the
version
stage
- Triggered by new tags, which are created by the
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pytest_f3ts-1.0.7.tar.gz
.
File metadata
- Download URL: pytest_f3ts-1.0.7.tar.gz
- Upload date:
- Size: 29.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.13.0 Windows/11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
4f1e25b6ef2b3c78c1148b5631b8957ec2dd6a844ba06fd005cdcbfe36a5dade
|
|
MD5 |
f4401709192be876d5ce9c26038fc3ca
|
|
BLAKE2b-256 |
2df0e6f9622fe6f6ec67191b08f2ec70bc59e89f8413af6183592f3f48b409db
|
File details
Details for the file pytest_f3ts-1.0.7-py3-none-any.whl
.
File metadata
- Download URL: pytest_f3ts-1.0.7-py3-none-any.whl
- Upload date:
- Size: 34.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.13.0 Windows/11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
b8e3521d916cd439a2179e98dba509dffb61b672643fe813bf14d9753b76922b
|
|
MD5 |
d85f2d18ab9fa017e3e2345991b638d0
|
|
BLAKE2b-256 |
1cdadc03fb24a993a434bc4755da9c201bb2856bd2106da091d660e18f490dc5
|