Skip to content

Commit 8611d60

Browse files
kaustubhsardarrahul003
authored andcommitted
changes in test.sh (aws#89)
* changes * fixing import error in local trial created by some pr * fixing import error in local trial created by some pr * changes * changes * changes * changes * changes * changes
1 parent 539a620 commit 8611d60

File tree

2 files changed

+42
-5
lines changed

2 files changed

+42
-5
lines changed

config/buildspec.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# Build Spec for AWS CodeBuild CI
22

33
version: 0.2
4+
env:
5+
variables:
6+
run_pytest_pytorch: "enable"
7+
run_pytest_mxnet: "enable"
8+
run_pytest_tensorflow: "enable"
49
phases:
510
install:
611
commands:
@@ -12,6 +17,7 @@ phases:
1217
- cd $CODEBUILD_SRC_DIR && chmod +x config/protoc_downloader.sh && ./config/protoc_downloader.sh
1318
- pip install pytest wheel pyYaml pytest-html tensorflow mxnet torch
1419
- pip uninstall -y boto3 && pip uninstall -y aiobotocore && pip uninstall -y botocore
20+
1521

1622
pre_build:
1723
commands:

config/tests.sh

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,39 @@
11
#!/usr/bin/env bash
2+
check_logs() {
3+
if grep "AssertionError" $1;
4+
then
5+
echo "Integration tests:FAILED."
6+
exit 1
7+
else
8+
echo "Integration tests: SUCCESS."
9+
fi
10+
}
211

3-
#export TORNASOLE_LOG_LEVEL=debug
4-
TORNASOLE_LOG_LEVEL=debug python -m pytest --html=upload/$CURRENT_COMMIT_PATH/reports/report.html --self-contained-html tests/
5-
TORNASOLE_LOG_LEVEL=debug python -m pytest --html=upload/$CURRENT_COMMIT_PATH/reports/test_rules_tensorflow.html --self-contained-html -s tests/analysis/integration_testing_rules.py::test_test_rules --mode tensorflow --path_to_config ./tests/analysis/config.yaml
6-
TORNASOLE_LOG_LEVEL=debug python -m pytest --html=upload/$CURRENT_COMMIT_PATH/reports/test_rules_mxnet.html --self-contained-html -s tests/analysis/integration_testing_rules.py::test_test_rules --mode mxnet --path_to_config ./tests/analysis/config.yaml
7-
TORNASOLE_LOG_LEVEL=debug python -m pytest --html=upload/$CURRENT_COMMIT_PATH/reports/test_rules_pytorch.html --self-contained-html -s tests/analysis/integration_testing_rules.py::test_test_rules --mode pytorch --path_to_config ./tests/analysis/config.yaml
12+
set -ex
13+
export TORNASOLE_LOG_LEVEL=debug
14+
python -m pytest --html=upload/$CURRENT_COMMIT_PATH/reports/report_analysis.html --self-contained-html tests/analysis
15+
python -m pytest --html=upload/$CURRENT_COMMIT_PATH/reports/report_core.html --self-contained-html tests/core
816

17+
if [ "$run_pytest_tensorflow" = "enable" ] ; then
18+
python -m pytest --html=upload/$CURRENT_COMMIT_PATH/reports/report_tensorflow.html --self-contained-html tests/tensorflow
19+
python -m pytest --html=upload/$CURRENT_COMMIT_PATH/reports/test_rules_tensorflow.html --self-contained-html -s tests/analysis/integration_testing_rules.py::test_test_rules --mode tensorflow --path_to_config ./tests/analysis/config.yaml
20+
fi
21+
22+
if [ "$run_pytest_mxnet" = "enable" ] ; then
23+
python -m pytest --html=upload/$CURRENT_COMMIT_PATH/reports/report_mxnet.html --self-contained-html tests/mxnet
24+
python -m pytest --html=upload/$CURRENT_COMMIT_PATH/reports/test_rules_mxnet.html --self-contained-html -s tests/analysis/integration_testing_rules.py::test_test_rules --mode mxnet --path_to_config ./tests/analysis/config.yaml
25+
fi
26+
27+
if [ "$run_pytest_pytorch" = "enable" ] ; then
28+
python -m pytest --html=upload/$CURRENT_COMMIT_PATH/reports/report_pytorch.html --self-contained-html tests/pytorch
29+
python -m pytest --html=upload/$CURRENT_COMMIT_PATH/reports/test_rules_pytorch.html --self-contained-html -s tests/analysis/integration_testing_rules.py::test_test_rules --mode pytorch --path_to_config ./tests/analysis/config.yaml
30+
fi
31+
32+
check_logs upload/$CURRENT_COMMIT_PATH/reports/report_analysis.html
33+
check_logs upload/$CURRENT_COMMIT_PATH/reports/report_core.html
34+
check_logs upload/$CURRENT_COMMIT_PATH/reports/report_tensorflow.html
35+
check_logs upload/$CURRENT_COMMIT_PATH/reports/report_mxnet.html
36+
check_logs upload/$CURRENT_COMMIT_PATH/reports/report_pytorch.html
37+
check_logs upload/$CURRENT_COMMIT_PATH/reports/test_rules_tensorflow.html
38+
check_logs upload/$CURRENT_COMMIT_PATH/reports/test_rules_mxnet.html
39+
check_logs upload/$CURRENT_COMMIT_PATH/reports/test_rules_pytorch.html

0 commit comments

Comments
 (0)