-
Notifications
You must be signed in to change notification settings - Fork 944
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test setup for new baselines (#665)
Co-authored-by: Pedro Porto Buarque de Gusmão <[email protected]>
- Loading branch information
1 parent
d440891
commit 3fc784d
Showing
5 changed files
with
74 additions
and
3 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,34 @@ | ||
name: Test Baselines | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
defaults: | ||
run: | ||
working-directory: baselines | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8.3 | ||
- name: Install build tools | ||
run: | | ||
python -m pip install -U pip==21.0.1 | ||
python -m pip install -U setuptools==49.3.1 | ||
python -m pip install -U poetry==1.0.10 | ||
poetry config virtualenvs.create false | ||
- name: Install dependencies | ||
run: | | ||
python -m poetry install | ||
- name: Lint + Test (isort/black/mypy/pylint/pytest) | ||
run: ./dev/test.sh |
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,7 @@ | ||
#!/bin/bash | ||
set -e | ||
cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"/../ | ||
|
||
python -m isort flwr_baselines | ||
python -m black -q flwr_baselines | ||
python -m docformatter -i -r flwr_baselines |
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,12 @@ | ||
#!/bin/bash | ||
set -e | ||
cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"/../ | ||
|
||
echo "=== test.sh ===" | ||
|
||
python -m isort --check-only flwr_baselines && echo "- isort: done" && | ||
python -m black --check flwr_baselines && echo "- black: done" && | ||
python -m mypy flwr_baselines && echo "- mypy: done" && | ||
python -m pylint flwr_baselines && echo "- pylint: done" && | ||
python -m pytest --durations=0 -v flwr_baselines && echo "- pytest: done" && | ||
echo "- All Python checks passed" |
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,18 @@ | ||
"""Placeholder to ensure test setup is working correctly. | ||
Should be removed when first real code has tests. | ||
""" | ||
|
||
import unittest | ||
|
||
|
||
class TestStringMethods(unittest.TestCase): | ||
"""Test string methods.""" | ||
|
||
def test_upper(self): | ||
"""Testing upper method.""" | ||
self.assertEqual("foo".upper(), "FOO") | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |
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