Skip to content

Commit

Permalink
Record to tmp dir in integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
ku1ik committed Jul 12, 2016
1 parent d594d79 commit 6208dfb
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions tests/integration.sh
Expand Up @@ -4,7 +4,8 @@ set -e
set -x

export ASCIINEMA_CONFIG_HOME=`mktemp -d 2>/dev/null || mktemp -d -t asciinema-config-home`
trap "echo rm -rf $ASCIINEMA_CONFIG_HOME" EXIT
TMP_DATA_DIR=`mktemp -d 2>/dev/null || mktemp -d -t asciinema-data-dir`
trap "echo rm -rf $ASCIINEMA_CONFIG_HOME $TMP_DATA_DIR" EXIT

function asciinema() {
python3 -m asciinema "$@"
Expand All @@ -16,17 +17,13 @@ asciinema --version

asciinema auth

asciinema rec -c who __tmp.json
rm -f __tmp.json
asciinema rec -c who "$TMP_DATA_DIR/1.json"

bash -c "sleep 1; pkill -28 -n -f 'm asciinema'" &
asciinema rec -c 'bash -c "echo t3st; sleep 2; echo ok"' __tmp.json
rm -f __tmp.json
asciinema rec -c 'bash -c "echo t3st; sleep 2; echo ok"' "$TMP_DATA_DIR/2.json"

bash -c "sleep 1; pkill -n -f 'bash -c echo t3st'" &
asciinema rec -c 'bash -c "echo t3st; sleep 2; echo ok"' __tmp.json
rm -f __tmp.json
asciinema rec -c 'bash -c "echo t3st; sleep 2; echo ok"' "$TMP_DATA_DIR/3.json"

bash -c "sleep 1; pkill -9 -n -f 'bash -c echo t3st'" &
asciinema rec -c 'bash -c "echo t3st; sleep 2; echo ok"' __tmp.json
rm -f __tmp.json
asciinema rec -c 'bash -c "echo t3st; sleep 2; echo ok"' "$TMP_DATA_DIR/4.json"

0 comments on commit 6208dfb

Please sign in to comment.