aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2019-09-26 14:48:40 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2019-09-26 14:48:40 +0300
commit790dfb6e0e771bbf03d75f6c5c15121597db7596 (patch)
tree4c31e8ab4e115655a9bf2bc893e75399ed6f7147
parentTravis: test.sh: -x (diff)
downloadvk-scripts-790dfb6e0e771bbf03d75f6c5c15121597db7596.tar.gz
vk-scripts-790dfb6e0e771bbf03d75f6c5c15121597db7596.zip
Travis: move test phases into separate scripts
Diffstat (limited to '')
-rw-r--r--.travis.yml8
-rwxr-xr-x.travis/test.sh2
-rwxr-xr-x.travis/test/mutual_friends.sh21
-rwxr-xr-x.travis/test/show_status.sh19
-rwxr-xr-x.travis/test/track_status.sh6
5 files changed, 45 insertions, 11 deletions
diff --git a/.travis.yml b/.travis.yml
index c4f6dd0..7d39898 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -4,10 +4,4 @@ python:
- '3.5'
- '3.6'
- '3.7'
-script:
- - python3 -m bin.mutual_friends --format csv kreed58 maxkorzh_official
- - python3 -m bin.mutual_friends --format json kreed58 maxkorzh_official
-
- - python3 -m bin.show_status egor.tensin
-
- - ./.travis/test.sh
+script: ./.travis/test.sh
diff --git a/.travis/test.sh b/.travis/test.sh
index 03bfaca..d48d3f5 100755
--- a/.travis/test.sh
+++ b/.travis/test.sh
@@ -7,5 +7,7 @@
set -o xtrace
+./.travis/test/mutual_friends.sh
+./.travis/test/show_status.sh
./.travis/test/track_status.sh
./.travis/test/online_sessions.sh
diff --git a/.travis/test/mutual_friends.sh b/.travis/test/mutual_friends.sh
new file mode 100755
index 0000000..ebe0c17
--- /dev/null
+++ b/.travis/test/mutual_friends.sh
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2019 Egor Tensin <Egor.Tensin@gmail.com>
+# This file is part of the "VK scripts" project.
+# For details, see https://github.com/egor-tensin/vk-scripts.
+# Distributed under the MIT License.
+
+set -o errexit -o nounset -o pipefail
+
+mutual_friends() {
+ echo 'Running mutual_friends.py --format csv...'
+ python3 -m bin.mutual_friends --format csv "$@"
+ echo 'Running mutual_friends.py --format json...'
+ python3 -m bin.mutual_friends --format json "$@"
+}
+
+main() {
+ mutual_friends kreed58 maxkorzh_official
+}
+
+main "$@"
diff --git a/.travis/test/show_status.sh b/.travis/test/show_status.sh
new file mode 100755
index 0000000..afba9aa
--- /dev/null
+++ b/.travis/test/show_status.sh
@@ -0,0 +1,19 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2019 Egor Tensin <Egor.Tensin@gmail.com>
+# This file is part of the "VK scripts" project.
+# For details, see https://github.com/egor-tensin/vk-scripts.
+# Distributed under the MIT License.
+
+set -o errexit -o nounset -o pipefail
+
+show_status() {
+ echo 'Running show_status.py...'
+ python3 -m bin.show_status "$@"
+}
+
+main() {
+ show_status egor.tensin
+}
+
+main "$@"
diff --git a/.travis/test/track_status.sh b/.travis/test/track_status.sh
index 5102088..afdfea1 100755
--- a/.travis/test/track_status.sh
+++ b/.travis/test/track_status.sh
@@ -7,8 +7,6 @@
set -o errexit -o nounset -o pipefail
-readonly uid='egor.tensin'
-
track_status() {
local log_path
log_path="$( mktemp )"
@@ -24,7 +22,7 @@ track_status() {
trap "$rm_aux_files" RETURN
echo 'Running track_status.py...'
- python3 -m bin.track_status "$uid" --log "$log_path" --format csv --output "$db_path" &
+ python3 -m bin.track_status "$@" --log "$log_path" --format csv --output "$db_path" &
local pid="$!"
echo "Its PID is $pid"
@@ -44,7 +42,7 @@ track_status() {
}
main() {
- track_status
+ track_status egor.tensin
}
main "$@"