Skip to content

Commit 1f92cbe

Browse files
committed
Update run_*.sh scripts
The Maintainers Guide says that no formatter nor code analyzer will be involved when you run unit tests, so I suppose black was added by mistake and should be removed. Also, using set -e allows you to avoid chaining of commands. These changes: * remove black from run_*_tests.sh scripts * add set -e to unchain commands in scripts
1 parent 69638bf commit 1f92cbe

3 files changed

Lines changed: 32 additions & 28 deletions

File tree

scripts/run_integration_tests.sh

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,21 @@
33
# all: ./scripts/run_integration_tests.sh
44
# single: ./scripts/run_integration_tests.sh integration_tests/web/test_async_web_client.py
55

6+
set -e
7+
68
script_dir=`dirname $0`
79
cd ${script_dir}/..
810

911
test_target="$1"
10-
python_version=`python --version | awk '{print $2}'`
11-
pip install -U pip && \
12-
pip install -r requirements/testing.txt && \
13-
pip install -r requirements/optional.txt && \
12+
pip install -U pip
13+
pip install -r requirements/testing.txt \
14+
-r requirements/optional.txt
15+
16+
python setup.py codegen
1417

15-
if [[ $test_target != "" ]]
18+
if [ -n "$test_target" ]
1619
then
17-
black slack_sdk/ slack/ tests/ && \
18-
python setup.py codegen && \
19-
python setup.py integration_tests --test-target $1
20+
python setup.py integration_tests --test-target $test_target
2021
else
21-
black slack_sdk/ slack/ tests/ && \
22-
python setup.py codegen && \
23-
python setup.py integration_tests
22+
python setup.py integration_tests
2423
fi

scripts/run_unit_tests.sh

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,21 @@
33
# all: ./scripts/run_unit_tests.sh
44
# single: ./scripts/run_unit_tests.sh tests/slack_sdk_async/web/test_web_client_coverage.py
55

6+
set -e
7+
68
script_dir=`dirname $0`
79
cd ${script_dir}/..
810

911
test_target="$1"
10-
python_version=`python --version | awk '{print $2}'`
11-
pip install -U pip && \
12-
pip install -r requirements/testing.txt && \
13-
pip install -r requirements/optional.txt && \
12+
pip install -U pip
13+
pip install -r requirements/testing.txt \
14+
-r requirements/optional.txt
15+
16+
python setup.py codegen
1417

15-
if [[ $test_target != "" ]]
18+
if [ -n "$test_target" ]
1619
then
17-
black slack_sdk/ slack/ tests/ && \
18-
python setup.py codegen && \
19-
python setup.py unit_tests --test-target $1
20+
python setup.py unit_tests --test-target $test_target
2021
else
21-
black slack_sdk/ slack/ tests/ && \
22-
python setup.py codegen && \
23-
python setup.py unit_tests
22+
python setup.py unit_tests
2423
fi

scripts/run_validation.sh

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
#!/bin/bash
22
# ./scripts/run_validation.sh
33

4+
set -e
5+
46
script_dir=`dirname $0`
57
cd ${script_dir}/..
6-
pip install -U pip && \
7-
pip install -r requirements/testing.txt && \
8-
pip install -r requirements/optional.txt && \
9-
black slack_sdk/ slack/ tests/ integration_tests/ && \
10-
python setup.py codegen && \
11-
python setup.py validate
8+
pip install -U pip
9+
pip install -r requirements/testing.txt \
10+
-r requirements/optional.txt
11+
12+
black --check tests/ integration_tests/
13+
# TODO: resolve linting errors for tests
14+
# flake8 tests/ integration_tests/
15+
16+
python setup.py codegen
17+
python setup.py validate

0 commit comments

Comments
 (0)