<commit_before>#!/bin/bash

OSDN_ROOT=$(readlink -f -- $(dirname "${BASH_SOURCE}")/..)

TEST_BASE_DIR=_output/src/github.com/openshift
# symlink $TEST_BASE_DIR/openshift-sdn to source dir
if [ ! -L "$TEST_BASE_DIR/openshift-sdn" ]; then
  mkdir -p $TEST_BASE_DIR || true
  pushd $TEST_BASE_DIR
  ln -s ../../../../ openshift-sdn || true
  popd
fi

GOPATH=${OSDN_ROOT}/_output:${OSDN_ROOT}/Godeps/_workspace
export GOPATH

go test -v github.com/openshift/openshift-sdn/pkg/netutils
go test -v github.com/openshift/openshift-sdn/pkg/netutils/server<commit_msg>Allowing running single tests via "WHAT=pkg/foo ./hack/test.sh"<commit_after>#!/bin/bash

OSDN_ROOT=$(readlink -f -- $(dirname "${BASH_SOURCE}")/..)

TEST_BASE_DIR=_output/src/github.com/openshift
# symlink $TEST_BASE_DIR/openshift-sdn to source dir
if [ ! -L "$TEST_BASE_DIR/openshift-sdn" ]; then
  mkdir -p $TEST_BASE_DIR || true
  pushd $TEST_BASE_DIR
  ln -s ../../../../ openshift-sdn || true
  popd
fi

GOPATH=${OSDN_ROOT}/_output:${OSDN_ROOT}/Godeps/_workspace
export GOPATH

ALL_TESTS="
pkg/netutils
pkg/netutils/server
"
for test in ${WHAT:-${ALL_TESTS}}; do
    go test -v github.com/openshift/openshift-sdn/${test}
done
{'fraction_non_alphanumeric': 0.16736753574432295, 'fraction_numerical': 0.0, 'mean_word_length': 4.151515151515151, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '169681', 'n_tokens_mistral': 491, 'n_tokens_neox': 462, 'n_words': 86}