<commit_before>#!/bin/bash

. $(dirname $0)/../provider.sh

oneTimeSetUp() {
  setup_containers
  make_container NAME
  sleep 7
}

oneTimeTearDown() {
  remove_containers
}

testLink() {
  #local ip="$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' $name)"

  assertSucceeds "Test connection" \
    docker run --rm --link $NAME:dokdb $PROVIDER test -q
}

testAdminLink() {
  assertSucceeds "Test connection" \
    docker run --rm --link $NAME:dokdb $PROVIDER test -q --admin
}

testRestart() {
  make_container RESTARTED
  sleep 6

  local cid="$(docker run -d --link $RESTARTED:dokdb $PROVIDER test -q)"
  local ext=$(docker wait $cid)
  assertEquals "Test connection" "0" "$ext"
<commit_msg>Added tests of supplying a DATABASE_URL to the test action.<commit_after>#!/bin/bash

. $(dirname $0)/../provider.sh

oneTimeSetUp() {
  setup_containers
  make_container NAME
  sleep 7
}

oneTimeTearDown() {
  remove_containers
}

testLink() {
  #local ip="$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' $name)"

  assertSucceeds "Test connection" \
    docker run --rm --link $NAME:dokdb $PROVIDER test -q
}

testAdminLink() {
  assertSucceeds "Test connection" \
    docker run --rm --link $NAME:dokdb $PROVIDER test -q --admin
}

testURL() {
  make_container NON_LINKED
  local ip="$(docker inspect -f '{{ .NetworkSettings.IPAddress }}' $NON_LINKED)"
  local url="$(docker run --rm --link $NON_LINKED:dokdb $PROVIDER url)"
  sleep 6

  assertSucceeds "Test connection" \
    docker run --rm -e "DATABASE_URL=$url" --link $NAME:blabla $PROVIDER test -q
}

testURLTakesPrecedent() {
  assertFails "Test connection" \
    docker run --rm -e "DATABASE_URL=test://127.0.0.1/testname" --link $NAME:dokdb $PROVIDER test -q
}

testRestart() {
  make_container RESTARTED
  sleep 6

  local cid="$(docker run -d --link $RESTARTED:dokdb $PROVIDER test -q)"
  local ext=$(docker wait $cid)
  assertEquals "Test connection" "0" "$ext"

{'fraction_non_alphanumeric': 0.144987146529563, 'fraction_numerical': 0.007712082262210797, 'mean_word_length': 3.711864406779661, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, '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': '3192541', 'n_tokens_mistral': 731, 'n_tokens_neox': 689, 'n_words': 185}