Fix write_services.t samples. Make send_data.t deterministic.

This commit is contained in:
Daniel Nichter
2013-01-31 17:14:32 -07:00
parent 3f4a02e1fb
commit 5e362d9e4b
5 changed files with 20 additions and 8 deletions

View File

@@ -1,4 +1,8 @@
{"id":"123","hostname":"prod1"}
{
"hostname" : "prod1",
"id" : "123"
}
--Ym91bmRhcnk=
[
{

View File

@@ -7,9 +7,9 @@
"runs" : [
{
"number" : "0",
"options" : "--report-format profile /Users/daniel/p/pt-agent/t/lib/samples/slowlogs/slow008.txt",
"options" : "--report-format profile slow008.txt",
"output" : "spool",
"program" : "/Users/daniel/p/pt-agent/bin/pt-query-digest"
"program" : "pt-query-digest"
}
],
"spool_schedule" : "2 * * * *"

View File

@@ -29,7 +29,7 @@ my $sample = "t/pt-agent/samples";
# These aren't the real tests yet: to run_agent(), first we need
# a client and Agent, so create mock ones.
my $json = JSON->new;
my $json = JSON->new->canonical([1])->pretty;
$json->allow_blessed([]);
$json->convert_blessed([]);
@@ -78,7 +78,7 @@ is_deeply(
) or die;
# #############################################################################
# Test send_data()
# Test send_data
# #############################################################################
my $tmpdir = tempdir("/tmp/pt-agent.$PID.XXXXXX", CLEANUP => 1);
@@ -104,6 +104,7 @@ my $output = output(
service => 'query-monitor',
lib_dir => $tmpdir,
spool_dir => $tmpdir,
json => $json, # optional, for testing
),
},
stderr => 1,

View File

@@ -65,8 +65,8 @@ sub test_write_services {
my $run0 = Percona::WebAPI::Resource::Run->new(
number => '0',
program => "$trunk/bin/pt-query-digest",
options => "--report-format profile $trunk/t/lib/samples/slowlogs/slow008.txt",
program => "pt-query-digest",
options => "--report-format profile slow008.txt",
output => 'spool',
);