-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use a separate varaible for controlling tests
**What** - add TEST_ENABLED build-arg to control if the tests are run or not. Should be easier to document and debug in the future. - Copy the implementation to all of the python3 templates Signed-off-by: Lucas Roesler <[email protected]>
- Loading branch information
1 parent
19512d2
commit 91271bc
Showing
23 changed files
with
309 additions
and
8 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from .handler import handle | ||
|
||
# Test your handler here | ||
|
||
# To disable testing, you can set the build_arg `TEST_ENABLED=false` on the CLI or in your stack.yml | ||
# https://docs.openfaas.com/reference/yaml/#function-build-args-build-args | ||
|
||
def test_handle(): | ||
# assert handle("input") == "input" | ||
pass |
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,41 @@ | ||
# If you would like to disable | ||
# automated testing during faas-cli build, | ||
|
||
# Replace the content of this file with | ||
# [tox] | ||
# skipsdist = true | ||
|
||
# You can also edit, remove, or add additional test steps | ||
# by editing, removing, or adding new testenv sections | ||
|
||
|
||
# find out more about tox: https://tox.readthedocs.io/en/latest/ | ||
[tox] | ||
envlist = lint,test | ||
skipsdist = true | ||
|
||
[testenv:test] | ||
deps = | ||
flask | ||
pytest | ||
-rrequirements.txt | ||
commands = | ||
# run unit tests with pytest | ||
# https://docs.pytest.org/en/stable/ | ||
# configure by adding a pytest.ini to your handler | ||
pytest | ||
|
||
[testenv:lint] | ||
deps = | ||
flake8 | ||
commands = | ||
flake8 . | ||
|
||
[flake8] | ||
count = true | ||
max-line-length = 127 | ||
max-complexity = 10 | ||
statistics = true | ||
# stop the build if there are Python syntax errors or undefined names | ||
select = E9,F63,F7,F82 | ||
show-source = true |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
flask | ||
waitress | ||
|
||
tox==3.* |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from .handler import handle | ||
|
||
# Test your handler here | ||
|
||
# To disable testing, you can set the build_arg `TEST_ENABLED=false` on the CLI or in your stack.yml | ||
# https://docs.openfaas.com/reference/yaml/#function-build-args-build-args | ||
|
||
def test_handle(): | ||
# assert handle("input") == "input" | ||
pass |
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,41 @@ | ||
# If you would like to disable | ||
# automated testing during faas-cli build, | ||
|
||
# Replace the content of this file with | ||
# [tox] | ||
# skipsdist = true | ||
|
||
# You can also edit, remove, or add additional test steps | ||
# by editing, removing, or adding new testenv sections | ||
|
||
|
||
# find out more about tox: https://tox.readthedocs.io/en/latest/ | ||
[tox] | ||
envlist = lint,test | ||
skipsdist = true | ||
|
||
[testenv:test] | ||
deps = | ||
flask | ||
pytest | ||
-rrequirements.txt | ||
commands = | ||
# run unit tests with pytest | ||
# https://docs.pytest.org/en/stable/ | ||
# configure by adding a pytest.ini to your handler | ||
pytest | ||
|
||
[testenv:lint] | ||
deps = | ||
flake8 | ||
commands = | ||
flake8 . | ||
|
||
[flake8] | ||
count = true | ||
max-line-length = 127 | ||
max-complexity = 10 | ||
statistics = true | ||
# stop the build if there are Python syntax errors or undefined names | ||
select = E9,F63,F7,F82 | ||
show-source = true |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
flask | ||
waitress | ||
|
||
tox==3.* |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from .handler import handle | ||
|
||
# Test your handler here | ||
|
||
# To disable testing, you can set the build_arg `TEST_ENABLED=false` on the CLI or in your stack.yml | ||
# https://docs.openfaas.com/reference/yaml/#function-build-args-build-args | ||
|
||
def test_handle(): | ||
# assert handle("input") == "input" | ||
pass |
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,41 @@ | ||
# If you would like to disable | ||
# automated testing during faas-cli build, | ||
|
||
# Replace the content of this file with | ||
# [tox] | ||
# skipsdist = true | ||
|
||
# You can also edit, remove, or add additional test steps | ||
# by editing, removing, or adding new testenv sections | ||
|
||
|
||
# find out more about tox: https://tox.readthedocs.io/en/latest/ | ||
[tox] | ||
envlist = lint,test | ||
skipsdist = true | ||
|
||
[testenv:test] | ||
deps = | ||
flask | ||
pytest | ||
-rrequirements.txt | ||
commands = | ||
# run unit tests with pytest | ||
# https://docs.pytest.org/en/stable/ | ||
# configure by adding a pytest.ini to your handler | ||
pytest | ||
|
||
[testenv:lint] | ||
deps = | ||
flake8 | ||
commands = | ||
flake8 . | ||
|
||
[flake8] | ||
count = true | ||
max-line-length = 127 | ||
max-complexity = 10 | ||
statistics = true | ||
# stop the build if there are Python syntax errors or undefined names | ||
select = E9,F63,F7,F82 | ||
show-source = true |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
flask | ||
waitress | ||
waitress | ||
tox==3.* |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from .handler import handle | ||
|
||
# Test your handler here | ||
|
||
# To disable testing, you can set the build_arg `TEST_ENABLED=false` on the CLI or in your stack.yml | ||
# https://docs.openfaas.com/reference/yaml/#function-build-args-build-args | ||
|
||
def test_handle(): | ||
# assert handle("input") == "input" | ||
pass |
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,41 @@ | ||
# If you would like to disable | ||
# automated testing during faas-cli build, | ||
|
||
# Replace the content of this file with | ||
# [tox] | ||
# skipsdist = true | ||
|
||
# You can also edit, remove, or add additional test steps | ||
# by editing, removing, or adding new testenv sections | ||
|
||
|
||
# find out more about tox: https://tox.readthedocs.io/en/latest/ | ||
[tox] | ||
envlist = lint,test | ||
skipsdist = true | ||
|
||
[testenv:test] | ||
deps = | ||
flask | ||
pytest | ||
-rrequirements.txt | ||
commands = | ||
# run unit tests with pytest | ||
# https://docs.pytest.org/en/stable/ | ||
# configure by adding a pytest.ini to your handler | ||
pytest | ||
|
||
[testenv:lint] | ||
deps = | ||
flake8 | ||
commands = | ||
flake8 . | ||
|
||
[flake8] | ||
count = true | ||
max-line-length = 127 | ||
max-complexity = 10 | ||
statistics = true | ||
# stop the build if there are Python syntax errors or undefined names | ||
select = E9,F63,F7,F82 | ||
show-source = true |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
flask | ||
waitress | ||
waitress | ||
tox==3.* |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from .handler import handle | ||
|
||
# Test your handler here | ||
|
||
# To disable testing, you can set the build_arg `TEST_ENABLED=false` on the CLI or in your stack.yml | ||
# https://docs.openfaas.com/reference/yaml/#function-build-args-build-args | ||
|
||
def test_handle(): | ||
# assert handle("input") == "input" | ||
pass |
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,41 @@ | ||
# If you would like to disable | ||
# automated testing during faas-cli build, | ||
|
||
# Replace the content of this file with | ||
# [tox] | ||
# skipsdist = true | ||
|
||
# You can also edit, remove, or add additional test steps | ||
# by editing, removing, or adding new testenv sections | ||
|
||
|
||
# find out more about tox: https://tox.readthedocs.io/en/latest/ | ||
[tox] | ||
envlist = lint,test | ||
skipsdist = true | ||
|
||
[testenv:test] | ||
deps = | ||
flask | ||
pytest | ||
-rrequirements.txt | ||
commands = | ||
# run unit tests with pytest | ||
# https://docs.pytest.org/en/stable/ | ||
# configure by adding a pytest.ini to your handler | ||
pytest | ||
|
||
[testenv:lint] | ||
deps = | ||
flake8 | ||
commands = | ||
flake8 . | ||
|
||
[flake8] | ||
count = true | ||
max-line-length = 127 | ||
max-complexity = 10 | ||
statistics = true | ||
# stop the build if there are Python syntax errors or undefined names | ||
select = E9,F63,F7,F82 | ||
show-source = true |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
flask | ||
waitress | ||
waitress | ||
tox==3.* |