<commit_before>#!/usr/bin/env bash

set -x

setup_dynamodb_local() {

    dynamodb_tar_file="dynamodb_local_2015-04-27_1.0.tar.gz"
    dynamodb_dir=$dynamodb_dir

    if ! test -f "$HOME/$dynamodb_tar_file"
    then
      wget --directory-prefix=$HOME -- "http://dynamodb-local.s3-website-us-west-2.amazonaws.com/${dynamodb_tar_file}"
    fi
    mkdir -p "$dynamodb_dir"
    tar -xf $HOME/$dynamodb_tar_file -C ${HOME}/${dynamodb_tar_file}

}

test "$SNAP_CI" == "true" && setup_dynamodb_local

export AWS_ACCESS_KEY_ID='foo'
export AWS_SECRET_ACCESS_KEY='bar'
export AWS_REGION="us-west-2"

export BUNDLE_PATH="${SNAP_CACHE_DIR}/bundle-cache/tiny_ddb"

export JRUBY_OPTS=" -Xcli.debug=true --debug "

bundle install

bundle exec rspec spec/dynamodb_unavailable/ ; unavail_exit_status=$?

test "$unavail_exit_status" -eq 0 || exit $unavail_exit_status
<commit_msg>fix the unpacking of the downloaded tar<commit_after>#!/usr/bin/env bash

set -x

setup_dynamodb_local() {

    dynamodb_tar_file="dynamodb_local_2015-04-27_1.0.tar.gz"
    dynamodb_dir=$HOME/dynamodb_local

    if ! test -f "$HOME/$dynamodb_tar_file"
    then
      wget --directory-prefix=$HOME -- "http://dynamodb-local.s3-website-us-west-2.amazonaws.com/${dynamodb_tar_file}"
    fi
    mkdir -p "$dynamodb_dir"
    tar -xf $HOME/$dynamodb_tar_file -C ${HOME}/${dynamodb_dir}

}

test "$SNAP_CI" == "true" && setup_dynamodb_local

export AWS_ACCESS_KEY_ID='foo'
export AWS_SECRET_ACCESS_KEY='bar'
export AWS_REGION="us-west-2"

export BUNDLE_PATH="${SNAP_CACHE_DIR}/bundle-cache/tiny_ddb"

export JRUBY_OPTS=" -Xcli.debug=true --debug "

bundle install

bundle exec rspec spec/dynamodb_unavailable/ ; unavail_exit_status=$?

test "$unavail_exit_status" -eq 0 || exit $unavail_exit_status

{'fraction_non_alphanumeric': 0.13724373576309795, 'fraction_numerical': 0.015945330296127564, 'mean_word_length': 4.631410256410256, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3454367', 'n_tokens_mistral': 750, 'n_tokens_neox': 707, 'n_words': 112}