<commit_before>#!/bin/bash
set -e
set -x


# Hard-coding the development VM during migration from Serverspec -> Testinfra.
#if [[ $# -lt 1 ]]; then
#    echo "Usage: $0 <host>"
#    exit 1
#fi

target_host=${1:development}
#shift 1

testinfra \
    -v \
    --connection ansible \
    --ansible-inventory .vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory \
    --hosts "${target_host}" \
    testinfra/development \
    testinfra/app-code \
    testinfra/mon\
    ${@:2}<commit_msg>Exports env var for targeting hosts in testinfra run<commit_after>#!/bin/bash
set -e
set -x


# Hard-coding the development VM during migration from Serverspec -> Testinfra.
#if [[ $# -lt 1 ]]; then
#    echo "Usage: $0 <host>"
#    exit 1
#fi

target_host=${1:development}
#shift 1


# Set env var so that `testinfra/conftest.py` can read in a YAML vars file
# specific to the host being tested.
export SECUREDROP_TESTINFRA_TARGET_HOST="${target_host}"

testinfra \
    -v \
    --connection ansible \
    --ansible-inventory .vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory \
    --hosts "${target_host}" \
    testinfra/development \
    testinfra/app-code \
    testinfra/mon\
    ${@:2}
{'fraction_non_alphanumeric': 0.1318407960199005, 'fraction_numerical': 0.009950248756218905, 'mean_word_length': 3.1194539249146755, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4466720', 'n_tokens_mistral': 452, 'n_tokens_neox': 416, 'n_words': 108}