Skip to content

Commit

Permalink
feat: Allow other Python unit test runners (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
coreone authored Oct 5, 2024
1 parent c6dd98a commit 688eeef
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
18 changes: 15 additions & 3 deletions .github/workflows/python-unit-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ name: Python Checks
description: The name of the PyPi package the repo will create.
required: false
type: string
run_coverage:
default: true
description: Boolean to determine whether coverage should be run or not.
required: false
type: boolean
test_runner:
default: 'green'
description: The runner used to run all the unit tests.
required: false
type: string
test_targets:
default: ''
description: The directories to target for testing.
Expand Down Expand Up @@ -73,10 +83,12 @@ jobs:
run: poetry check
- name: Install dependencies
run: poetry install ${{ inputs.poetry_install_options }}
- name: Test with green
- name: Run unit tests
run: |
poetry run green ${{ inputs.test_targets }}
poetry run coverage xml
poetry run ${{ inputs.test_runner }} ${{ inputs.test_targets }}
- name: Run coverage report
if: ${{ inputs.run_coverage }}
run: poetry run coverage xml
- name: Run a test module build and install
if: ${{ inputs.python_package_name != '' }}
run: |
Expand Down
7 changes: 5 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,11 @@ install any [Python][5] dependencies.
string in JSON format with `versions` as the key. Default:
`'{ "versions": [ "3.7", "3.8", "3.9", "3.10", "3.11" ] }'`
* **Note: Make sure to enclose the JSON string in single quotes!!**
* `test_targets`: A list of directories to target for testing.
[green](https://github.com/CleanCut/green) will autodetect if left blank. Default: ``
* `run_coverage`: Boolean to determine whether coverage should be run or not. Default:
`true`
* `test_runner`: The runner used to run all the unit tests. Default: `green`
* `test_targets`: A list of directories to target for testing. Runners should autodetect
if left blank. Default: ``

### terraform-docs.yaml

Expand Down

0 comments on commit 688eeef

Please sign in to comment.