forked from naylor-b/testflo
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #106 from swryan/hatchling
Change build system to hatchling; added a test workflow
- Loading branch information
Showing
7 changed files
with
192 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
name: Test testflo | ||
|
||
on: | ||
# Trigger on push or pull request events for the master branch | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
# Allow running the workflow manually from the Actions tab | ||
workflow_dispatch: | ||
inputs: | ||
debug_enabled: | ||
type: boolean | ||
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)' | ||
required: false | ||
default: false | ||
|
||
permissions: {} | ||
|
||
jobs: | ||
|
||
tests: | ||
|
||
timeout-minutes: 20 | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
# test on Ubuntu | ||
- NAME: Ubuntu Baseline | ||
OS: ubuntu-latest | ||
PY: '3.11' | ||
|
||
# test on MacOS | ||
- NAME: MacOS Baseline | ||
OS: macos-latest | ||
PY: '3.11' | ||
|
||
runs-on: ${{ matrix.OS }} | ||
|
||
name: ${{ matrix.NAME }} | ||
|
||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
steps: | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.PY }} | ||
|
||
- name: Install testflo | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install . | ||
# Enable tmate debugging of manually-triggered workflows if the input option was provided | ||
# | ||
# To access the terminal through the web-interface: | ||
# 1. Click on the web-browser link printed out in this action from the github | ||
# workflow terminal | ||
# 2. Press cntrl + c in the new tab that opens up to reveal the terminal | ||
# 3. To activate the conda environment run: | ||
# $ source $CONDA/etc/profile.d/conda.sh | ||
# $ conda activate test | ||
- name: Setup tmate session | ||
uses: mxschmitt/action-tmate@v3 | ||
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }} | ||
|
||
- name: Run tests | ||
run: | | ||
cd $HOME | ||
testflo testflo.tests || RC=$? | ||
if [[ $RC -ne 1 ]]; then | ||
echo "Expected some tests to fail." | ||
exit 1 | ||
fi | ||
if [[ ! -n `grep "Ran 26 tests" testflo_report.out` ]]; then | ||
echo "Expected 26 tests." | ||
exit 26 | ||
fi | ||
if [[ ! -n `grep "Passed: 7" testflo_report.out` ]]; then | ||
echo "Expected 7 tests to pass." | ||
exit 7 | ||
fi | ||
if [[ ! -n `grep "Failed: 8" testflo_report.out` ]]; then | ||
echo "Expected 8 tests to fail." | ||
exit 8 | ||
fi | ||
if [[ ! -n `grep "Skipped: 11" testflo_report.out` ]]; then | ||
echo "Expected 11 tests to be skipped." | ||
exit 11 | ||
fi | ||
- name: Run tests in serial | ||
run: | | ||
cd $HOME | ||
testflo -n 1 testflo.tests || RC=$? | ||
if [[ $RC -ne 1 ]]; then | ||
echo "Expected some tests to fail." | ||
exit 1 | ||
fi | ||
if [[ ! -n `grep "Ran 26 tests using 1 processes" testflo_report.out` ]]; then | ||
echo "Expected 26 tests on one process." | ||
exit 26 | ||
fi | ||
if [[ ! -n `grep "Passed: 7" testflo_report.out` ]]; then | ||
echo "Expected 7 tests to pass." | ||
exit 7 | ||
fi | ||
if [[ ! -n `grep "Failed: 8" testflo_report.out` ]]; then | ||
echo "Expected 8 tests to fail." | ||
exit 8 | ||
fi | ||
if [[ ! -n `grep "Skipped: 11" testflo_report.out` ]]; then | ||
echo "Expected 11 tests to be skipped." | ||
exit 11 | ||
fi | ||
- name: Notify slack of failure | ||
uses: act10ns/[email protected] | ||
with: | ||
webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
status: ${{ job.status }} | ||
if: failure() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
[build-system] | ||
requires = ["hatchling"] | ||
build-backend = "hatchling.build" | ||
|
||
[project] | ||
name = "testflo" | ||
dynamic = ["version"] | ||
description = "A simple flow-based testing framework" | ||
readme = "README.md" | ||
license = "Apache-2.0" | ||
classifiers = [ | ||
"Development Status :: 4 - Beta", | ||
"License :: OSI Approved :: Apache Software License", | ||
"Natural Language :: English", | ||
"Operating System :: MacOS :: MacOS X", | ||
"Operating System :: Microsoft :: Windows", | ||
"Operating System :: POSIX :: Linux", | ||
"Programming Language :: Python :: 3.5", | ||
"Programming Language :: Python :: 3.6", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: Implementation :: CPython", | ||
] | ||
dependencies = [ | ||
"setuptools", | ||
"coverage>=6.0", | ||
] | ||
|
||
[project.scripts] | ||
testflo = "testflo.main:main" | ||
|
||
[tool.hatch.version] | ||
path = "testflo/__init__.py" | ||
|
||
[tool.hatch.build.targets.sdist] | ||
include = [ | ||
"/testflo", | ||
] |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters