From 790dfb6e0e771bbf03d75f6c5c15121597db7596 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Thu, 26 Sep 2019 14:48:40 +0300 Subject: Travis: move test phases into separate scripts --- .travis/test.sh | 2 ++ .travis/test/mutual_friends.sh | 21 +++++++++++++++++++++ .travis/test/show_status.sh | 19 +++++++++++++++++++ .travis/test/track_status.sh | 6 ++---- 4 files changed, 44 insertions(+), 4 deletions(-) create mode 100755 .travis/test/mutual_friends.sh create mode 100755 .travis/test/show_status.sh (limited to '.travis') 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 +# 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 +# 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 "$@" -- cgit v1.2.3