<commit_before>#!/bin/bash

# Based on https://gist.github.com/petere/6023944

set -eux

sudo apt-get update

packages="python-setuptools postgresql-$PGVERSION postgresql-server-dev-$PGVERSION postgresql-common"

# bug: http://www.postgresql.org/message-id/20130508192711.GA9243@msgid.df7cb.de
sudo update-alternatives --remove-all postmaster.1.gz

# stop all existing instances (because of https://github.com/travis-ci/travis-cookbooks/pull/221)
sudo service postgresql stop
# and make sure they don't come back
echo 'exit 0' | sudo tee /etc/init.d/postgresql
sudo chmod a+x /etc/init.d/postgresql

sudo apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install $packages

sudo easy_install pgxnclient

sudo pg_createcluster --start $PGVERSION test -p 55435 -- -A trust
make test PG_CONFIG=/usr/lib/postgresql/$PGVERSION/bin/pg_config

[ ! -e test/regression.diffs ]<commit_msg>Need to run make test as root<commit_after>#!/bin/bash

# Based on https://gist.github.com/petere/6023944

set -eux

sudo apt-get update

packages="python-setuptools postgresql-$PGVERSION postgresql-server-dev-$PGVERSION postgresql-common"

# bug: http://www.postgresql.org/message-id/20130508192711.GA9243@<EMAIL>.de
sudo update-alternatives --remove-all postmaster.1.gz

# stop all existing instances (because of https://github.com/travis-ci/travis-cookbooks/pull/221)
sudo service postgresql stop
# and make sure they don't come back
echo 'exit 0' | sudo tee /etc/init.d/postgresql
sudo chmod a+x /etc/init.d/postgresql

sudo apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install $packages

sudo easy_install pgxnclient

sudo pg_createcluster --start $PGVERSION test -p 55435 -- -A trust
# TODO: have base.mk support dynamic sudo
sudo make test PG_CONFIG=/usr/lib/postgresql/$PGVERSION/bin/pg_config

[ ! -e test/regression.diffs ]
{'fraction_non_alphanumeric': 0.12971823498139287, 'fraction_numerical': 0.037745879851143006, 'mean_word_length': 4.519061583577713, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, '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': '7274317', 'n_tokens_mistral': 726, 'n_tokens_neox': 658, 'n_words': 157}