Skip to content

Commit 56f7127

Browse files
authored
Update run_*.sh scripts (#1443)
The Maintainers Guide says that no formatter nor code analyzer is 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 * simplify handling of a test target
1 parent 69638bf commit 56f7127

File tree

3 files changed

+30
-36
lines changed

3 files changed

+30
-36
lines changed

scripts/run_integration_tests.sh

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,16 @@
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

9-
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 && \
11+
pip install -U pip
12+
pip install -r requirements/testing.txt \
13+
-r requirements/optional.txt
14+
15+
python setup.py codegen
1416

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

scripts/run_unit_tests.sh

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,16 @@
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

9-
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 && \
11+
pip install -U pip
12+
pip install -r requirements/testing.txt \
13+
-r requirements/optional.txt
14+
15+
python setup.py codegen
1416

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

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)