Workflow file: test-go-integration-task.yml
Run Python integration tests for a Go module.
This is the version of the workflow for projects using the Task task runner tool.
The Python dependencies are managed by Poetry.
Install Poetry by following these instructions:
https://python-poetry.org/docs/#installation
If your project does not already use Poetry, you can initialize the pyproject.toml
file using these commands:
poetry init --python="^3.9" --dev-dependency="pytest@^6.2.4" --dev-dependency="invoke@^1.5.0"
poetry install
If already using Poetry, add the tool using this command:
poetry add --dev "pytest@^6.2.4" "invoke@^1.5.0"
Make sure to commit the resulting pyproject.toml
and poetry.lock
files.
Taskfile.yml
- Test runner task.- Install to: repository root (or add the
go:test-integration
task into the existingTaskfile.yml
)
- Install to: repository root (or add the
Taskfile.yml
- Build task.- Merge the
go:build
task into the existingTaskfile.yml
.
- Merge the
__init__.py
- Template for Python integration tests.- Install to:
/tests/
- Install to:
test_all.py
- Template for Python integration tests.- Install to:
/tests/
- Install to:
pytest.ini
- pytest configuration file.- Install to:
/tests/
- Install to:
Markdown badge:
[](https://github.com/REPO_OWNER/REPO_NAME/actions/workflows/test-go-integration-task.yml)
Replace the REPO_OWNER
and REPO_NAME
placeholders in the URLs with the final repository owner and name (example).
Asciidoc badge:
image:https://github.com/{repository-owner}/{repository-name}/actions/workflows/test-go-integration-task.yml/badge.svg["Test Integration status", link="https://github.com/{repository-owner}/{repository-name}/actions/workflows/test-go-integration-task.yml"]
Define the {repository-owner}
and {repository-name}
attributes and use them throughout the readme (example).
Add CI workflow to run integration tests
On every push and pull request that affects relevant files, run the integration tests.
On every push and pull request that affects relevant files, run the integration tests.