Skip to content

Commit 6766f66

Browse files
committed
Reduce job execution time
1 parent 4018eeb commit 6766f66

File tree

4 files changed

+24
-4
lines changed

4 files changed

+24
-4
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,15 @@ install:
1414
- bash bin/deploy/install_python_dependencies.sh
1515

1616
script:
17-
- sudo bash run_tests.sh
17+
- sudo bash bin/tests/run_tests_on_travis.sh
1818

1919
after_success:
2020
- sudo bash bin/deploy/merge_develop_to_master.sh
2121

2222
before_deploy:
2323
- echo "Deployment preperation"
2424
- sudo bash setup.sh
25+
- sudo bash run_tests.sh
2526
- bash bin/deploy/new_release_auto_tagging.sh
2627

2728
deploy:

bin/deploy/new_release_auto_tagging.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ tar -cvf jarvis_package.tar -T config/package_file_list.txt
88
echo "Add tags to new release"
99
git config --global user.email "[email protected]"
1010
git config --global user.name "Travis CI"
11-
export GIT_TAG=$TRAVIS_BRANCH-$TRAVIS_BUILD_NUMBER
11+
export GIT_TAG=$TRAVIS_BRANCH-build_$TRAVIS_BUILD_NUMBER
1212
git tag $GIT_TAG -a -m "Generated tag from TravisCI for build $TRAVIS_BUILD_NUMBER"
1313
git push -q https://$GITHUB_TOKEN@github.com/ggeop/Python-ai-assistant --tags

bin/tests/run_tests_on_travis.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env bash
2+
# --------------------------------
3+
# Activate Python virtual env
4+
# --------------------------------
5+
export PYTHONPATH="${PYTHONPATH}:./src/jarvis"
6+
7+
# --------------------------------
8+
# Start MongoDB service
9+
# --------------------------------
10+
sudo systemctl start mongodb
11+
12+
# --------------------------------
13+
# Run unittests
14+
# --------------------------------
15+
python -m unittest discover -s ./src -p "*tests.py"
16+
17+
# --------------------------------
18+
# Stop MongoDB service
19+
# --------------------------------
20+
sudo systemctl stop mongodb

run_tests.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
# Activate Python virtual env
44
# --------------------------------
55
export PYTHONPATH="${PYTHONPATH}:./src/jarvis"
6-
#source jarvis_virtualenv/bin/activate
7-
source ~/virtualenv/python3.8/bin/activate
6+
source jarvis_virtualenv/bin/activate
87

98
# --------------------------------
109
# Start MongoDB service

0 commit comments

Comments
 (0)