Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the mysql tests configurable #49

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 17 additions & 9 deletions t/004_runtime_mysql.t
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,18 @@ use lib "$FindBin::Bin/lib/";
use My::ModifierResub;
use My::Common;

if (! $ENV{MYSQL_TESTS}) {
ok 1, "Skipping tests as \$ENV{MYSQL_TESTS} is not set; this is for developer regression testing";
done_testing;
exit;
BEGIN
{
if (! $ENV{MYSQL_TESTS}) {
note 'To configure the database server used to test against';
note 'set these environment variables, MYSQL_TEST_CLIENT, MYSQL_TEST_HOST,';
note 'MYSQL_TEST_DB, MYSQL_TEST_USER and MYSQL_TEST_PASSWORD';
note '';
note 'For example,';
note 'MYSQL_TEST_CLIENT=`which mysql` MYSQL_TEST_HOST=mysql MYSQL_TEST_DB=test MYSQL_TEST_USER=dev MYSQL_TEST_PASSWORD=devpass MYSQL_TESTS=1 prove -l t';
note '';
plan skip_all => "Skipping tests as \$ENV{MYSQL_TESTS} is not set; this is for developer regression testing";
}
}

BEGIN {
Expand All @@ -22,15 +30,15 @@ BEGIN {
## Setup

%db_config = (
user => 'perl_tester',
password => '',
database => 'test_altsql',
host => 'localhost',
user => $ENV{MYSQL_TEST_USER} || 'perl_tester',
password => $ENV{MYSQL_TEST_PASSWORD} || '',
database => $ENV{MYSQL_TEST_DB} || 'test_altsql',
host => $ENV{MYSQL_TEST_HOST} || 'localhost',
sql_files => [
$FindBin::Bin . '/sql/sakila-schema.sql',
$FindBin::Bin . '/sql/sakila-data.sql',
],
mysql_client => '/opt/local/bin/mysql5',
mysql_client => $ENV{MYSQL_TEST_CLIENT} || '/opt/local/bin/mysql5',
);

my $app = App::AltSQL->new(
Expand Down