Skip to content

Commit

Permalink
add descriptions to all the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mpeters committed Dec 14, 2009
1 parent 720c0e8 commit cd68b53
Showing 1 changed file with 27 additions and 27 deletions.
54 changes: 27 additions & 27 deletions t/smoke_signal.t
Expand Up @@ -43,21 +43,21 @@ END {


# test required options # test required options
my $out = `$bin 2>&1`; my $out = `$bin 2>&1`;
like($out, qr/Missing required field 'server'/i); like($out, qr/Missing required field 'server'/i, 'missing --server');
$out = `$bin --server $host 2>&1`; $out = `$bin --server $host 2>&1`;
like($out, qr/Missing required field 'project'/i); like($out, qr/Missing required field 'project'/i, 'missing --project');
$out = `$bin --server $host --project $project_name --username $username --password $pw 2>&1`; $out = `$bin --server $host --project $project_name --username $username --password $pw 2>&1`;
like($out, qr/Missing required field 'file'/i); like($out, qr/Missing required field 'file'/i, 'missing --file');


# invalid file # invalid file
$out = $out =
`$bin --server $host --project $project_name --username $username --password $pw --file stuff 2>&1`; `$bin --server $host --project $project_name --username $username --password $pw --file stuff 2>&1`;
like($out, qr/does not exist/i); like($out, qr/does not exist/i, 'invalid file');


# invalid server # invalid server
$out = $out =
`$bin --server something.tld --project $project_name --username $username --password $pw --file $good_run_gz 2>&1`; `$bin --server something --project $project_name --username $username --password $pw --file $good_run_gz 2>&1`;
like($out, qr/Could not reach/i); like($out, qr/Could not reach/i, 'invalid server');


SKIP: { SKIP: {


Expand All @@ -66,17 +66,17 @@ SKIP: {
`$bin --server $host --project "${project_name}asdf" --username $username --password $pw --file $good_run_gz 2>&1`; `$bin --server $host --project "${project_name}asdf" --username $username --password $pw --file $good_run_gz 2>&1`;
skip("Smolder not running", 14) skip("Smolder not running", 14)
if ($out =~ /Received status 500/); if ($out =~ /Received status 500/);
like($out, qr/do not have access/i); like($out, qr/do not have access/i, 'non-existant project');


# invalid login # invalid login
$out = $out =
`$bin --server $host --project "$project_name" --username $username --password asdf --file $good_run_gz 2>&1`; `$bin --server $host --project "$project_name" --username $username --password asdf --file $good_run_gz 2>&1`;
like($out, qr/Could not login/i); like($out, qr/Could not login/i, 'bad login credentials');


# non-project-member # non-project-member
$out = $out =
`$bin --server $host --project "$project_name" --username $username --password $pw --file $good_run_gz 2>&1`; `$bin --server $host --project "$project_name" --username $username --password $pw --file $good_run_gz 2>&1`;
like($out, qr/do not have access/i); like($out, qr/do not have access/i, 'not a member of the project');


# add this person to the project # add this person to the project
Smolder::DB::ProjectDeveloper->create( Smolder::DB::ProjectDeveloper->create(
Expand Down Expand Up @@ -117,36 +117,36 @@ SKIP: {
my $comments = "Some tests"; my $comments = "Some tests";
$out = $out =
`$bin --server $host --project "$project_name" --username $username --password $pw --file $good_run_gz --comments "$comments" 2>&1`; `$bin --server $host --project "$project_name" --username $username --password $pw --file $good_run_gz --comments "$comments" 2>&1`;
like($out, qr/successfully uploaded/i); like($out, qr/successfully uploaded/i, 'successfully uploaded w/comments');
$out =~ /as #(\d+)/; $out =~ /as #(\d+)/;
$report_id = $1; $report_id = $1;
$report = Smolder::DB::SmokeReport->retrieve($report_id); $report = Smolder::DB::SmokeReport->retrieve($report_id);
is($report->comments, $comments); is($report->comments, $comments, 'correct comments');
Smolder::DB->disconnect(); Smolder::DB->disconnect();


# platform # platform
my $platform = "my platform"; my $platform = "my platform";
$out = $out =
`$bin --server $host --project "$project_name" --username $username --password $pw --file $good_run_gz --comments "$comments" --platform "$platform" 2>&1`; `$bin --server $host --project "$project_name" --username $username --password $pw --file $good_run_gz --comments "$comments" --platform "$platform" 2>&1`;
like($out, qr/successfully uploaded/i); like($out, qr/successfully uploaded/i, 'successful upload w/platform info');
$out =~ /as #(\d+)/; $out =~ /as #(\d+)/;
$report_id = $1; $report_id = $1;
$report = Smolder::DB::SmokeReport->retrieve($report_id); $report = Smolder::DB::SmokeReport->retrieve($report_id);
is($report->comments, $comments); is($report->comments, $comments, 'correct comments');
is($report->platform, $platform); is($report->platform, $platform, 'correct platform');
Smolder::DB->disconnect(); Smolder::DB->disconnect();


# architecture # architecture
my $arch = "128 bit something"; my $arch = "128 bit something";
$out = $out =
`$bin --server $host --project "$project_name" --username $username --password $pw --file $good_run_gz --comments "$comments" --platform "$platform" --architecture "$arch" 2>&1`; `$bin --server $host --project "$project_name" --username $username --password $pw --file $good_run_gz --comments "$comments" --platform "$platform" --architecture "$arch" 2>&1`;
like($out, qr/successfully uploaded/i); like($out, qr/successfully uploaded/i, 'successful upload w/arch');
$out =~ /as #(\d+)/; $out =~ /as #(\d+)/;
$report_id = $1; $report_id = $1;
$report = Smolder::DB::SmokeReport->retrieve($report_id); $report = Smolder::DB::SmokeReport->retrieve($report_id);
is($report->comments, $comments); is($report->comments, $comments, 'correct comments');
is($report->platform, $platform); is($report->platform, $platform, 'correct platform');
is($report->architecture, $arch); is($report->architecture, $arch, 'correct arch');
Smolder::DB->disconnect(); Smolder::DB->disconnect();


# tags # tags
Expand All @@ -157,13 +157,13 @@ SKIP: {
. join(', ', @tags) . join(', ', @tags)
. qq(" 2>&1); . qq(" 2>&1);
$out = `$cmd`; $out = `$cmd`;
like($out, qr/successfully uploaded/i); like($out, qr/successfully uploaded/i, 'successful upload w/tags');
$out =~ /as #(\d+)/; $out =~ /as #(\d+)/;
$report_id = $1; $report_id = $1;
$report = Smolder::DB::SmokeReport->retrieve($report_id); $report = Smolder::DB::SmokeReport->retrieve($report_id);
is($report->comments, $comments); is($report->comments, $comments, 'correct comments');
is($report->platform, $platform); is($report->platform, $platform, 'correct platform');
is($report->architecture, $arch); is($report->architecture, $arch, 'correct arch');
my @assigned_tags = $report->tags; my @assigned_tags = $report->tags;
cmp_ok(@tags, '==', 2, 'correct number of tags'); cmp_ok(@tags, '==', 2, 'correct number of tags');


Expand All @@ -176,7 +176,7 @@ SKIP: {
# non-public project anonymous # non-public project anonymous
$cmd = qq($bin --server $host --project "$project_name" --file $good_run_gz --comments "$comments" --platform "$platform" 2>&1); $cmd = qq($bin --server $host --project "$project_name" --file $good_run_gz --comments "$comments" --platform "$platform" 2>&1);
$out = `$cmd`; $out = `$cmd`;
like($out, qr/not a public project/i); like($out, qr/not a public project/i, 'not a public project');
Smolder::DB->disconnect(); Smolder::DB->disconnect();


# invalid anonymous upload # invalid anonymous upload
Expand All @@ -186,7 +186,7 @@ SKIP: {
Smolder::DB->disconnect(); Smolder::DB->disconnect();
$cmd = qq($bin --server $host --project "$project_name" --file $good_run_gz --comments "$comments" --platform "$platform" 2>&1); $cmd = qq($bin --server $host --project "$project_name" --file $good_run_gz --comments "$comments" --platform "$platform" 2>&1);
$out = `$cmd`; $out = `$cmd`;
like($out, qr/not allow anonymous/i); like($out, qr/not allow anonymous/i, 'no anonymous uploads');
Smolder::DB->disconnect(); Smolder::DB->disconnect();


# anonymous upload # anonymous upload
Expand All @@ -195,11 +195,11 @@ SKIP: {
Smolder::DB->disconnect(); Smolder::DB->disconnect();
$cmd = qq($bin --server $host --project "$project_name" --file $good_run_gz --comments "$comments" --platform "$platform" 2>&1); $cmd = qq($bin --server $host --project "$project_name" --file $good_run_gz --comments "$comments" --platform "$platform" 2>&1);
$out = `$cmd`; $out = `$cmd`;
like($out, qr/successfully uploaded/i); like($out, qr/successfully uploaded/i, 'successful anonymous upload');
$out =~ /as #(\d+)/; $out =~ /as #(\d+)/;
$report_id = $1; $report_id = $1;
$report = Smolder::DB::SmokeReport->retrieve($report_id); $report = Smolder::DB::SmokeReport->retrieve($report_id);
is($report->comments, $comments); is($report->comments, $comments, 'correct comments');
is($report->platform, $platform); is($report->platform, $platform, 'correct platform');
Smolder::DB->disconnect(); Smolder::DB->disconnect();
} }

0 comments on commit cd68b53

Please sign in to comment.