- new look-and-feel code, css into css/ directory;

- javascript broken out into own directory;
- updated db schema to handle automated test results, along with associted Perl classes;
- reporting: searching and advanced searching functionality added;
This commit is contained in:
ccooper%deadsquid.com 2005-10-11 18:44:16 +00:00
Родитель 78043464af
Коммит 986d1eed54
112 изменённых файлов: 5510 добавлений и 1507 удалений

Просмотреть файл

@ -1,23 +1,34 @@
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s): Zach Lipton <zach@zachlipton.com>
# -*- mode: cperl; c-basic-offset: 8; indent-tabs-mode: nil; -*-
=head1 COPYRIGHT
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License
# at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and
# limitations under the License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is
# the Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Chris Cooper <ccooper@deadsquid.com>
# Zach Lipton <zach@zachlipton.com>
#
# ***** END LICENSE BLOCK *****
=cut
# Persistant object store for various objects used by
# different modules within Litmus
@ -44,4 +55,4 @@ sub template() {
return $_template;
}
1;
1;

Просмотреть файл

@ -1,23 +1,34 @@
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s): Zach Lipton <zach@zachlipton.com>
# -*- mode: cperl; c-basic-offset: 8; indent-tabs-mode: nil; -*-
=head1 COPYRIGHT
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License
# at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and
# limitations under the License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is
# the Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Chris Cooper <ccooper@deadsquid.com>
# Zach Lipton <zach@zachlipton.com>
#
# ***** END LICENSE BLOCK *****
=cut
package Litmus::Auth;
@ -68,6 +79,8 @@ sub getCookie() {
sub istrusted($) {
my $userobj = shift;
return 0 if (!$userobj);
if ($userobj->istrusted()) {
return 1;
@ -82,4 +95,4 @@ sub canEdit($) {
return $userobj->istrusted();
}
1;
1;

Просмотреть файл

@ -1,25 +1,34 @@
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s): Zach Lipton <zach@zachlipton.com>
# -*- mode: cperl; c-basic-offset: 8; indent-tabs-mode: nil; -*-
# Caching of product/group/subgroup data for litmusconfig.js
=head1 COPYRIGHT
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License
# at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and
# limitations under the License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is
# the Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Chris Cooper <ccooper@deadsquid.com>
# Zach Lipton <zach@zachlipton.com>
#
# ***** END LICENSE BLOCK *****
=cut
package Litmus::Cache;
@ -111,4 +120,4 @@ sub rebuildCache {
system("chmod", "-R", "755", "data/");
}
1;
1;

Просмотреть файл

@ -1,23 +1,34 @@
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s): Zach Lipton <zach@zachlipton.com>
# -*- mode: cperl; c-basic-offset: 8; indent-tabs-mode: nil; -*-
=head1 COPYRIGHT
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License
# at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and
# limitations under the License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is
# the Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Chris Cooper <ccooper@deadsquid.com>
# Zach Lipton <zach@zachlipton.com>
#
# ***** END LICENSE BLOCK *****
=cut
package Litmus::Config;

Просмотреть файл

@ -1,23 +1,34 @@
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s): Zach Lipton <zach@zachlipton.com>
# -*- mode: cperl; c-basic-offset: 8; indent-tabs-mode: nil; -*-
=head1 COPYRIGHT
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License
# at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and
# limitations under the License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is
# the Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Chris Cooper <ccooper@deadsquid.com>
# Zach Lipton <zach@zachlipton.com>
#
# ***** END LICENSE BLOCK *****
=cut
package Litmus::DB::Branch;
@ -34,4 +45,4 @@ Litmus::DB::Branch->column_alias("product_id", "product");
Litmus::DB::Branch->has_many(testresults => "Litmus::DB::Testresult");
Litmus::DB::Branch->has_a(product => "Litmus::DB::Product");
1;
1;

Просмотреть файл

@ -0,0 +1,44 @@
# -*- mode: cperl; c-basic-offset: 8; indent-tabs-mode: nil; -*-
=head1 COPYRIGHT
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License
# at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and
# limitations under the License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is
# the Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Chris Cooper <ccooper@deadsquid.com>
# Zach Lipton <zach@zachlipton.com>
#
# ***** END LICENSE BLOCK *****
=cut
package Litmus::DB::BuildType;
use strict;
use base 'Litmus::DBI';
Litmus::DB::BuildType->table('build_type_lookup');
Litmus::DB::BuildType->columns(All => qw/build_type_id name/);
Litmus::DB::BuildType->has_many(test_results => "Litmus::DB::Testresult");
1;

Просмотреть файл

@ -1,23 +1,34 @@
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s): Zach Lipton <zach@zachlipton.com>
# -*- mode: cperl; c-basic-offset: 8; indent-tabs-mode: nil; -*-
=head1 COPYRIGHT
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License
# at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and
# limitations under the License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is
# the Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Chris Cooper <ccooper@deadsquid.com>
# Zach Lipton <zach@zachlipton.com>
#
# ***** END LICENSE BLOCK *****
=cut
package Litmus::DB::Comment;
@ -37,4 +48,4 @@ Litmus::DB::Comment->has_a(user => "Litmus::DB::User");
Litmus::DB::Testresult->autoinflate(dates => 'Time::Piece');
1;
1;

Просмотреть файл

@ -0,0 +1,44 @@
# -*- mode: cperl; c-basic-offset: 8; indent-tabs-mode: nil; -*-
=head1 COPYRIGHT
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License
# at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and
# limitations under the License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is
# the Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Chris Cooper <ccooper@deadsquid.com>
# Zach Lipton <zach@zachlipton.com>
#
# ***** END LICENSE BLOCK *****
=cut
package Litmus::DB::ExitStatus;
use strict;
use base 'Litmus::DBI';
Litmus::DB::ExitStatus->table('exit_status_lookup');
Litmus::DB::ExitStatus->columns(All => qw/exit_status_id name/);
Litmus::DB::ExitStatus->has_many(test_results => "Litmus::DB::Testresult");
1;

Просмотреть файл

@ -1,33 +1,40 @@
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s): Zach Lipton <zach@zachlipton.com>
# -*- mode: cperl; c-basic-offset: 8; indent-tabs-mode: nil; -*-
=head1 COPYRIGHT
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License
# at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and
# limitations under the License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is
# the Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Chris Cooper <ccooper@deadsquid.com>
# Zach Lipton <zach@zachlipton.com>
#
# ***** END LICENSE BLOCK *****
=cut
package Litmus::DB::Format;
use strict;
use base 'Litmus::DBI';
use IO::File;
use Litmus::Error;
use Litmus;
Litmus::DB::Format->table('test_format_lookup');
Litmus::DB::Format->columns(All => qw/format_id name/);
@ -36,95 +43,4 @@ Litmus::DB::Format->column_alias("format_id", "formatid");
Litmus::DB::Format->has_many(tests => "Litmus::DB::Test");
# WARNING: THIS RELIES ON AN UNDOCUMENTED API IN CLASS::DBI (_init)
# we do some dark magic here to load in the format file
# when we get created:
sub _init {
my $self = shift;
$self = $self->SUPER::_init(@_);
$self->loadFormatFile();
return $self;
}
# here's where the real magic happens. Each format file has a %column_mappings
# hash that maps a format column (i.e. something like steps or expectedresults
# or something similarly useful to human beings) to a database column (i.e.
# t1 and friends). Give this sub a format column name, and you'll get the
# database column name back.
sub getColumnMapping {
my $self = shift;
my $colname = shift;
return $self->{LITMUS_column_mappings}{$colname};
}
# return a list of all fields defined by the format
sub fields {
my $self = shift;
return keys(%{$self->{LITMUS_column_mappings}});
}
sub loadFormatFile {
my $self = shift;
unless ($self->name()) {
internalError("Invalid or non-existant format found");
}
my $formatdir = "formats/".$self->name()."/";
my $formatfile = $formatdir.$self->name().".pl";
unless (-e $formatfile) {
internalError("Could not locate format file for format ". $self->formatid());
}
our %column_mappings;
do($formatfile);
internalError("couldn't parse format file $formatfile: $@") if $@;
internalError("couldn't execute format file $formatfile: $!") if $!;
# store the column mapping table and formatdir for later use
$self->{LITMUS_column_mappings} = \%column_mappings;
$self->{LITMUS_format_dir} = $formatdir;
}
# this gets called from templates when we want to actually display the data
# held by a format. We're given the test object and the name of the
# format template to display. The template we process gets a "test" variable
# with the testcase to display data for.
sub display {
my $self = shift;
my $test = shift; # test object
my $showedit = shift; # show test editing UI?
my $template = shift; # the format template to process
# we need a new Template object here or we collide with ourself:
my $t = Litmus::Template->create();
my $vars = {
test => $test,
showedit => $showedit,
};
# the template file to process itself:
my $templateloc = $self->{LITMUS_format_dir}.$template;
# since the format template is outside the include path, we
# use IO::File to open a filehandle and hand it to process()
my $fh = new IO::File;
$fh->open("< ".$templateloc) ||
internalError("could not open format template $templateloc");
my $output = ''; # store the output and pass it to our caller
$t->process($fh, $vars, \$output) ||
internalError("could not process format template $templateloc");
return $output;
}
1;
1;

Просмотреть файл

@ -1,23 +1,34 @@
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s): Zach Lipton <zach@zachlipton.com>
# -*- mode: cperl; c-basic-offset: 8; indent-tabs-mode: nil; -*-
=head1 COPYRIGHT
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License
# at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and
# limitations under the License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is
# the Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Chris Cooper <ccooper@deadsquid.com>
# Zach Lipton <zach@zachlipton.com>
#
# ***** END LICENSE BLOCK *****
=cut
package Litmus::DB::Log;
@ -26,13 +37,15 @@ use base 'Litmus::DBI';
Litmus::DB::Log->table('test_result_logs');
Litmus::DB::Log->columns(All => qw/log_id test_result_id last_updated submission_time log_path/);
Litmus::DB::Log->columns(All => qw/log_id test_result_id last_updated submission_time log_type_id log_text/);
Litmus::DB::Log->column_alias("log_id", "logid");
Litmus::DB::Log->column_alias("test_result_id", "testresult");
Litmus::DB::Log->column_alias("log_type_id", "log_type");
Litmus::DB::Log->has_a(test_result_id => "Litmus::DB::Testresult");
Litmus::DB::Log->has_a(log_type => "Litmus::DB::LogType");
Litmus::DB::Testresult->autoinflate(dates => 'Time::Piece');
1;
1;

Просмотреть файл

@ -0,0 +1,44 @@
# -*- mode: cperl; c-basic-offset: 8; indent-tabs-mode: nil; -*-
=head1 COPYRIGHT
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License
# at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and
# limitations under the License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is
# the Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Chris Cooper <ccooper@deadsquid.com>
# Zach Lipton <zach@zachlipton.com>
#
# ***** END LICENSE BLOCK *****
=cut
package Litmus::DB::LogType;
use strict;
use base 'Litmus::DBI';
Litmus::DB::LogType->table('log_type_lookup');
Litmus::DB::LogType->columns(All => qw/log_type_id name/);
Litmus::DB::LogType->has_many(test_result_logs => "Litmus::DB::Log");
1;

Просмотреть файл

@ -1,23 +1,34 @@
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s): Zach Lipton <zach@zachlipton.com>
# -*- mode: cperl; c-basic-offset: 8; indent-tabs-mode: nil; -*-
=head1 COPYRIGHT
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License
# at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and
# limitations under the License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is
# the Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Chris Cooper <ccooper@deadsquid.com>
# Zach Lipton <zach@zachlipton.com>
#
# ***** END LICENSE BLOCK *****
=cut
package Litmus::DB::Opsys;
@ -34,4 +45,4 @@ Litmus::DB::Opsys->column_alias("platform_id", "platform");
Litmus::DB::Opsys->has_many(testresults => "Litmus::DB::Testresult");
Litmus::DB::Opsys->has_a(platform => "Litmus::DB::Platform");
1;
1;

Просмотреть файл

@ -1,23 +1,34 @@
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s): Zach Lipton <zach@zachlipton.com>
# -*- mode: cperl; c-basic-offset: 8; indent-tabs-mode: nil; -*-
=head1 COPYRIGHT
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License
# at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and
# limitations under the License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is
# the Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Chris Cooper <ccooper@deadsquid.com>
# Zach Lipton <zach@zachlipton.com>
#
# ***** END LICENSE BLOCK *****
=cut
package Litmus::DB::Platform;
@ -52,4 +63,4 @@ sub autodetect {
}
}
1;
1;

Просмотреть файл

@ -1,23 +1,34 @@
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s): Zach Lipton <zach@zachlipton.com>
# -*- mode: cperl; c-basic-offset: 8; indent-tabs-mode: nil; -*-
=head1 COPYRIGHT
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License
# at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and
# limitations under the License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is
# the Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Chris Cooper <ccooper@deadsquid.com>
# Zach Lipton <zach@zachlipton.com>
#
# ***** END LICENSE BLOCK *****
=cut
package Litmus::DB::Product;
@ -35,4 +46,4 @@ Litmus::DB::Product->has_many(testgroups => "Litmus::DB::Testgroup");
Litmus::DB::Product->has_many(branches => "Litmus::DB::Branch");
Litmus::DB::Product->has_many(platforms => "Litmus::DB::Platform");
1;
1;

Просмотреть файл

@ -1,23 +1,34 @@
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s): Zach Lipton <zach@zachlipton.com>
# -*- mode: cperl; c-basic-offset: 8; indent-tabs-mode: nil; -*-
=head1 COPYRIGHT
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License
# at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and
# limitations under the License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is
# the Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Chris Cooper <ccooper@deadsquid.com>
# Zach Lipton <zach@zachlipton.com>
#
# ***** END LICENSE BLOCK *****
=cut
package Litmus::DB::Result;
@ -26,10 +37,10 @@ use base 'Litmus::DBI';
Litmus::DB::Result->table('test_result_status_lookup');
Litmus::DB::Result->columns(All => qw/result_status_id name style/);
Litmus::DB::Result->columns(All => qw/result_status_id name class_name/);
Litmus::DB::Result->column_alias("result_status_id", "resultid");
Litmus::DB::Result->has_many(testresults => "Litmus::DB::Testresult");
1;
1;

Просмотреть файл

@ -1,23 +1,34 @@
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s): Zach Lipton <zach@zachlipton.com>
# -*- mode: cperl; c-basic-offset: 8; indent-tabs-mode: nil; -*-
=head1 COPYRIGHT
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License
# at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and
# limitations under the License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is
# the Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Chris Cooper <ccooper@deadsquid.com>
# Zach Lipton <zach@zachlipton.com>
#
# ***** END LICENSE BLOCK *****
=cut
package Litmus::DB::Resultbug;
@ -26,7 +37,8 @@ use base 'Litmus::DBI';
Litmus::DB::Resultbug->table('test_result_bugs');
Litmus::DB::Resultbug->columns(Primary => qw/test_result_id bug_id/, All => qw/last_updated submission_time user_id/);
Litmus::DB::Resultbug->columns(Primary => qw/test_result_id bug_id/);
Litmus::DB::Resultbug->columns(All => qw/last_updated submission_time user_id/);
Litmus::DB::Resultbug->column_alias("test_result_id", "testresult");
Litmus::DB::Resultbug->column_alias("user_id", "user");
@ -36,4 +48,4 @@ Litmus::DB::Resultbug->has_a(user => "Litmus::DB::User");
Litmus::DB::Testresult->autoinflate(dates => 'Time::Piece');
1;
1;

Просмотреть файл

@ -1,23 +1,34 @@
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s): Zach Lipton <zach@zachlipton.com>
# -*- mode: cperl; c-basic-offset: 8; indent-tabs-mode: nil; -*-
=head1 COPYRIGHT
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License
# at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and
# limitations under the License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is
# the Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Chris Cooper <ccooper@deadsquid.com>
# Zach Lipton <zach@zachlipton.com>
#
# ***** END LICENSE BLOCK *****
=cut
package Litmus::DB::Status;
@ -32,4 +43,4 @@ Litmus::DB::Status->column_alias("test_status_id", "statusid");
Litmus::DB::Status->has_many(tests => "Litmus::DB::Test");
1;
1;

Просмотреть файл

@ -1,23 +1,34 @@
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s): Zach Lipton <zach@zachlipton.com>
# -*- mode: cperl; c-basic-offset: 8; indent-tabs-mode: nil; -*-
=head1 COPYRIGHT
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License
# at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and
# limitations under the License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is
# the Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Chris Cooper <ccooper@deadsquid.com>
# Zach Lipton <zach@zachlipton.com>
#
# ***** END LICENSE BLOCK *****
=cut
package Litmus::DB::Subgroup;
@ -42,43 +53,42 @@ Litmus::DB::Subgroup->has_many(tests => "Litmus::DB::Test");
# find the percentage of testing completed for a particular platform in
# this subgroup, optionally restricting to community enabled tests only
sub percentcompleted {
my $self = shift;
my $platform = shift;
my $communityonly = shift;
my $self = shift;
my $platform = shift;
my $communityonly = shift;
my @tests;
if (! $communityonly) {
@tests = Litmus::DB::Test->search(
subgroup => $self,
status => Litmus::DB::Status->search(name => "Enabled"),
);
} else {
@tests = Litmus::DB::Test->search(
subgroup => $self,
status => Litmus::DB::Status->search(name => "Enabled"),
communityenabled => 1,
);
}
if (@tests == 0) { return "N/A" }
my $numcompleted = 0;
foreach my $curtest (@tests) {
if ($curtest->iscompleted($platform)) {
$numcompleted++;
}
}
my @tests;
if (! $communityonly) {
@tests = Litmus::DB::Test->search(
subgroup => $self,
status => Litmus::DB::Status->search(name => "Enabled"),
);
} else {
@tests = Litmus::DB::Test->search(
subgroup => $self,
status => Litmus::DB::Status->search(name => "Enabled"),
communityenabled => 1,
);
}
if (@tests == 0) { return "N/A" }
my $numcompleted = 0;
foreach my $curtest (@tests) {
if ($curtest->iscompleted($platform)) {
$numcompleted++;
}
}
my $result = ($numcompleted/scalar @tests) * 100;
unless ($result) {
return "0";
}
# truncate to a whole number:
if ($result =~ /\./) {
$result =~ /^(\d*)/;
return $1;
} else {
return $result;
}
my $result = ($numcompleted/scalar @tests) * 100;
unless ($result) {
return "0";
}
# truncate to a whole number:
if ($result =~ /\./) {
$result =~ /^(\d*)/;
return $1;
} else {
return $result;
}
}
1;
1;

Просмотреть файл

@ -1,23 +1,34 @@
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s): Zach Lipton <zach@zachlipton.com>
# -*- mode: cperl; c-basic-offset: 8; indent-tabs-mode: nil; -*-
=head1 COPYRIGHT
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License
# at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and
# limitations under the License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is
# the Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Chris Cooper <ccooper@deadsquid.com>
# Zach Lipton <zach@zachlipton.com>
#
# ***** END LICENSE BLOCK *****
=cut
package Litmus::DB::Test;
@ -32,7 +43,7 @@ Litmus::DB::Test->table('tests');
Litmus::DB::Test->columns(Primary => qw/test_id/);
Litmus::DB::Test->columns(Essential => qw/subgroup_id summary details status_id community_enabled format_id regression_bug_id/);
Litmus::DB::Test->columns(All => qw/t1 t2 t3/);
Litmus::DB::Test->columns(All => qw/steps expected_results/);
Litmus::DB::Test->column_alias("test_id", "testid");
Litmus::DB::Test->column_alias("subgroup_id", "subgroup");
@ -49,63 +60,62 @@ Litmus::DB::Test->has_many(testresults => "Litmus::DB::Testresult", {order_by =>
# we override Class::DBI's find_column() so that when we refer to
# formatted names like steps and expected results, we use the actual
# database columns t1 and t2.
memoize('find_column'); # we use this _a lot_
sub find_column {
my $self = shift;
my $want = shift;
my $col = undef;
if (ref $self) {
$want =~ s/^.*::(\w+)$/$1/;
$col = $self->format_id()->getColumnMapping($want);
}
if ($col) {
return $self->SUPER::find_column($col);
} else {
# didn't find it, so we fall back on the normal
# find_column from Litmus::DBI:
$self->SUPER::find_column($want);
}
}
#memoize('find_column'); # we use this _a lot_
#sub find_column {
# my $self = shift;
# my $want = shift;
#
# my $col = undef;
# if (ref $self) {
# $want =~ s/^.*::(\w+)$/$1/;
# $col = $self->format_id()->getColumnMapping($want);
# }
#
# if ($col) {
# return $self->SUPER::find_column($col);
# } else {
# # didn't find it, so we fall back on the normal
# # find_column from Litmus::DBI:
# $self->SUPER::find_column($want);
# }
#}
# we need to have accessors that correspond to
# the "virtual columns" created by our format. sounds like a job for
# autoload...
sub AUTOLOAD {
my $self = shift;
my @args = @_;
my $name = our $AUTOLOAD;
my $col = $self->find_column($name);
if (!$col) {
internalError("tried to call Litmus::DB::Test method $name which does not exist");
}
return $self->$col(@args);
}
#sub AUTOLOAD {
# my $self = shift;
# my @args = @_;
# my $name = our $AUTOLOAD;
#
# my $col = $self->find_column($name);
#
# if (!$col) {
# internalError("tried to call Litmus::DB::Test method $name which does not exist");
# }
#
# return $self->$col(@args);
#}
# does the test have at least one recent result?
# optionally, just check for a particular platform.
memoize('isrecent');
sub isrecent {
my $self = shift;
my $platform = shift;
my %restrictor;
if ($platform) { $restrictor{platform} = $platform }
my @results = $self->testresults(%restrictor);
foreach my $curresult (@results) {
if ($curresult->isrecent()) {
return 1;
}
my $self = shift;
my $platform = shift;
my %restrictor;
if ($platform) { $restrictor{platform} = $platform }
my @results = $self->testresults(%restrictor);
foreach my $curresult (@results) {
if ($curresult->isrecent()) {
return 1;
}
return 0;
}
return 0;
}
# Right now, a test is considered completed as long as it has at least
# one recent result for that platform. In the future, we would want to
# use some sort of more advanced system where we look at what results
@ -236,4 +246,4 @@ sub testgroup {
return $self->subgroup()->testgroup();
}
1;
1;

Просмотреть файл

@ -1,23 +1,34 @@
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s): Zach Lipton <zach@zachlipton.com>
# -*- mode: cperl; c-basic-offset: 8; indent-tabs-mode: nil; -*-
=head1 COPYRIGHT
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License
# at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and
# limitations under the License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is
# the Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Chris Cooper <ccooper@deadsquid.com>
# Zach Lipton <zach@zachlipton.com>
#
# ***** END LICENSE BLOCK *****
=cut
package Litmus::DB::Testgroup;
@ -39,31 +50,33 @@ Litmus::DB::Testgroup->has_many(subgroups => "Litmus::DB::Subgroup");
# find the total number of tests completed for the group for
# a particular platform and optionally just for community enabled tests
sub percentcompleted {
my $self = shift;
my $platform = shift;
my $communityonly = shift;
my $percentcompleted;
my @subgroups = $self->subgroups();
my $numemptysubgroups = 0;
foreach my $cursubgroup (@subgroups) {
if ($cursubgroup->percentcompleted($platform, $communityonly) eq "N/A") {
$numemptysubgroups++;
}
$percentcompleted += $cursubgroup->percentcompleted($platform,
$communityonly);
}
if (scalar(@subgroups) - $numemptysubgroups == 0) { return "N/A" }
my $totalpercentage = $percentcompleted/(scalar @subgroups - $numemptysubgroups);
# truncate to a whole number:
if ($totalpercentage =~ /\./) {
$totalpercentage =~ /^(\d*)/;
return $1;
my $self = shift;
my $platform = shift;
my $communityonly = shift;
my $percentcompleted;
my @subgroups = $self->subgroups();
my $numemptysubgroups = 0;
foreach my $cursubgroup (@subgroups) {
if ($cursubgroup->percentcompleted($platform, $communityonly) eq "N/A") {
$numemptysubgroups++;
} else {
return $totalpercentage;
$percentcompleted += $cursubgroup->percentcompleted($platform,
$communityonly);
}
}
if (scalar(@subgroups) - $numemptysubgroups == 0) { return "N/A" }
my $totalpercentage = $percentcompleted/(scalar @subgroups - $numemptysubgroups);
# truncate to a whole number:
if ($totalpercentage =~ /\./) {
$totalpercentage =~ /^(\d*)/;
my $percentage = $1;
return $1;
} else {
return $totalpercentage;
}
}
1;
1;

Просмотреть файл

@ -1,36 +1,50 @@
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s): Zach Lipton <zach@zachlipton.com>
# -*- mode: cperl; c-basic-offset: 8; indent-tabs-mode: nil; -*-
=head1 COPYRIGHT
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License
# at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and
# limitations under the License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is
# the Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Chris Cooper <ccooper@deadsquid.com>
# Zach Lipton <zach@zachlipton.com>
#
# ***** END LICENSE BLOCK *****
=cut
package Litmus::DB::Testresult;
use strict;
use base 'Litmus::DBI';
use Date::Manip;
use Time::Piece;
use Time::Seconds;
use Memoize;
our $_num_results_default = 15;
Litmus::DB::Testresult->table('test_results');
Litmus::DB::Testresult->columns(All => qw/testresult_id test_id last_updated submission_time user_id platform_id opsys_id branch_id buildid user_agent result_id log_id/);
Litmus::DB::Testresult->columns(All => qw/testresult_id test_id last_updated submission_time user_id platform_id opsys_id branch_id buildid user_agent result_id build_type_id machine_name exit_status_id duration_ms talkback_id validity_id vetting_status_id/);
Litmus::DB::Testresult->column_alias("testresult_id", "testresultid");
Litmus::DB::Testresult->column_alias("test_id", "testid");
@ -41,8 +55,10 @@ Litmus::DB::Testresult->column_alias("opsys_id", "opsys");
Litmus::DB::Testresult->column_alias("branch_id", "branch");
Litmus::DB::Testresult->column_alias("user_agent", "useragent");
Litmus::DB::Testresult->column_alias("result_id", "result");
Litmus::DB::Testresult->column_alias("log_id", "log");
Litmus::DB::Testresult->column_alias("build_type_id", "build_type");
Litmus::DB::Testresult->column_alias("exit_status_id", "exit_status");
Litmus::DB::Testresult->column_alias("validity_id", "validity");
Litmus::DB::Testresult->column_alias("vetting_status_id", "vetting_status");
Litmus::DB::Testresult->has_a(platform => "Litmus::DB::Platform");
Litmus::DB::Testresult->has_a(opsys => "Litmus::DB::Opsys");
@ -51,15 +67,40 @@ Litmus::DB::Testresult->has_a(testid => "Litmus::DB::Test");
Litmus::DB::Testresult->has_a(result => "Litmus::DB::Result");
Litmus::DB::Testresult->has_a(user => "Litmus::DB::User");
Litmus::DB::Testresult->has_a(useragent => "Litmus::UserAgentDetect");
Litmus::DB::Testresult->has_a("log" => "Litmus::DB::Log");
Litmus::DB::Testresult->has_a(build_type => "Litmus::DB::BuildType");
Litmus::DB::Testresult->has_a(exit_status => "Litmus::DB::ExitStatus");
Litmus::DB::Testresult->has_a(validity => "Litmus::DB::Validity");
Litmus::DB::Testresult->has_a(vetting_status => "Litmus::DB::VettingStatus");
Litmus::DB::Testresult->has_many(comments => "Litmus::DB::Comment", {order_by => 'submission_time'});
Litmus::DB::Testresult->has_many(bugs => "Litmus::DB::Resultbug", {order_by => 'submission_time DESC'});
Litmus::DB::Testresult->has_many("logs" => "Litmus::DB::Log", {order_by => 'submission_time'});
Litmus::DB::Testresult->has_many(comments => "Litmus::DB::Comment", {order_by => 'comment_id ASC, submission_time ASC'});
Litmus::DB::Testresult->has_many(bugs => "Litmus::DB::Resultbug", {order_by => 'bug_id ASC, submission_time DESC'});
Litmus::DB::Testresult->autoinflate(dates => 'Time::Piece');
# for historical reasons, note() is a shorthand way of saying "the text of the first
# comment on this result if that comment was submitted by the result submitter"
Litmus::DB::Testresult->set_sql(DefaultTestResults => qq{
SELECT tr.testresult_id,tr.test_id,t.summary,tr.submission_time AS created,p.name AS platform_name,pr.name as product_name,trsl.name AS result_status,trsl.class_name result_status_class,b.name AS branch_name,tg.name AS test_group_name
FROM test_results tr, tests t, platforms p, opsyses o, branches b, products
pr, test_result_status_lookup trsl, test_groups tg, subgroups sg
WHERE tr.test_id=t.test_id AND tr.platform_id=p.platform_id AND tr.opsys_id=o.opsys_id AND tr.branch_id=b.branch_id AND b.product_id=pr.product_id AND tr.result_id=trsl.result_status_id AND t.subgroup_id=sg.subgroup_id AND sg.testgroup_id=tg.testgroup_id
ORDER BY tr.submission_time DESC
LIMIT $_num_results_default
});
Litmus::DB::Testresult->set_sql(CommonFailures => qq{
SELECT COUNT(tr.test_id) AS num_failures, tr.test_id, t.summary, MAX(tr.submission_time) AS most_recent, MAX(tr.testresult_id) AS max_id
FROM test_results tr, tests t, test_result_status_lookup trsl
WHERE tr.test_id=t.test_id AND tr.result_id=trsl.result_status_id AND trsl.class_name='fail'
GROUP BY tr.test_id
ORDER BY num_failures DESC, tr.testresult_id DESC
LIMIT 15
});
#########################################################################
# for historical reasons, note() is a shorthand way of saying "the text of
# the first comment on this result if that comment was submitted by the
# result submitter"
#########################################################################
sub note {
my $self = shift;
@ -73,42 +114,269 @@ sub note {
}
}
#########################################################################
# is this test result recent?
memoize('isrecent', NORMALIZER => sub {my $a=shift; return $a->testresultid()});
sub isrecent {
my $self = shift;
my $age = $self->age();
# get the number of days a test result is valid for this group:
my $expdays = $self->testid()->subgroup()->testgroup()->expirationdays();
if ($age->days() < $expdays) {
return 1;
} else {
return 0;
}
my $self = shift;
my $age = $self->age();
# get the number of days a test result is valid for this group:
my $expdays = $self->testid()->subgroup()->testgroup()->expirationdays();
if ($age->days() < $expdays) {
return 1;
} else {
return 0;
}
}
#########################################################################
# get the age of this result and return it as a Time::Seconds object
memoize('age', NORMALIZER => sub {my $a=shift; return $a->testresultid()});
sub age {
my $self = shift;
my $now = localtime;
my $timediff = $now - $self->timestamp();
return $timediff;
my $self = shift;
my $now = localtime;
my $timediff = $now - $self->timestamp();
return $timediff;
}
#########################################################################
# is this test result from a trusted user?
#########################################################################
sub istrusted {
my $self = shift;
if ($self->user()->istrusted()) {
return 1;
} else {
return 0;
}
my $self = shift;
if ($self->user()->istrusted()) {
return 1;
} else {
return 0;
}
}
1;
#########################################################################
# &getDefaultTestResults($)
#
#########################################################################
sub getDefaultTestResults($) {
my $self = shift;
my @rows = $self->search_DefaultTestResults();
my $criteria = "Default<br/>Ordered by Created<br>Limit to $_num_results_default results";
return $criteria, \@rows;
}
#########################################################################
# &getTestResults($\@\@$)
#
#########################################################################
sub getTestResults($\@\@$) {
my ($self,$where_criteria,$order_by_criteria,$limit_value) = @_;
my $select = 'SELECT tr.testresult_id,tr.test_id,t.summary,tr.submission_time AS created,p.name AS platform_name,pr.name as product_name,trsl.name AS result_status,trsl.class_name AS result_status_class,b.name AS branch_name,tg.name AS test_group_name';
my $from = 'FROM test_results tr, tests t, platforms p, opsyses o, branches b, products pr, test_result_status_lookup trsl, test_groups tg, subgroups sg';
my $where = 'WHERE tr.test_id=t.test_id AND tr.platform_id=p.platform_id AND tr.opsys_id=o.opsys_id AND tr.branch_id=b.branch_id AND b.product_id=pr.product_id AND tr.result_id=trsl.result_status_id AND t.subgroup_id=sg.subgroup_id AND sg.testgroup_id=tg.testgroup_id';
my $limit = 'LIMIT ';
foreach my $criterion (@$where_criteria) {
if ($criterion->{'field'} eq 'branch') {
$where .= " AND b.name='" . $criterion->{'value'} . "'";
} elsif ($criterion->{'field'} eq 'product') {
$where .= " AND pr.name='" . $criterion->{'value'} . "'";
} elsif ($criterion->{'field'} eq 'platform') {
$where .= " AND p.name='" . $criterion->{'value'} . "'";
} elsif ($criterion->{'field'} eq 'test_group') {
$where .= " AND tg.name='" . $criterion->{'value'} . "'";
} elsif ($criterion->{'field'} eq 'test_id') {
$where .= " AND tr.test_id='" . $criterion->{'value'} . "'";
} elsif ($criterion->{'field'} eq 'summary') {
$where .= ' AND t.summary LIKE \'%%' . $criterion->{'value'} . '%%\'';
} elsif ($criterion->{'field'} eq 'result_status') {
$where .= " AND trsl.class_name='" . $criterion->{'value'} . "'";
} elsif ($criterion->{'field'} eq 'trusted_only') {
$from .= ", users u";
$where .= " AND u.user_id=tr.user_id AND u.is_trusted=1";
} elsif ($criterion->{'field'} eq 'start_date') {
my $start_timestamp = &Date::Manip::UnixDate(&Date::Manip::ParseDateString($criterion->{'value'}),"%q");
if ($start_timestamp !~ /^\d\d\d\d\d\d\d\d\d\d\d\d\d\d$/) {
print STDERR "Unable to parse a valid start date from '$criterion->{'value'},' ignoring.\n";
} else {
$where .= " AND tr.submission_time>=$start_timestamp";
}
} elsif ($criterion->{'field'} eq 'end_date') {
my $end_timestamp = &Date::Manip::UnixDate(&Date::Manip::ParseDateString($criterion->{'value'}),"%q");
if ($end_timestamp !~ /^\d\d\d\d\d\d\d\d\d\d\d\d\d\d$/) {
print STDERR "Unable to parse a valid end date from '$criterion->{'value'},' ignoring.\n";
} else {
$where .= " AND tr.submission_time<=$end_timestamp";
}
} elsif ($criterion->{'field'} eq 'timespan') {
next if ($criterion->{'value'} eq 'all');
my $day_delta = $criterion->{'value'};
my $err;
my $timestamp =
&Date::Manip::UnixDate(&Date::Manip::DateCalc("now",
"$day_delta days",
\$err),
"%q");
$where .= " AND tr.submission_time>=$timestamp";
} elsif ($criterion->{'field'} eq 'search_field') {
my $rv = &_processSearchField($criterion,\$from,\$where);
} else {
# Skip unknown field
}
}
my $order_by = 'ORDER BY ';
foreach my $criterion (@$order_by_criteria) {
# Skip empty fields.
next if (!$criterion or !$criterion->{'field'});
if ($criterion->{'field'} eq 'created') {
$order_by .= "tr.submission_time $criterion->{'direction'},";
} elsif ($criterion->{'field'} eq 'product') {
$order_by .= "pr.name $criterion->{'direction'},";
} elsif ($criterion->{'field'} eq 'platform') {
$order_by .= "p.name $criterion->{'direction'},";
} elsif ($criterion->{'field'} eq 'test_group') {
$order_by .= "tg.name $criterion->{'direction'},";
} elsif ($criterion->{'field'} eq 'test_id') {
$order_by .= "tr.test_id $criterion->{'direction'},";
} elsif ($criterion->{'field'} eq 'summary') {
$order_by .= "t.summary $criterion->{'direction'},";
} elsif ($criterion->{'field'} eq 'result_status') {
$order_by .= "trsl.class_name $criterion->{'direction'},";
} elsif ($criterion->{'field'} eq 'branch') {
$order_by .= "b.name $criterion->{'direction'},";
} else {
# Skip unknown field
}
}
if ($order_by eq 'ORDER BY ') {
$order_by .= 'tr.submission_time DESC';
} else {
chop($order_by);
}
if ($limit_value and $limit_value ne '') {
$limit .= "$limit_value";
} else {
$limit .= "$_num_results_default";
}
my $sql = "$select $from $where $order_by $limit";
Litmus::DB::Testresult->set_sql(TestResults => qq{
$sql
});
my @rows = $self->search_TestResults();
return \@rows;
}
#########################################################################
# &_processSearchField(\%)
#
#########################################################################
sub _processSearchField(\%) {
my ($search_field,$from,$where) = @_;
my $table_field = "";
if ($search_field->{'search_field'} eq 'buildid') {
$table_field='tr.build_id';
} elsif ($search_field->{'search_field'} eq 'comments') {
$table_field='c.comment';
} elsif ($search_field->{'search_field'} eq 'opsys') {
$table_field='o.name';
} elsif ($search_field->{'search_field'} eq 'platform') {
$table_field='p.name';
} elsif ($search_field->{'search_field'} eq 'product') {
$table_field='pr.name';
} elsif ($search_field->{'search_field'} eq 'result_status') {
$table_field='trsl.name';
} elsif ($search_field->{'search_field'} eq 'subgroup') {
$table_field='sg.name';
} elsif ($search_field->{'search_field'} eq 'email') {
if ($from !~ /users u/) {
$from .= ", users u";
$where .= " AND tr.user_id=u.user_id";
}
$table_field='u.email';
} elsif ($search_field->{'search_field'} eq 'summary') {
$table_field='t.name';
} elsif ($search_field->{'search_field'} eq 'test_group') {
$table_field='tg.name';
} elsif ($search_field->{'search_field'} eq 'test_status') {
$table_field='tsl.name';
} elsif ($search_field->{'search_field'} eq 'user_agent') {
$table_field='tr.user_agent';
} else {
return undef;
}
if ($search_field->{'match_criteria'} eq 'contains_all' or
$search_field->{'match_criteria'} eq 'contains_any' or
$search_field->{'match_criteria'} eq 'not_contain_any') {
my $join = "";
if ($search_field->{'match_criteria'} eq 'contains_all') {
$join = 'AND';
} else {
$join = 'OR';
}
$search_field->{'value'} =~ s/\\//g;
my @words = split(/ /,$search_field->{'value'});
if ($search_field->{'match_criteria'} eq 'not_contain_any') {
$where .= " AND NOT (";
} else {
$where .= " AND (";
}
my $first_pass = 1;
foreach my $word (@words) {
if ( $first_pass ) {
$where .= "UPPER($table_field) LIKE UPPER('%%" . $word . "%%')";
$first_pass = 0;
} else {
$where .= " $join UPPER($table_field) LIKE UPPER('%%" . $word . "%%')";
}
}
$where .= ")";
} elsif ($search_field->{'match_criteria'} eq 'contains') {
$where .= " AND UPPER($table_field) LIKE UPPER('%%" . $search_field->{'value'} . "%%')";
} elsif ($search_field->{'match_criteria'} eq 'contains_case') {
$where .= " AND $table_field LIKE '%%" . $search_field->{'value'} . "%%'";
} elsif ($search_field->{'match_criteria'} eq 'not_contain') {
$where .= " AND UPPER($table_field) NOT LIKE UPPER('%%" . $search_field->{'value'} . "%%')";
} elsif ($search_field->{'match_criteria'} eq 'regexp') {
$where .= " AND $table_field REGEXP '" . $search_field->{'value'} . "'";
} elsif ($search_field->{'match_criteria'} eq 'not_regexp') {
$where .= " AND $table_field NOT REGEXP '" . $search_field->{'value'} . "'";
} else {
# Ignore unknown match criteria.
return undef;
}
return 0;
}
#########################################################################
#########################################################################
sub getCommonFailures($$) {
my ($self,$limit_value) = @_;
if (!$limit_value) {
$limit_value = $_num_results_default;
}
my @rows = $self->search_CommonFailures();
return \@rows;
}
1;

Просмотреть файл

@ -1,23 +1,34 @@
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s): Zach Lipton <zach@zachlipton.com>
# -*- mode: cperl; c-basic-offset: 8; indent-tabs-mode: nil; -*-
=head1 COPYRIGHT
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License
# at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and
# limitations under the License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is
# the Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Chris Cooper <ccooper@deadsquid.com>
# Zach Lipton <zach@zachlipton.com>
#
# ***** END LICENSE BLOCK *****
=cut
package Litmus::DB::User;
@ -33,4 +44,4 @@ Litmus::DB::User->column_alias("is_trusted", "istrusted");
Litmus::DB::User->has_many(testresults => "Litmus::DB::Testresult");
1;
1;

Просмотреть файл

Просмотреть файл

Просмотреть файл

@ -1,3 +1,35 @@
# -*- mode: cperl; c-basic-offset: 8; indent-tabs-mode: nil; -*-
=head1 COPYRIGHT
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License
# at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and
# limitations under the License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is
# the Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Chris Cooper <ccooper@deadsquid.com>
# Zach Lipton <zach@zachlipton.com>
#
# ***** END LICENSE BLOCK *****
=cut
package Litmus::DBI;
use strict;

Просмотреть файл

@ -1,23 +1,34 @@
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s): Zach Lipton <zach@zachlipton.com>
# -*- mode: cperl; c-basic-offset: 8; indent-tabs-mode: nil; -*-
=head1 COPYRIGHT
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License
# at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and
# limitations under the License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is
# the Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Chris Cooper <ccooper@deadsquid.com>
# Zach Lipton <zach@zachlipton.com>
#
# ***** END LICENSE BLOCK *****
=cut
# General error reporting
@ -64,4 +75,4 @@ sub _doError($) {
lastDitchError(Litmus->template()->error());
}
1;
1;

Просмотреть файл

@ -0,0 +1,263 @@
# -*- mode: cperl; c-basic-offset: 8; indent-tabs-mode: nil; -*-
=head1 COPYRIGHT
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License
# at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and
# limitations under the License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is
# the Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Chris Cooper <ccooper@deadsquid.com>
# Zach Lipton <zach@zachlipton.com>
#
# ***** END LICENSE BLOCK *****
=cut
package Litmus::FormWidget;
use strict;
BEGIN {
use Exporter ();
use vars qw ($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
$VERSION = 0.01;
@ISA = qw (Exporter);
#Give a hoot don't pollute, do not export more than needed by default
@EXPORT = qw ( getProducts );
@EXPORT_OK = qw ();
%EXPORT_TAGS = ();
}
use DBI;
use Litmus::DBI;
our $_dbh = Litmus::DBI->db_Main();
#########################################################################
=head1 NAME
Litmus::FormWidget - Create value lists to be used in HTML forms
=head1 SYNOPSIS
use Litmus::FormWidget
=head1 DESCRIPTION
Litmus::FormWidget creates value lists to be used in HTML forms.
=head1 USAGE
=head1 BUGS
=head1 SUPPORT
=head1 AUTHOR
Chris Cooper
CPAN ID: CCOOPER
Mozilla Corporation
ccooper@deadsquid.com
http://litmus.mozilla.org/
=head1 SEE ALSO
perl(1).
=cut
#########################################################################
#sub new
#{
# my ($class, %parameters) = @_;
# my $self = bless ({}, ref ($class) || $class);
# return ($self);
#}
#########################################################################
=head2 getProducts
Usage : How to use this function/method
Purpose : What it does
Returns : What it returns
Argument : What it wants to know
Throws : Exceptions and other anomolies
Comments : This is a sample subroutine header.
: It is polite to include more pod and fewer comments.
See Also :
=cut
#########################################################################
sub getProducts()
{
my $sql = "SELECT DISTINCT(name) FROM products ORDER BY name";
return _getValues($sql);
}
#########################################################################
sub getPlatforms()
{
my $sql = "SELECT DISTINCT(name) FROM platforms ORDER BY name";
return _getValues($sql);
}
#########################################################################
sub getBranches()
{
my $sql = "SELECT DISTINCT(name) FROM branches ORDER BY name";
return _getValues($sql);
}
#########################################################################
sub getTestStatuses()
{
my $sql = "SELECT test_status_id,name FROM test_status_lookup ORDER BY test_status_id";
return _getValues($sql);
}
#########################################################################
sub getResultStatuses()
{
my $sql = "SELECT result_status_id,class_name FROM test_result_status_lookup ORDER BY result_status_id";
return _getValues($sql);
}
#########################################################################
sub getTestGroups()
{
my $sql = "SELECT DISTINCT(name) FROM test_groups ORDER BY name";
return _getValues($sql);
}
#########################################################################
sub getTestIDs()
{
my $sql = "SELECT test_id FROM tests ORDER BY test_id";
return _getValues($sql);
}
#########################################################################
sub getFields()
{
my @fields = (
{ name => 'buildid',
display_string => "Build ID", },
{ name => 'comment',
display_string => "Comments", },
{ name => 'opsys',
display_string => "Operating System", },
{ name => 'platform',
display_string => "Platform", },
{ name => 'product',
display_string => "Product", },
{ name => 'result_status',
display_string => "Result Status", },
{ name => 'subgroup',
display_string => "Subgroup", },
{ name => 'email',
display_string => "Submitter", },
{ name => 'summary',
display_string => "Summary", },
{ name => 'test_group',
display_string => "Testgroup", },
{ name => 'test_status',
display_string => "Test Status", },
{ name => 'user_agent',
display_string => "User Agent", },
);
return \@fields;
}
#########################################################################
sub getMatchCriteria()
{
my @match_criteria = (
{ name => "contains_all",
display_string => "contains all of the words/strings" },
{ name => "contains_any",
display_string => "contains any of the words/strings" },
{ name => "contains",
display_string => "contains the word/string" },
{ name => "contains_case",
display_string => "contains the word/string (exact case)" },
{ name => "not_contain",
display_string => "does not contains the word/string" },
{ name => "not_contain_any",
display_string => "does not contains any of the words/string" },
{ name => "regexp",
display_string => "matches the regexp" },
{ name => "not_regexp",
display_string => "does not match the regexp" },
);
return \@match_criteria;
}
#########################################################################
sub getSortFields()
{
my @sort_fields = (
{ name => "created",
display_string => "Date"},
{ name => "product",
display_string => "Product"},
{ name => "platform",
display_string => "Platform"},
{ name => "test_group",
display_string => "Testgroup"},
{ name => "test_id",
display_string => "Testcase ID#"},
{ name => "summary",
display_string => "Summary"},
{ name => "result_status",
display_string => "Status"},
{ name => "branch",
display_string => "Branch"},
);
return \@sort_fields;
}
#########################################################################
sub _getValues($)
{
my ($sql) = @_;
my $sth = $_dbh->prepare_cached($sql);
$sth->execute();
my @rows;
while (my $data = $sth->fetchrow_hashref) {
push @rows, $data;
}
return \@rows;
}
1;

Просмотреть файл

@ -1,23 +1,34 @@
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s): Zach Lipton <zach@zachlipton.com>
# -*- mode: cperl; c-basic-offset: 8; indent-tabs-mode: nil; -*-
=head1 COPYRIGHT
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License
# at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and
# limitations under the License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is
# the Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Chris Cooper <ccooper@deadsquid.com>
# Zach Lipton <zach@zachlipton.com>
#
# ***** END LICENSE BLOCK *****
=cut
package Litmus::SysConfig;
@ -157,7 +168,11 @@ sub displayForm {
$vars->{"defaultbranch"} = $sysconfig->branch();
}
$vars->{"defaultemail"} = Litmus::Auth::getCookie();
my $cookie = Litmus::Auth::getCookie();
$vars->{"defaultemail"} = $cookie;
$vars->{"show_admin"} = Litmus::Auth::istrusted($cookie);
$vars->{"title"} = "Run Tests";
Litmus->template()->process("runtests/sysconfig.html.tmpl", $vars) ||
internalError(Litmus->template()->error());
@ -193,4 +208,4 @@ sub processForm {
return $sysconfig;
}
1;
1;

Просмотреть файл

@ -1,32 +1,41 @@
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is the Bugzilla Bug Tracking System.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
# Dan Mosedale <dmose@mozilla.org>
# Jacob Steenhagen <jake@bugzilla.org>
# Bradley Baetz <bbaetz@student.usyd.edu.au>
# Christopher Aillon <christopher@aillon.com>
# Tobias Burnus <burnus@net-b.de>
# Myk Melez <myk@mozilla.org>
# Max Kanat-Alexander <mkanat@bugzilla.org>
# Zach Lipton <zach@zachlipton.com>
# -*- mode: cperl; c-basic-offset: 8; indent-tabs-mode: nil; -*-
=head1 COPYRIGHT
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License
# at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and
# limitations under the License.
#
# The Original Code is the Bugzilla Bug Tracking System.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s): Terry Weissman <terry@mozilla.org>
# Dan Mosedale <dmose@mozilla.org>
# Jacob Steenhagen <jake@bugzilla.org>
# Bradley Baetz <bbaetz@student.usyd.edu.au>
# Christopher Aillon <christopher@aillon.com>
# Tobias Burnus <burnus@net-b.de>
# Myk Melez <myk@mozilla.org>
# Max Kanat-Alexander <mkanat@bugzilla.org>
# Zach Lipton <zach@zachlipton.com>
# Chris Cooper <ccooper@deadsquid.com>
#
# ***** END LICENSE BLOCK *****
=cut
# This is mostly a placeholder. At some point in the future, we might
# want to be more like Bugzilla and support multiple languages and
@ -159,4 +168,4 @@ sub create {
}
},
});
}
}

Просмотреть файл

@ -1,23 +1,34 @@
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s): Zach Lipton <zach@zachlipton.com>
# -*- mode: cperl; c-basic-offset: 8; indent-tabs-mode: nil; -*-
=head1 COPYRIGHT
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License
# at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and
# limitations under the License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is
# the Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Chris Cooper <ccooper@deadsquid.com>
# Zach Lipton <zach@zachlipton.com>
#
# ***** END LICENSE BLOCK *****
=cut
package Litmus::Testlist;
@ -52,4 +63,4 @@ sub makeHotlist {
@potentialtests;
return @potentialtests;
}
}

Просмотреть файл

@ -1,23 +1,34 @@
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s): Zach Lipton <zach@zachlipton.com>
# -*- mode: cperl; c-basic-offset: 8; indent-tabs-mode: nil; -*-
=head1 COPYRIGHT
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License
# at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and
# limitations under the License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is
# the Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Chris Cooper <ccooper@deadsquid.com>
# Zach Lipton <zach@zachlipton.com>
#
# ***** END LICENSE BLOCK *****
=cut
# Handle detection of system information from the UA string
@ -117,4 +128,4 @@ sub detectBuildId() {
return $self->buildid();
}
1;
1;

Просмотреть файл

@ -1,23 +1,34 @@
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s): Zach Lipton <zach@zachlipton.com>
# -*- mode: cperl; c-basic-offset: 8; indent-tabs-mode: nil; -*-
=head1 COPYRIGHT
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License
# at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
# the License for the specific language governing rights and
# limitations under the License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is
# the Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Chris Cooper <ccooper@deadsquid.com>
# Zach Lipton <zach@zachlipton.com>
#
# ***** END LICENSE BLOCK *****
=cut
# General utility functions
@ -47,4 +58,4 @@ sub requireField {
}
}
1;
1;

Просмотреть файл

@ -15,7 +15,7 @@ install: templates
%.tmpl:
$(PERL) -e " \
eval('use CGI qw(-no_debug)'); \
use Litmus::Template \
use Litmus::Template;use diagnostics; \
\$$template = Litmus::Template->create(); \
\$$template->context()->template('$@'); \
"
@ -40,4 +40,4 @@ templates: index.html.tmpl
# requires Exuberant Ctags to be installed (http://ctags.sf.net/)
ctags:
`which ctags` --excmd=number --tag-relative=no --fields=+a+m+n+S -R `pwd`

Просмотреть файл

@ -0,0 +1,241 @@
#!/usr/bin/perl -w
# -*- mode: cperl; c-basic-offset: 8; indent-tabs-mode: nil; -*-
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is
# the Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Chris Cooper <ccooper@deadsquid.com>
# Zach Lipton <zach@zachlipton.com>
#
# ***** END LICENSE BLOCK *****
use strict;
# Litmus homepage
use Litmus;
use Litmus::Auth;
use Litmus::Error;
use Litmus::DB::Testresult;
use Litmus::FormWidget;
use CGI;
use Time::Piece::MySQL;
my $c = new CGI;
print $c->header();
use diagnostics;
# Hash refs for maintaining state in the search form.
my $defaults;
my $order_bys;
our $MAX_SORT_FIELDS = 10;
our $MAX_SEARCH_FIELDS = 10;
my $criteria = "Custom<br/>";
my $results;
my @where;
my @order_by;
my $limit;
my $where_criteria = "";
my $order_by_criteria = "";
my $limit_criteria = "";
if ($c->param) {
foreach my $param ($c->param) {
next if ($c->param($param) eq '');
if ($param =~ /sort_field(\d+)/) {
# We slot sort fields into the @order_by array based on their
# field_num. Empty array slots will be ignored when the SQL
# is built. We set an upper limit on the number of sort fields
# we can handle to prevent abuse.
my $field_num = $1;
next if ($field_num > $MAX_SORT_FIELDS);
my $sort_field = $c->param($param);
my $sort_order = 'ASC';
if ($c->param("sort_order$field_num")) {
$sort_order = $c->param("sort_order$field_num");
}
$order_by[$field_num] = { field => $sort_field,
direction => $sort_order};
} elsif ($param =~ /search_field(\d+)/) {
# We set an upper limit on the number of search fields
# we can handle to prevent abuse.
my $field_num = $1;
next if ($field_num > $MAX_SEARCH_FIELDS);
my $search_field = $c->param($param);
my $match_criteria = $c->param("match_criteria$field_num");
my $value = $c->param("search_value$field_num");
push @where, { 'field' => 'search_field',
'search_field' => $search_field,
'match_criteria' => $match_criteria,
'value' => $value};
$where_criteria .= "$search_field $match_criteria '$value'<br/>";
} elsif ($param eq 'start_date') {
my $start_date = $c->param($param);
$start_date =~ s/[^0-9A-Za-z ]/ /g;
my $end_date;
# Use 'now' as the default end date.
if ($c->param('end_date') and $c->param('end_date') ne '') {
$end_date = $c->param('end_date');
$end_date =~ s/[^0-9A-Za-z ]/ /g;
} else {
$end_date = 'Now';
}
push @where, { field => 'start_date',
value => $start_date};
push @where, { field => 'end_date',
value => $end_date};
$where_criteria .= "Date between '$start_date' and '$end_date'<br/>";
} elsif ($param eq 'trusted_only') {
push @where, {field => 'trusted_only',
value => 1};
$limit_criteria .= "Display trusted results only<br/>";
} elsif ($param eq "limit") {
$limit = $c->param($param);
next if ($limit == $Litmus::DB::Testresult::_num_results_default);
$limit_criteria .= "Limit to $limit results<br/>";
} elsif ($param eq 'branch') {
my $value = $c->param($param);
push @where, {field => $param,
value => $value};
$where_criteria .= "Branch is \'".$c->param($param)."\'<br/>";
$defaults->{branch} = $c->param($param);
} elsif ($param eq 'product') {
my $value = $c->param($param);
push @where, {field => $param,
value => $value};
$where_criteria .= "Product is \'".$c->param($param)."\'<br/>";
$defaults->{product} = $c->param($param);
} elsif ($param eq 'platform') {
my $value = $c->param($param);
push @where, {field => $param,
value => $value};
$where_criteria .= "Platform is \'".$c->param($param)."\'<br/>";
$defaults->{platform} = $c->param($param);
} elsif ($param eq 'test_group') {
my $value = $c->param($param);
push @where, {field => $param,
value => $value};
$where_criteria .= "Test group is \'".$c->param($param)."\'<br/>";
$defaults->{test_group} = $c->param($param);
} elsif ($param eq 'test_id') {
my $value = $c->param($param);
push @where, {field => $param,
value => $value};
$where_criteria .= "Testcase ID# is \'".$c->param($param)."\'<br/>";
$defaults->{test_id} = $c->param($param);
} elsif ($param eq 'summary') {
my $value = $c->param($param);
push @where, {field => $param,
value => $value};
$where_criteria .= "Summary like \'".$c->param($param)."\'<br/>";
$defaults->{summary} = $c->param($param);
} elsif ($param eq 'result_status') {
my $value = $c->param($param);
push @where, {field => $param,
value => $value};
$where_criteria .= "Status is \'".$c->param($param)."\'<br/>";
$defaults->{result_status} = $c->param($param);
} else {
# Skip unknown field
}
}
if ($where_criteria eq '' and
scalar(@order_by) == 0 and
$limit_criteria eq '') {
($criteria,$results) =
Litmus::DB::Testresult->getDefaultTestResults;
} else {
foreach my $order_by_field (@order_by) {
next if (!$order_by_field);
$order_by_criteria .= "Order by $order_by_field->{field} $order_by_field->{direction}<br/>";
}
$criteria .= $where_criteria . $order_by_criteria . $limit_criteria;
$criteria =~ s/_/ /g;
$results = Litmus::DB::Testresult->getTestResults(\@where,
\@order_by,
$limit);
}
} else {
($criteria,$results) =
Litmus::DB::Testresult->getDefaultTestResults;
}
# Populate each of our form widgets for select/input.
# Set a default value as appropriate.
my $products = Litmus::FormWidget->getProducts;
my $platforms = Litmus::FormWidget->getPlatforms;
my $test_groups = Litmus::FormWidget->getTestGroups;
my $test_ids = Litmus::FormWidget->getTestIDs;
my $result_statuses = Litmus::FormWidget->getResultStatuses;
my $branches = Litmus::FormWidget->getBranches;
my $fields = Litmus::FormWidget->getFields;
my $match_criteria = Litmus::FormWidget->getMatchCriteria;
my $sort_fields = Litmus::FormWidget->getSortFields;
my $title = 'Advanced Search';
my $vars = {
title => $title,
criteria => $criteria,
products => $products,
platforms => $platforms,
test_groups => $test_groups,
test_ids => $test_ids,
result_statuses => $result_statuses,
branches => $branches,
fields => $fields,
match_criteria => $match_criteria,
sort_fields => $sort_fields,
};
# Only include results if we have them.
if ($results and scalar @$results > 0) {
$vars->{results} = $results;
}
my $cookie = Litmus::Auth::getCookie();
$vars->{"defaultemail"} = $cookie;
$vars->{"show_admin"} = Litmus::Auth::istrusted($cookie);
Litmus->template()->process("reporting/advanced_search.tmpl", $vars) ||
internalError(Litmus->template()->error());
exit 0;

Просмотреть файл

@ -0,0 +1,74 @@
#!/usr/bin/perl -w
# -*- mode: cperl; c-basic-offset: 8; indent-tabs-mode: nil; -*-
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is
# the Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Chris Cooper <ccooper@deadsquid.com>
# Zach Lipton <zach@zachlipton.com>
#
# ***** END LICENSE BLOCK *****
use strict;
$|++;
use Time::HiRes qw( gettimeofday tv_interval );
my $t0 = [gettimeofday];
use Litmus;
use Litmus::Auth;
use Litmus::Error;
use Litmus::DB::Testresult;
use Litmus::FormWidget;
use diagnostics;
use CGI;
use Time::Piece::MySQL;
my $results = Litmus::DB::Testresult->getCommonFailures;
my $c = new CGI;
print $c->header();
my $vars = {
title => 'Most Common Failures',
};
# Only include results if we have them.
if ($results and scalar @$results > 0) {
$vars->{results} = $results;
}
$vars->{"defaultemail"} = Litmus::Auth::getCookie();
Litmus->template()->process("reporting/common_failures.tmpl", $vars) ||
internalError(Litmus->template()->error());
my $elapsed = tv_interval ( $t0 );
printf "<p>Page took %f seconds to load.</p>", $elapsed;
exit 0;

Просмотреть файл

@ -304,9 +304,8 @@ CREATE TABLE `tests` (
`community_enabled` tinyint(1) default NULL,
`format_id` tinyint(4) NOT NULL default '1',
`regression_bug_id` int(11) default NULL,
`t1` longtext collate latin1_bin,
`t2` longtext collate latin1_bin,
`t3` longtext collate latin1_bin,
`steps` longtext collate latin1_bin,
`expected_results` longtext collate latin1_bin,
PRIMARY KEY (`test_id`),
KEY `subgroup_id` (`subgroup_id`),
KEY `summary` (`summary`),
@ -314,9 +313,8 @@ CREATE TABLE `tests` (
KEY `community_enabled` (`community_enabled`),
KEY `format_id` (`format_id`),
KEY `regression_bug_id` (`regression_bug_id`),
KEY `t1` (`t1`(255)),
KEY `t2` (`t2`(255)),
KEY `t3` (`t3`(255))
KEY `steps` (`steps`(255)),
KEY `expected_results` (`expected_results`(255))
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_bin;
--

Двоичные данные
webtools/litmus/css/images/body_back.gif Executable file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 791 B

Двоичные данные
webtools/litmus/css/images/box-gray-bottom-150.gif Executable file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.3 KiB

Двоичные данные
webtools/litmus/css/images/box-gray-bottom.gif Executable file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 1.4 KiB

Двоичные данные
webtools/litmus/css/images/box-gray-top-150.gif Executable file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 261 B

Двоичные данные
webtools/litmus/css/images/box-gray-top.gif Executable file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 249 B

Двоичные данные
webtools/litmus/css/images/mozilla-org.gif Executable file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.0 KiB

Двоичные данные
webtools/litmus/css/images/page-background.gif Executable file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 396 B

835
webtools/litmus/css/litmus.css Executable file
Просмотреть файл

@ -0,0 +1,835 @@
/* 1) Main ********************************************************************** */
body {
margin: 0 30px 2em 30px;
color: #333;
line-height: 140%;
background: #fff url("images/body_back.gif") repeat-x;
font-size: 0.9em;
}
body, td, th, h3, input { /* redundant rules for bad browsers */
font-family: verdana, sans-serif;
voice-family: "\"}\"";
voice-family: inherit;
}
#container {
width: 100%;
margin: 0 auto;
}
#page {
padding: 15px 0 0 0;
}
#content {
margin: 0 0 0 170px;
background: url("images/page-background.gif") repeat-x top left;
}
h1.firstHeading, h1.errorHeading {
padding-top: 15px;
border-bottom: none;
margin-top: 0;
font-size: 1.8em;
text-transform: lowercase;
}
h1.errorHeading {
color: #F00;
}
/* 2) Links********************************************************************** */
a {
text-transform: lowercase;
font-weight: bold;
}
a:link, a:visited {
text-decoration: none;
color: #363636;
}
a:hover {
color: #660000;
text-decoration: underline;
}
a:active {
color: #000000;
}
/* 3) Mozilla ******************************************************************* */
#mozilla-org {
position: relative;
height: 25px;
}
#mozilla-org a {
position: absolute;
right: 0;
top: 0;
display: block;
width: 110px;
height: 25px;
background: url("images/mozilla-org.gif") no-repeat;
text-decoration: none;
text-indent: -5000em;
}
/* 4) Header ******************************************************************** */
#header {
clear: both;
position: relative;
margin: 0 0 10px 0;
height: 60px;
border: solid #BBB 1px;
}
#header h1 {
position: absolute;
top: 0;
left: 0;
margin: 0;
}
#header h1 a,#header h1 a:hover {
display: block;
width: 150px; height: 60px;
background: url("../images/title.png") no-repeat;
font-size: 1px;
text-indent: -7000em;
}
#header form {
position: absolute;
top: 8px;
right: 0;
font-family: tahoma, arial, sans-serif;
font-size: 85%;
}
#header form label {
font-weight: bold;
}
#header form .searchButton, #submit {
font-size: 100%;
padding: 1px;
font-family: tahoma, arial, sans-serif;
}
#header form #searchInput, #s {
width: 90px;
font-size: 100%;
font-weight: normal;
border: 1px solid #9097A2;
padding: 2px;
font-family: tahoma, arial, sans-serif;
}
/* Footer ****************************************************** */
#footer {
clear: both;
background: url("images/page-background.gif") repeat-x top left;
margin: 10px 0 0 170px;
width: auto;
text-align: center;
font-size: 0.8em;
text-transform: lowercase;
}
#footer ul {
margin: 0;
padding: 0;
}
#footer li {
display: inline;
list-style: none;
padding-left: 5px;
padding-right: 5px;
}
#footer #stickers {
padding-top: 20px;
}
#footer #stickers div {
display: inline;
}
#footer #stickers img {
border: none;
}
#footer p {
padding: 5px;
}
/* 5) Navigation **************************************************************** */
#navigation {
margin: 0;
padding: 0;
background: #1e4176 url("images/navigation-background.gif") repeat-x bottom right;
height: 2.7em;
}
#navigation div#bar {
padding: 0;
margin: 0;
background: url("images/navigation-top-right.gif") no-repeat top right;
height: 2.7em;
white-space: nowrap;
}
#navigation div#bar div {
position: relative;
padding: 0;
margin: 0;
background: url("images/navigation-top-left.gif") no-repeat top left;
height: 2.7em;
}
#navigation #contenttypes {
position: absolute;
bottom: 0;
left: 0;
margin: 0;
padding: 0 0 0 0.7em;
list-style-type: none;
background: url("images/navigation-bottom-left.gif") no-repeat bottom left;
}
#navigation #contenttypes li {
margin: 0 2px 0 0; padding: 0;
float: left;
background-image: url("images/tab-right.gif");
background-position: top right;
background-repeat: no-repeat;
height: 2em;
}
#navigation #contenttypes li.selected {
background-image: url("images/tab-right-selected.gif");
}
#navigation #contenttypes li a {
display: block;
font-family: verdana, arial, sans-serif;
text-decoration: none;
font-size: 85%;
font-weight: bold;
color: #fff;
height: 2em;
line-height: 2em;
background-image: url("images/tab-left.gif");
background-position: top left;
background-repeat: no-repeat;
padding: 0px 6px;
}
#navigation #contenttypes li.selected a {
color: #003366;
background-image: url("images/tab-left-selected.gif");
}
#navigation #personal {
position: absolute;
bottom: 0;
right: 0;
margin: 0;
padding: 0 0.4em 0 0;
height: 1.8em;
list-style-type: none;
background: url("images/navigation-bottom-right.gif") no-repeat bottom right;
}
#navigation #personal li {
margin: 0 4px;
padding: 0;
float: left;
line-height: 2em;
}
#navigation #personal a {
font-family: tahoma, arial, sans-serif;
font-size: 80%;
font-weight: bold;
color: #fff;
display: block;
text-decoration: none;
margin: 0;
}
/* 6) Sidebar ******************************************************************* */
#sidebar {
position: absolute;
top: 40px;
left: 30px;
background: #FFF;
width: 150px;
line-height: 120%;
}
#sidebar h3 {
text-transform: lowercase;
font-weight: bold;
font-size: 0.9em;
margin: 1em 0 0.3em;
}
#sidebar h3:first-child {
margin: 0 0 0.3em;
}
#sidebar ul {
margin: 0;
padding: 0;
}
#sidebar p,
#sidebar li {
font-size: 0.85em;
margin: 0 0 0 2em;
padding: 0;
}
#sidebar p {
margin-bottom: 6px;
}
#sidebar p:last-child {
margin-bottom: 0;
}
#sidebar p.submit {
text-align: center;
padding: 2px;
}
/* 7) Related ******************************************************************* */
div#related {
background: #eff8ce url("images/box-yellow-bottom.gif") no-repeat bottom left;
margin: 0 0 16px 0;
}
div#related div {
background: url("images/box-yellow-top.gif") no-repeat top left;
padding: 8px;
}
div#related h3 {
color: #003366;
}
div#related li {
list-style-image: url("images/box-yellow-arrow.gif");
color: #999999;
}
div#related a {
color: #0033aa;
text-decoration: none;
}
/* 8) Pagetools ***************************************************************** */
div.pagetools {
background: #dddddd;
border: solid #bbbbbb 1px;
margin: 0 0 16px;
}
div.pagetools div {
padding: 8px;
}
div.pagetools h3 {
color: #666666;
}
div.pagetools ul {
list-style: none;
}
/* 9) Breadcrumbs**************************************************************** */
#breadcrumbs {
margin: 11px 0 0 0; padding: 0;
font-size: 0.85em;
font-weight: bold;
width: 100%;
clear: both;
}
#breadcrumbs ul {
margin: 0; padding: 0;
display: block;
}
#breadcrumbs li {
float: left;
padding: 0;
margin-top: 0;
list-style-type: none;
}
#breadcrumbs a,
#breadcrumbs span {
color: #888;
text-decoration: none;
background-image: url("images/breadcrumbs.gif");
background-repeat: no-repeat;
background-position: center left;
padding: 0 6px 0 12px;
}
#breadcrumbs:first-child a {
background-image: none;
padding: 0 6px 0 0;
}
#breadcrumbs li span {
color: #3f5d89;
}
/* 10 Test Results ************************************************************** */
.test-results, .single-result, .comments, .test-config, .stats {
border-collapse: collapse;
width: 100%;
background: #ffffff;
margin-bottom: 5px;
}
.test-results {
border: solid #666666 1px;
margin-bottom: 10px;
}
.stats {
border: solid #bbbbbb 1px;
margin-bottom: 10px;
}
table.section {
border-spacing: 10px;
border: none;
width: 100%;
}
.run-tests {
padding: 10px;
border-collapse: collapse;
background: #ffffff;
border: solid #666666 1px;
margin-bottom: 10px;
}
#configuration {
display: block;
}
.comments {
border: solid #BBB 1px;
background: #DDD;
color: #000;
}
.test-results td, .single-result td, .comments td {
vertical-align: top;
padding: 3px 5px 3px 5px;
font-size: .90em;
}
.single-result td {
border: solid #BBB 1px;
}
.run-tests td {
vertical-align: middle;
padding: 3px 5px 3px 5px;
}
.test-results td, .run-tests td {
border: solid #BBB 1px;
}
td.header, th {
vertical-align: middle;
background: #DDD;
border: solid #BBB 1px;
font-weight: bold;
font-size: 1.05em;
text-transform: lowercase;
text-align: center;
color: #666666;
padding: 0px 5px 0px 5px;
}
.run-tests td.header {
background: #DDD;
border: solid #BBB 1px;
font-weight: bold;
font-size: 1.05em;
text-transform: lowercase;
text-align: right;
padding: 0px 5px 0px 5px;
}
.no-results {
background: inherit;
color: #F00;
text-align: center;
}
.radio-testresults {
border: solid #BBB 1px;
border-collapse: collapse;
padding: 3px 5px 3px 5px;
margin: 5px;
}
.testresults-submitted {
border-collapse: collapse;
margin: 0px;
padding: 0px;
}
.testresults-submitted td {
border: solid #BBB 1px;
padding: 3px;
padding-left: 10px;
padding-right: 10px;
}
table.radio-testresults tr {
border: solid #BBB 1px;
padding: 3px 5px 3px 5px;
}
.pass {
background: #9F9;
}
.pass a:hover {
color: #00cc00;
}
.fail {
background: #F99;
}
.fail a:hover {
color: #cc0000;
}
.unclear {
background: #FF9;
}
.unclear a:hover {
color: #cccc00;
}
.test-results tr.search {
background: #DDD;
border: solid #BBB 1px;
font-size: 1em;
text-align: center;
padding: 0px 5px 0px 5px;
}
.test-results td.search-heading {
text-transform: lowercase;
text-align: center;
vertical-align: middle;
font-weight: bold;
color: #666666;
}
.test-results td.search {
text-align: center;
vertical-align: middle;
}
.test-results td.search-submit {
text-align: right;
vertical-align: middle;
}
.legend td {
vertical-align: top;
padding: 3px 5px 3px 5px;
border: solid #BBB 1px;
font-size: .90em;
text-align: center;
}
.advanced-search {
padding: 0px;
width: 100%;
}
.advanced-search td.heading {
font-weight: bold;
}
.advanced-search td.instructions {
text-align: center;
padding: 0px 5px 10px 5px;
}
.test-config td.header {
font-weight: bold;
}
/* 11 Run Test ****************************************************************************** */
div.title_sub {
background-color: #d0d0d0;
font-weight: bold;
padding: 0px;
margin: 0 0 0 0;
}
div.sec_head {
background-color: #d0d0d0;
padding: 0px;
font-weight: bold;
}
div.testcase-head {
background-color: #dddddd;
padding: 0px;
font-weight: bold;
}
div.sec_head table, div.testcase-head table {
width: 100%;
padding: 0px;
}
div.sec_head td.l, div.testcase-head td.l {
padding: 3px;
padding-left: 10px;
padding-right: 10px;
font-weight: bold;
font-size: 1.4em;
text-transform: lowercase;
color: #666666;
}
div.sec_head td.r, div.testcase-head td.r {
padding: 3px;
padding-left: 10px;
padding-right: 10px;
text-align: right;
padding: 5px;
vertical-align: middle;
font-size: 0.8em;
}
div.nav {
background-color: #d0d0d0;
display: none;
text-align: right;
text-transform: lowercase;
}
div.nav a:link, div.nav a:visited {
color: #333333;
text-decoration: none;
}
div.nav a:hover {
color: #660000;
text-decoration: underline;
}
div.summary {
display:block;
}
div.summary td {
vertical-align:top;
background-color:#efefef;
padding:10px; width:25%;
}
table.tc_nav {
width:100%;
background-color:#efefef;
}
table.tc_nav td {
vertical-align:top;
}
div.tcs {
background-color: inherit;
}
div.tcs table {
width:200px;
/* border-color:#ffffff;
* border-style:solid;
* border-width:0 2px 2px 0;
*/ padding:10px;
}
table.tcm {
border: solid #bbbbbb 1px;
width:100%;
margin: 0px;
}
table.tcm td {
vertical-align: top;
padding: 5px;
padding-left: 10px;
padding-right: 10px;
}
table.tcm td.header {
background-color: #d0d0d0;
}
td.content ul, td.content ol {
margin: 0;
padding: 5px;
}
table.tcm td.content {
background-color: #efefef;
}
table.tcmf td {
vertical-align:top;
border-width:0px;
padding: 5px;
}
div.dh {
padding: 0 2px 2px 0;
font-weight: bold;
}
div.dv {
font-weight: normal;
padding: 2px 2px 10px 5px;
}
div.t_link a {
padding: 2px 2px 10px 0px;
}
/* ****************************************************************************** */
fieldset {
margin-bottom: 5px;
}
legend {
font-weight: bold;
font-size: 1.1em;
}
div.error {
background: #DDD;
border: solid #BBB 1px;
padding: 5px;
}
.skipLink {
position: absolute;
left: -1200px;
width: 990px;
}
.hide {
display: none;
}
#printheader {
display: none;
}
.legend {
border: solid #666 1px;
border-collapse: collapse;
width: 100%;
margin-bottom: 10px;
background: #FFF;
}
textarea {
margin-bottom: 5px;
}
.t_link {
font-size: 0.8em;
font-weight: bold;
text-transform: lowercase;
}
.pageinstruction {
font-weight: bold;
}
.pageinstruction input {
font-weight: normal;
}
#content ul {
list-style: none;
margin: 0;
padding: 5px;
}
ol {
list-style-type: decimal;
}
#pageload {
position: relative;
left: 100px;
font-size: 0.7em;
text-align: center;
text-transform: lowercase;
}
.odd {
background-color: #eeeeee;
}
.even {
background-color: #ffffff;
}
.completegroup {
background-color: #999999;
}
.confirmedgroup {
background-color: #666666;
}
div.section-full {
border: solid #bbbbbb 1px;
margin-bottom: 5px;
background-color: #dddddd;
}
div.section-full {
width: 100%;
}
div.section-header {
padding: 10px;
font-size: 1.4em;
font-weight: bold;
color: #666666;
text-transform: lowercase;
}
div.section-content {
padding: 5px;
padding-left: 10px;
padding-right: 10px;
}
.submit {
text-align: right;
vertical-align: middle;
}
.submitall {
padding-left: 5px;
padding-right: 5px;
text-align: left;
vertical-align: middle;
}
table.section td.subsection {
border: solid #bbbbbb 1px;
margin-bottom: 5px;
background-color: #dddddd;
vertical-align: top;
}

Двоичные данные
webtools/litmus/favicon.ico Executable file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 580 B

Двоичные данные
webtools/litmus/images/title.png Executable file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 18 KiB

Просмотреть файл

@ -1,50 +1,89 @@
#!/usr/bin/perl -w
# -*- Mode: perl; indent-tabs-mode: nil -*-
# -*- mode: cperl; c-basic-offset: 8; indent-tabs-mode: nil; -*-
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
# The Initial Developer of the Original Code is
# the Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s): Zach Lipton <zach@zachlipton.com>
# Contributor(s):
# Chris Cooper <ccooper@deadsquid.com>
# Zach Lipton <zach@zachlipton.com>
#
# ***** END LICENSE BLOCK *****
use strict;
$|++;
# Litmus homepage
use Time::HiRes qw( gettimeofday tv_interval );
my $t0 = [gettimeofday];
use Litmus;
use Litmus::Auth;
use Litmus::Error;
use Litmus::DB::Product;
use Litmus::Testlist;
use Litmus::DB::Testresult;
use Litmus::FormWidget;
use CGI;
use Time::Piece::MySQL;
my $c = new CGI;
use diagnostics;
my ($criteria,$results) = Litmus::DB::Testresult->getDefaultTestResults;
my $products = Litmus::FormWidget->getProducts();
my $platforms = Litmus::FormWidget->getPlatforms();
my $test_groups = Litmus::FormWidget->getTestGroups();
my $result_statuses = Litmus::FormWidget->getResultStatuses;
my $branches = Litmus::FormWidget->getBranches();
my $c = new CGI;
print $c->header();
my @products = Litmus::DB::Product->retrieve_all();
my @failingtests = Litmus::DB::Test->retrieve_all();
#my @hotlist = makeHotlist(15, Litmus::DB::Result->search(name => "Fail"), @failingtests);
my @hotlist = undef;
my $vars = {
products => \@products,
hotlist => \@hotlist,
};
title => 'Main Page',
products => $products,
platforms => $platforms,
test_groups => $test_groups,
result_statuses => $result_statuses,
branches => $branches,
limit => $Litmus::DB::Testresult::_num_results_default,
};
# Only include results if we have them.
if ($results and scalar @$results > 0) {
$vars->{results} = $results;
}
my $cookie = Litmus::Auth::getCookie();
$vars->{"defaultemail"} = $cookie;
$vars->{"show_admin"} = Litmus::Auth::istrusted($cookie);
Litmus->template()->process("index.tmpl", $vars) ||
internalError(Litmus->template()->error());
my $elapsed = tv_interval ( $t0 );
printf "<div id='pageload'>Page took %f seconds to load.</div>", $elapsed;
exit 0;
Litmus->template()->process("index.html.tmpl", $vars) ||
internalError(Litmus->template()->error());

65
webtools/litmus/js/EditTests.js Executable file
Просмотреть файл

@ -0,0 +1,65 @@
var editedtests = new Array();
var fields = ["product", "summary", "testgroup", "subgroup",
"communityenabled_row"];
function MM_findObj(n) {
var x = document.getElementById(n);
return x;
}
function showEdit(testid) {
for (var i=0; i<fields.length; i++) {
show(getField(fields[i]+"_edit",testid));
hide(getField(fields[i]+"_text",testid));
}
hide(getField("editlink", testid));
show(getField("canceleditlink", testid));
MM_findObj("Submit").value = "Submit Results and Edits";
editedtests.push(testid);
}
function findEdited() {
MM_findObj("editingTestcases").value = editedtests.toString();
}
function cancelEdit(testid) {
for (var i=0; i<fields.length; i++) {
hide(getField(fields[i]+"_edit",testid));
show(getField(fields[i]+"_text",testid));
}
show(getField("editlink", testid));
hide(getField("canceleditlink", testid));
// remove testid from the editedtests array:
var newarray = new Array();
for (var i=0; i<editedtests.length; i++) {
if (editedtests[i] != testid) {
newarray.push(testid);
}
}
editedtests=newarray;
if (! editedtests[0]) {
MM_findObj("Submit").value = "Submit Results";
}
}
// fields are in the format fieldname_testid
function getField(fieldname, testid) {
return MM_findObj(fieldname+"_"+testid);
}
function show(obj) {
if (obj) {
obj.style.display = "";
}
}
function hide(obj) {
if (obj) {
obj.style.display = "none";
}
}

224
webtools/litmus/js/FormPersist.js Executable file
Просмотреть файл

@ -0,0 +1,224 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
* FormPersist.js derived from CFormData.
* See <http://devedge-temp.mozilla.org/toolbox/examples/2003/CFormData/>
*/
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Netscape code.
*
* The Initial Developer of the Original Code is
* Netscape Corporation.
* Portions created by the Initial Developer are Copyright (C) 2003
* the Initial Developer. All Rights Reserved.
*
* Contributor(s): Bob Clary <bclary@netscape.com>
* Bob Clary <http://bclary.com/>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
function FormInit(/*HTMLFormElement */ aForm, /* String */ aQueryString)
{
var type;
var options;
if (!aForm)
{
return;
}
if (!aQueryString)
{
return;
}
// empty out the form's values.
var elements = aForm.elements;
for (var iElm = 0; iElm < elements.length; iElm++)
{
var element = elements[iElm];
var nodeName = element.nodeName.toLowerCase();
switch(nodeName)
{
case 'input':
type = element.type.toLowerCase();
switch(type)
{
case 'text':
element.value = '';
break;
case 'radio':
case 'checkbox':
element.checked = false;
break;
}
break;
case 'textarea':
element.value = '';
break;
case 'select':
options = element.options;
for (iOpt = 0; iOpt < options.length; iOpt++)
{
options[iOpt].selected = false;
}
break;
}
}
// fill in form from the query string
if (aQueryString.indexOf('?') == 0);
{
aQueryString = aQueryString.substring(1);
}
aQueryString = decodeURIComponent(aQueryString);
aQueryString = aQueryString.replace(/[\&]amp;/g, '&');
var parmList = aQueryString.split('&');
for (var iParm = 0; iParm < parmList.length; iParm++)
{
var parms = parmList[iParm].split('=');
var name = parms[0];
var value;
if (parms.length == 1)
{
value = true;
}
else
{
var tempValue = parms[1];
value = tempValue.replace(/\+/g,' ');
}
elements = aForm[name];
if (typeof elements.nodeName != 'undefined')
{
elements = [elements];
}
for (iElm = 0; iElm < elements.length; iElm++)
{
element = elements[iElm];
nodeName = element.nodeName.toLowerCase();
switch(nodeName)
{
case 'input':
type = element.type.toLowerCase();
switch(type)
{
case 'text':
element.value = value;
break;
case 'radio':
case 'checkbox':
if (element.value == value)
{
element.checked = true;
}
}
break;
case 'textarea':
element.value = value;
break;
case 'select':
options = element.options;
for (iOpt = 0; iOpt < options.length; iOpt++)
{
if (options[iOpt].value == value)
{
options[iOpt].selected = true;;
}
}
break;
}
}
}
}
function FormDump(aForm)
{
var type;
var s = '';
var elements = aForm.elements;
for (var iElm = 0; iElm < elements.length; iElm++)
{
var element = elements[iElm];
var nodeName = element.nodeName.toLowerCase();
switch(nodeName)
{
case 'input':
type = element.type.toLowerCase();
switch(type)
{
case 'text':
if (element.value)
{
s += '&' + element.name + '=' + element.value;
}
break;
case 'radio':
case 'checkbox':
if (element.checked)
{
s += '&' + element.name + '=' + element.value;
}
break;
}
break;
case 'textarea':
if (element.value)
{
s += '&' + element.name + '=' + element.value;
}
break;
case 'select':
var options = element.options;
for (iOpt = 0; iOpt < options.length; iOpt++)
{
if (options[iOpt].selected)
{
s += '&' + element.name + '=' + options[iOpt].value;
}
}
break;
}
}
s = '?' + encodeURIComponent(s.slice(1));
return s;
};

54
webtools/litmus/js/RunTests.js Executable file
Просмотреть файл

@ -0,0 +1,54 @@
function showTEST(testid) {
if(testid=="all") {
divTOG('tmp_menua,tmp_menub',1,0);
divTOG('tmp_tests,tmp_separ',1,1);
divTOG('mf,ml',0,1);
} else {
divTOG('tmp_tests,tmp_separ,tmp_menua,tmp_menub',1,0);
divTOG("t"+testid+",ma"+testid+",mb"+testid,0,1);
for(var i=1; i<=tmp_pagetotal; i++) {
document.getElementById("li"+i).style.backgroundColor='inherit';
document.getElementById("a"+i).style.color='inherit';
}
document.getElementById("li"+testid).style.backgroundColor='#bbbbbb';
document.getElementById("a"+testid).style.color='#660000';
}
}
function divSWAP(divID) {
document.getElementById(divID).style.display=(document.getElementById(divID).style.display=='none')?'block':'none';
}
function divTOG(divNAME,divSET,divVIS) {
if (divNAME.indexOf(',')) {
divNAME=divNAME.split(",");
} else {
divNAME=new Array(divNAME);
}
for(var i=0; i<divNAME.length; i++) {
if(divSET) {
tmpNAME=(divNAME[i]=="tmp_tests")?tmp_tests:(divNAME[i]=="tmp_separ")?tmp_separ:(divNAME[i]=="tmp_menua")?tmp_menua:(divNAME[i]=="tmp_menub")?tmp_menub:'none';
for(var j=0; j<tmpNAME.length; j++) {
divCHANGE(tmpNAME[j],divVIS);
}
} else {
divCHANGE(divNAME[i],divVIS);
}
}
}
function divCHANGE(divNAME,divVIS) {
divVIS=divVIS?'block':'none';
if(divNAME.indexOf(',')) {
divNAME=divNAME.split(",");
} else {
divNAME=new Array(divNAME);
}
for(var i=0; i<divNAME.length; i++) {
try {
document.getElementById(divNAME[i]).style.display=divVIS;
} catch(e) {
alert(divNAME[i]+ ": no properties");
}
}
}

255
webtools/litmus/js/SelectBoxes.js Executable file
Просмотреть файл

@ -0,0 +1,255 @@
function selects_onload() {
load_products(getElementByClass("select_product"));
load_testgroups(getElementByClass("select_testgroup"));
load_subgroups(getElementByClass("select_subgroup"));
load_platforms(getElementByClass("select_platform"));
load_opsyses(getElementByClass("select_opsys"));
load_branches(getElementByClass("select_branch"));
}
function load_products(selects) {
if (!selects) { return; }
// for each select box in selects, load in the list of products
for (var select=0; select<selects.length; select++) {
var productbox = selects[select];
clearSelect(productbox);
addNullEntry(productbox);
for (var i=0; i<litmusconfig.length; i++) {
var option = makeOption(litmusconfig[i]);
productbox.add(option, null);
// handle the default selection
if (isDefault(document.getElementById(productbox.name+"_default"), litmusconfig[i]['id'])) {
productbox.selectedIndex = i+1;
}
}
}
}
function load_testgroups(selects) {
if (!selects[0]) { return; }
// load the proper list of testgroups for the
// currently selected product for each testgroup
// select:
for (var select=0; select<selects.length; select++) {
var groupbox = selects[select];
clearSelect(groupbox);
addNullEntry(groupbox);
// find the currently selected product that goes with this select
var productbox = document.getElementById("product"+groupbox.name.substr(9));
var productid = productbox.options[productbox.selectedIndex].value;
var product = getProductById(productid);
if (!product) {
return;
}
// now get the list of testgroups that goes with that product:
var testgroups = product['testgroups'];
for (var group=0; group<testgroups.length; group++) {
var option = makeOption(testgroups[group])
groupbox.add(option, null);
// handle the default selection
if (isDefault(document.getElementById(groupbox.name+"_default"), testgroups[group]['id'])) {
groupbox.selectedIndex = group+1;
}
}
}
}
function load_subgroups(selects) {
if (!selects[0]) { return; }
for (var select=0; select<selects.length; select++) {
var subgroupbox = selects[select];
clearSelect(subgroupbox);
addNullEntry(subgroupbox);
// find the currently selected testgroup that goes with this select
var testgroupbox = document.getElementById("testgroup"+subgroupbox.name.substr(8));
var testgroupid = testgroupbox.options[testgroupbox.selectedIndex].value;
var testgroup = getTestgroupById(testgroupid);
if (!testgroup) {
// no testgroup set
return;
}
// now get the list of subgroups that goes with that testgroup
var subgroups = testgroup['subgroups'];
for (var i=0; i<subgroups.length; i++) {
var option = makeOption(subgroups[i]);
subgroupbox.add(option, null);
if (isDefault(document.getElementById(subgroupbox.name+"_default"), subgroups[i]['id'])) {
subgroupbox.selectedIndex = i+1;
}
}
}
} // wow, that was fun
function load_platforms(selects) {
if (!selects[0]) { return; }
for (var select=0; select<selects.length; select++) {
var platformbox = selects[select];
clearSelect(platformbox);
addNullEntry(platformbox);
// find the currently selected product that goes with this select
var productbox = document.getElementById("product"+platformbox.name.substr(8));
var productid = productbox.options[productbox.selectedIndex].value;
var product = getProductById(productid);
if (!product) {
// no product set
return;
}
var platforms = product['platforms'];
for (var i=0; i<platforms.length; i++) {
var option = makeOption(platforms[i]);
platformbox.add(option, null);
if (isDefault(document.getElementById(platformbox.name+"_default"), platforms[i]['id'])) {
platformbox.selectedIndex = i+1;
}
}
}
}
function load_branches(selects) {
if (!selects[0]) { return; }
for (var select=0; select<selects.length; select++) {
var branchbox = selects[select];
clearSelect(branchbox);
addNullEntry(branchbox);
// find the currently selected product that goes with this select
var productbox = document.getElementById("product"+branchbox.name.substr(6));
var productid = productbox.options[productbox.selectedIndex].value;
var product = getProductById(productid);
if (!product) {
// no product set
return;
}
var branches = product['branches'];
for (var i=0; i<branches.length; i++) {
var option = makeOption(branches[i]);
branchbox.add(option, null);
if (isDefault(document.getElementById(branchbox.name+"_default"), branches[i]['id'])) {
branchbox.selectedIndex = i+1;
}
}
}
}
function load_opsyses(selects) {
if (!selects[0]) { return; }
for (var select=0; select<selects.length; select++) {
var opsysbox = selects[select];
clearSelect(opsysbox);
addNullEntry(opsysbox);
// find the currently selected platform
var platformbox = document.getElementById("platform"+opsysbox.name.substr(5));
var platformid = platformbox.options[platformbox.selectedIndex].value;
var platform = getPlatformById(platformid);
if (!platform) {
return;
}
var opsyses = platform['opsyses'];
for (var i=0; i<opsyses.length; i++) {
var option = makeOption(opsyses[i]);
opsysbox.add(option, null);
if (isDefault(document.getElementById(opsysbox.name+"_default"), opsyses[i]['id'])) {
opsysbox.selectedIndex = i+1;
}
}
}
}
function changeProduct(testid) {
var testidflag = "";
if (testid) { testidflag = "_"+testid; }
load_testgroups([document.getElementById("testgroup"+testidflag)]);
changeTestgroup(testid);
load_platforms([document.getElementById("platform"+testidflag)]);
changePlatform(testid);
load_branches([document.getElementById("branch"+testidflag)]);
}
function changeTestgroup(testid) {
var testidflag = "";
if (testid) { testidflag = "_"+testid; }
load_subgroups([document.getElementById("subgroup"+testidflag)]);
}
function changePlatform(testid) {
var testidflag = "";
if (testid) { testidflag = "_"+testid; }
load_opsyses([document.getElementById("opsys"+testidflag)]);
}
function addNullEntry(select) {
// add a blank entry to the current select:
select.add(new Option("---", "---", false, false), null);
}
function clearSelect(select) {
// remove all options from a select:
while (select.options[0]) {
select.remove(0);
}
}
function getProductById(prodid) {
for (var i=0; i<litmusconfig.length; i++) {
if (litmusconfig[i]['id'] == prodid) {
return(litmusconfig[i]);
}
}
}
function getTestgroupById(testgroupid) {
for (var i=0; i<litmusconfig.length; i++) {
for (var j=0; j<litmusconfig[i]['testgroups'].length; j++) {
if (litmusconfig[i]['testgroups'][j]['id'] == testgroupid) {
return(litmusconfig[i]['testgroups'][j]);
}
}
}
}
function getPlatformById(platformid) {
for (var i=0; i<litmusconfig.length; i++) {
for (var j=0; j<litmusconfig[i]['platforms'].length; j++) {
if (litmusconfig[i]['platforms'][j]['id'] == platformid) {
return(litmusconfig[i]['platforms'][j]);
}
}
}
}
// pass this the <input> containing the list of possible default values
// and the current value, returns true if the current value appears in
// defaultInput, otherwise returns false
function isDefault(defaultInput, curvalue) {
if (! defaultInput) { return false; }
var defaultarray = defaultInput.value.split(',');
for (var i=0; i<defaultarray.length; i++) {
if (defaultarray[i] == curvalue) {
return true;
}
}
return false;
}
function makeOption(obj) {
return new Option(obj['name'], obj['id'], false, false)
}
function getElementByClass(theClass) {
var elements = new Array();
var all = document.getElementsByTagName("*");
for (var i=0; i<all.length; i++) {
if (all[i].className == theClass) {
elements.push(all[i]);
}
}
return elements;
}

54
webtools/litmus/js/SubGroup.js Executable file
Просмотреть файл

@ -0,0 +1,54 @@
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function showsubgroup() {
var groupselect = MM_findObj("group");
var selnum;
for (var i=0; i<groupselect.length; i++) {
if (groupselect[i].checked) {
selnum = groupselect[i].value;
}
}
// no selection yet so just keep everything as-is:
if (! selnum) {
return;
}
// object to show
var obj = MM_findObj("divsubgroup_"+selnum);
// disable all of them
for (var i=0; i<groupselect.length; i++) {
var gnum = groupselect[i].value;
var disableobj = MM_findObj("divsubgroup_"+gnum);
disableobj.style.display = "none";
}
MM_findObj("divsubgroup_null").style.display = "none";
var num_subgroups_enabled = 0;
var subgroupselect = MM_findObj("subgroup_"+selnum);
for (var i=0; i<subgroupselect.length; i++) {
if (!subgroupselect[i].disabled) {
num_subgroups_enabled++;
}
}
obj.style.display = "";
if (num_subgroups_enabled == 0) {
MM_findObj("Submit").disabled = true;
} else {
MM_findObj("Submit").disabled = false;
}
}

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Просмотреть файл

@ -1,24 +1,31 @@
#!/usr/bin/perl -w
# -*- Mode: perl; indent-tabs-mode: nil -*-
# -*- mode: cperl; c-basic-offset: 8; indent-tabs-mode: nil; -*-
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
# The Initial Developer of the Original Code is
# the Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s): Zach Lipton <zach@zachlipton.com>
# Contributor(s):
# Chris Cooper <ccooper@deadsquid.com>
# Zach Lipton <zach@zachlipton.com>
#
# ***** END LICENSE BLOCK *****
use strict;
@ -33,8 +40,10 @@ use Litmus::Utils;
use CGI;
use Time::Piece::MySQL;
my $c = new CGI;
use diagnostics;
use Data::Dumper;
my $c = new CGI;
my $user;
my $sysconfig;
@ -49,6 +58,8 @@ if ($c->param("isSysConfig")) {
my @names = $c->param();
#print Dumper \@names;
# find all the test numbers contained in this result submission
my @tests;
foreach my $curname (@names) {
@ -73,7 +84,7 @@ foreach my $curtestid (@tests) {
# it and move on...
next;
}
my $curtest = Litmus::DB::Test->retrieve($curtestid);
unless ($curtest) {
# oddly enough, the test doesn't exist
@ -97,18 +108,21 @@ foreach my $curtestid (@tests) {
);
}
# get system configuration. If there is no
# configuration and we're not doing the
# simpletest interface, then we make you enter it
$sysconfig = $sysconfig || Litmus::SysConfig->getCookie(
Litmus::DB::Product->retrieve($c->param("product_initial_$curtestid")));
if (! $sysconfig && ! $c->param("isSimpleTest")) {
# users who don't have a sysconfig for this product
# should go configure themselves first:
Litmus::SysConfig->displayForm(
Litmus::DB::Product->retrieve($c->param("product_$curtestid")),
"process_test.cgi", $c);
exit;
# get system configuration. If there is no configuration and we're
# not doing the simpletest interface, then we make you enter it
# Get system configuration. If there is no configuration,
# then we make the user enter it.
if (!$sysconfig) {
$sysconfig = Litmus::SysConfig->getCookie($product);
}
# Users who still don't have a sysconfig for this product
# should go configure themselves first.
if (!$sysconfig) {
Litmus::SysConfig->displayForm($product,
"process_test_results.cgi",
$c);
exit;
}
my $result = Litmus::DB::Result->retrieve($c->param("testresult_".$curtestid));
@ -122,97 +136,103 @@ foreach my $curtestid (@tests) {
# users, we just use the web-user@mozilla.org user:
if ($c->param("isSimpleTest")) {
$user = $user || Litmus::DB::User->search(email => 'web-tester@mozilla.org')->next();
$user = $user || Litmus::DB::User->search(email => 'web-tester@mozilla.org')->next();
} else {
$user = $user || Litmus::Auth::getCookie()->userid();
$user = $user || Litmus::Auth::getCookie()->userid();
}
my $tr = Litmus::DB::Testresult->create({
user => $user,
testid => $curtest,
timestamp => $time,
useragent => $ua,
result => $result,
platform => $sysconfig->platform(),
opsys => $sysconfig->opsys(),
branch => $sysconfig->branch(),
buildid => $sysconfig->buildid(),
});
user => $user,
testid => $curtest,
timestamp => $time,
last_updated => $time,
useragent => $ua,
result => $result,
platform => $sysconfig->platform(),
opsys => $sysconfig->opsys(),
branch => $sysconfig->branch(),
buildid => $sysconfig->buildid(),
});
# if there's a note, create an entry in the comments table for it
Litmus::DB::Comment->create({
testresult => $tr,
submission_time => $time,
user => $user,
comment => $note
});
}
if ($note and
$note ne '') {
Litmus::DB::Comment->create({
testresult => $tr,
submission_time => $time,
last_updated => $time,
user => $user,
comment => $note
});
}
}
# process changes to testcases:
my @changed;
if ($c->param("editingTestcases") && Litmus::Auth::canEdit(Litmus::Auth::getCookie())) {
# only users with canedit can edit testcases, duh!
if ($c->param("editingTestcases") &&
Litmus::Auth::canEdit(Litmus::Auth::getCookie())) {
# only users with canedit can edit testcases, duh!
# the editingTestcases param contains a comma-separated list of
# testids that the user has made changes to (well, has clicked
# the edit button for).
@changed = split(',' => $c->param("editingTestcases"));
foreach my $editid (@changed) {
my $edittest = Litmus::DB::Test->retrieve($editid);
if (! $edittest) {invalidInputError("Test $editid does not exist")}
# the editingTestcases param contains a comma-separated list of
# testids that the user has made changes to (well, has clicked
# the edit button for).
@changed = split(',' => $c->param("editingTestcases"));
foreach my $editid (@changed) {
my $edittest = Litmus::DB::Test->retrieve($editid);
if (! $edittest) {invalidInputError("Test $editid does not exist")}
$edittest->summary($c->param("summary_edit_$editid"));
if ($c->param("communityenabled_$editid")) {
$edittest->communityenabled(1);
} else {
$edittest->communityenabled(0);
}
my $product = Litmus::DB::Product->retrieve($c->param("product_$editid"));
my $group = Litmus::DB::Testgroup->retrieve($c->param("testgroup_$editid"));
my $subgroup = Litmus::DB::Subgroup->retrieve($c->param("subgroup_$editid"));
requireField("product", $product);
requireField("group", $group);
requireField("subgroup", $subgroup);
$edittest->product($product);
$edittest->testgroup($group);
$edittest->subgroup($subgroup);
# now set the format fields:
my $format = $edittest->format();
foreach my $curfield ($format->fields()) {
warn($curfield."_edit_editid");
$edittest->set($format->getColumnMapping($curfield),
$c->param($curfield."_edit_$editid"));
}
$edittest->update();
$edittest->summary($c->param("summary_edit_$editid"));
if ($c->param("communityenabled_$editid")) {
$edittest->communityenabled(1);
} else {
$edittest->communityenabled(0);
}
my $product = Litmus::DB::Product->retrieve($c->param("product_$editid"));
my $group = Litmus::DB::Testgroup->retrieve($c->param("testgroup_$editid"));
my $subgroup = Litmus::DB::Subgroup->retrieve($c->param("subgroup_$editid"));
requireField("product", $product);
requireField("group", $group);
requireField("subgroup", $subgroup);
$edittest->product($product);
$edittest->testgroup($group);
$edittest->subgroup($subgroup);
$edittest->steps($c->param("steps_edit_$editid"));
$edittest->expected_results($c->param("results_edit_$editid"));
$edittest->update();
}
} elsif ($c->param("editingTestcases") &&
! Litmus::Auth::canEdit(Litmus::Auth::getCookie())) {
invalidInputError("You do not have permissions to edit testcases. ");
! Litmus::Auth::canEdit(Litmus::Auth::getCookie())) {
invalidInputError("You do not have permissions to edit testcases. ");
}
my $testgroup;
if ($c->param("testgroup")) {
$testgroup = Litmus::DB::Testgroup->retrieve($c->param("testgroup")),
$testgroup = Litmus::DB::Testgroup->retrieve($c->param("testgroup")),
}
my $vars;
$vars->{'title'} = 'Run Tests';
my $cookie = Litmus::Auth::getCookie();
$vars->{"defaultemail"} = $cookie;
$vars->{"show_admin"} = Litmus::Auth::istrusted($cookie);
# show the normal thank you page unless we're in simpletest mode where
# we should show a special page:
if ($c->param("isSimpleTest")) {
Litmus->template()->process("simpletest/resultssubmitted.html.tmpl") ||
internalError(Litmus->template()->error());
Litmus->template()->process("simpletest/resultssubmitted.html.tmpl", $vars) || internalError(Litmus->template()->error());
} else {
my $vars = {
testcount => $testcount,
product => $product || undef,
resultcounts => \%resultcounts || undef,
changedlist => \@changed || undef,
testgroup => $testgroup || undef,
"return" => $c->param("return") || undef,
};
Litmus->template()->process("process/process.html.tmpl", $vars) ||
internalError(Litmus->template()->error());
$vars->{'testcount'} = $testcount;
$vars->{'product'} = $product || undef;
$vars->{'resultcounts'} = \%resultcounts || undef;
$vars->{'changedlist'} = \@changed || undef;
$vars->{'testgroup'} = $testgroup || undef;
$vars->{'return'} = $c->param("return") || undef;
Litmus->template()->process("process/process.html.tmpl", $vars) ||
internalError(Litmus->template()->error());
}

Просмотреть файл

@ -1,24 +1,31 @@
#!/usr/bin/perl -w
# -*- Mode: perl; indent-tabs-mode: nil -*-
# -*- mode: cperl; c-basic-offset: 8; indent-tabs-mode: nil; -*-
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
# The Initial Developer of the Original Code is
# the Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s): Zach Lipton <zach@zachlipton.com>
# Contributor(s):
# Chris Cooper <ccooper@deadsquid.com>
# Zach Lipton <zach@zachlipton.com>
#
# ***** END LICENSE BLOCK *****
use strict;
@ -32,6 +39,8 @@ use Litmus::Auth;
use CGI;
use Time::Piece::MySQL;
my $title = "Run Tests";
my $c = new CGI;
if ($c->param("group")) { # display the test screen
@ -89,7 +98,7 @@ sub page_pickGroupSubgroup {
invalidInputError("You must enter your email address so we can track your results and contact you if we have any questions.");
}
$user = Litmus::DB::User->find_or_create(email => $email);
print $c->header(-cookie => [$sysconfig->setCookie(), Litmus::Auth::setCookie($user)]);
}
@ -110,12 +119,17 @@ sub page_pickGroupSubgroup {
}
my $vars = {
title => $title,
opsys => $sysconfig->opsys(),
groups => \@groups,
subgroups => \%subgroups,
sysconfig => $sysconfig,
defaultgroup => $defaultgroup,
};
my $cookie = Litmus::Auth::getCookie();
$vars->{"defaultemail"} = $cookie;
$vars->{"show_admin"} = Litmus::Auth::istrusted($cookie);
Litmus->template()->process("runtests/selectgroupsubgroup.html.tmpl", $vars) ||
internalError(Litmus->template()->error());
@ -138,6 +152,7 @@ sub page_test {
my @results = Litmus::DB::Result->retrieve_all();
my $vars = {
title => $title,
sysconfig => Litmus::SysConfig->getCookie($tests[0]->product()),
group => Litmus::DB::Subgroup->retrieve($subgroupid)->testgroup(),
subgroup => Litmus::DB::Subgroup->retrieve($subgroupid),
@ -145,6 +160,10 @@ sub page_test {
results => \@results,
istrusted => Litmus::Auth::istrusted(Litmus::Auth::getCookie()),
};
my $cookie = Litmus::Auth::getCookie();
$vars->{"defaultemail"} = $cookie;
$vars->{"show_admin"} = Litmus::Auth::istrusted($cookie);
Litmus->template()->process("runtests/testdisplay.html.tmpl", $vars) ||
internalError(Litmus->template()->error());

Просмотреть файл

@ -0,0 +1,185 @@
#!/usr/bin/perl -w
# -*- mode: cperl; c-basic-offset: 8; indent-tabs-mode: nil; -*-
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is
# the Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Chris Cooper <ccooper@deadsquid.com>
# Zach Lipton <zach@zachlipton.com>
#
# ***** END LICENSE BLOCK *****
use strict;
# Litmus homepage
use Litmus;
use Litmus::Auth;
use Litmus::Error;
use Litmus::DB::Testresult;
use Litmus::FormWidget;
use CGI;
use Time::Piece::MySQL;
my $c = new CGI;
print $c->header();
use diagnostics;
my $criteria = "Custom<br/>";
my $results;
my @where;
my @order_by;
my $limit;
my $where_criteria = "";
my $order_by_criteria = "";
my $limit_criteria = "";
if ($c->param) {
foreach my $param ($c->param) {
next if ($c->param($param) eq '');
if ($param =~ /^order_by_(.*)$/) {
my $order_by_proto = quotemeta($1);
next if ($c->param($param) ne 'ASC' and
$c->param($param) ne 'DESC');
my $order_by_direction = $c->param($param);
push @order_by, {field => $order_by_proto,
direction => $order_by_direction};
$order_by_criteria .= "Order by $order_by_proto $order_by_direction<br/>";
} elsif ($param eq 'branch') {
my $value = quotemeta($c->param($param));
push @where, {field => $param,
value => $value};
$where_criteria .= "Branch is \'".$c->param($param)."\'<br/>";
} elsif ($param eq 'product') {
my $value = quotemeta($c->param($param));
push @where, {field => $param,
value => $value};
$where_criteria .= "Product is \'".$c->param($param)."\'<br/>";
} elsif ($param eq 'platform') {
my $value = quotemeta($c->param($param));
push @where, {field => $param,
value => $value};
$where_criteria .= "Platform is \'".$c->param($param)."\'<br/>";
} elsif ($param eq 'test_group') {
my $value = quotemeta($c->param($param));
push @where, {field => $param,
value => $value};
$where_criteria .= "Test group is \'".$c->param($param)."\'<br/>";
} elsif ($param eq 'test_id') {
my $value = quotemeta($c->param($param));
push @where, {field => $param,
value => $value};
$where_criteria .= "Testcase ID# is \'".$c->param($param)."\'<br/>";
} elsif ($param eq 'summary') {
my $value = quotemeta($c->param($param));
push @where, {field => $param,
value => $value};
$where_criteria .= "Summary like \'".$c->param($param)."\'<br/>";
} elsif ($param eq 'result_status') {
my $value = quotemeta($c->param($param));
push @where, {field => $param,
value => $value};
$where_criteria .= "Status is \'".$c->param($param)."\'<br/>";
} elsif ($param eq 'timespan') {
my $value = $c->param($param);
if ($value ne 'all') {
$value =~ s/[^\-0-9]//g;
push @where, {field => $param,
value => $value};
$value =~ s/\-//g;
if ($value == 1) {
$where_criteria .= "Submitted in the last day<br/>";
} else {
$where_criteria .= "Submitted in the last $value days<br/>";
}
} else {
$where_criteria .= "All Results<br/>";
}
} elsif ($param eq "limit") {
$limit = quotemeta($c->param($param));
next if ($limit == $Litmus::DB::Testresult::_num_results_default);
$limit_criteria .= "Limit to $limit results";
} else {
# Skip unknown field
}
}
if ($where_criteria eq '' and
$order_by_criteria eq '' and
$limit_criteria eq '') {
($criteria,$results) =
Litmus::DB::Testresult->getDefaultTestResults;
} else {
$criteria .= $where_criteria . $order_by_criteria . $limit_criteria;
$criteria =~ s/_/ /g;
$results = Litmus::DB::Testresult->getTestResults(\@where,
\@order_by,
$limit);
}
} else {
($criteria,$results) =
Litmus::DB::Testresult->getDefaultTestResults;
}
# Populate each of our form widgets for select/input.
# Set a default value as appropriate.
my $products = Litmus::FormWidget->getProducts;
my $platforms = Litmus::FormWidget->getPlatforms;
my $test_groups = Litmus::FormWidget->getTestGroups;
my $result_statuses = Litmus::FormWidget->getResultStatuses;
my $branches = Litmus::FormWidget->getBranches;
my $title = 'Search Test Results';
my $vars = {
title => $title,
criteria => $criteria,
products => $products,
platforms => $platforms,
test_groups => $test_groups,
result_statuses => $result_statuses,
branches => $branches,
limit => $limit,
};
# Only include results if we have them.
if ($results and scalar @$results > 0) {
$vars->{results} = $results;
}
my $cookie = Litmus::Auth::getCookie();
$vars->{"defaultemail"} = $cookie;
$vars->{"show_admin"} = Litmus::Auth::istrusted($cookie);
Litmus->template()->process("reporting/search_results.tmpl", $vars) ||
internalError(Litmus->template()->error());
exit 0;

Просмотреть файл

@ -38,8 +38,13 @@ print $c->header();
my $testid = $c->param("id");
my $vars;
my $cookie = Litmus::Auth::getCookie();
$vars->{"defaultemail"} = $cookie;
$vars->{"show_admin"} = Litmus::Auth::istrusted($cookie);
if (! $testid) {
Litmus->template()->process("show/enter_id.html.tmpl") ||
Litmus->template()->process("show/enter_id.html.tmpl", $vars) ||
internalError(Litmus->template()->error());
exit;
}
@ -54,12 +59,20 @@ my @results = Litmus::DB::Result->retrieve_all();
my $showallresults = $c->param("showallresults") || "";
my $vars = {
my @where;
push @where, { field => 'test_id', value => $testid };
my @order_by;
push @order_by, { field => 'created', direction => 'DESC' };
my $test_results = Litmus::DB::Testresult->getTestResults(\@where,\@order_by);
$vars = {
test => $test,
results => \@results,
showallresults => $showallresults,
test_results => $test_results,
defaultemail => $cookie,
show_admin => Litmus::Auth::istrusted($cookie),
};
Litmus->template()->process("show/show.html.tmpl", $vars) ||
internalError(Litmus->template()->error());
internalError(Litmus->template()->error());

Просмотреть файл

@ -1,24 +1,31 @@
#!/usr/bin/perl -w
# -*- Mode: perl; indent-tabs-mode: nil -*-
# -*- mode: cperl; c-basic-offset: 8; indent-tabs-mode: nil; -*-
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
# The Initial Developer of the Original Code is
# the Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s): Zach Lipton <zach@zachlipton.com>
# Contributor(s):
# Chris Cooper <ccooper@deadsquid.com>
# Zach Lipton <zach@zachlipton.com>
#
# ***** END LICENSE BLOCK *****
use strict;
@ -85,6 +92,8 @@ sub showTest {
test => $test,
results => \@results,
};
$vars->{"defaultemail"} = Litmus::Auth::getCookie();
Litmus->template()->process("simpletest/simpletest.html.tmpl", $vars) ||
internalError(Litmus->template()->error());

108
webtools/litmus/single_result.cgi Executable file
Просмотреть файл

@ -0,0 +1,108 @@
#!/usr/bin/perl -w
# -*- mode: cperl; c-basic-offset: 8; indent-tabs-mode: nil; -*-
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is
# the Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Chris Cooper <ccooper@deadsquid.com>
# Zach Lipton <zach@zachlipton.com>
#
# ***** END LICENSE BLOCK *****
use strict;
# Litmus homepage
use Litmus;
use Litmus::Auth;
use Litmus::Error;
use Litmus::DB::Testresult;
use Litmus::DB::Resultbug;
use CGI;
my $c = new CGI;
print $c->header();
if ($c->param && $c->param('id')) {
my $time = localtime;
my $user = Litmus::Auth::getCookie()->userid();
if ($user and
$c->param('new_bugs') and
$c->param('new_bugs') ne '') {
my @new_bugs = split(/,/,$c->param('new_bugs'));
foreach my $new_bug (@new_bugs) {
if (!Litmus::DB::Resultbug->search(test_result_id =>$c->param('id'),
bug_id => $new_bug)) {
my $bug = Litmus::DB::Resultbug->create({
test_result_id => $c->param('id'),
last_updated => $time,
submission_time => $time,
user => $user,
bug_id => $new_bug,
});
}
}
}
if ($user and
$c->param('new_comment') and
$c->param('new_comment') ne '') {
my $comment = Litmus::DB::Comment->create({
test_result_id => $c->param('id'),
last_updated => $time,
submission_time => $time,
user => $user,
comment => $c->param('new_comment'),
});
}
my $result = Litmus::DB::Testresult->retrieve($c->param('id'));
my $title = 'Test Result #' . $c->param('id') . ' - Details';
my $vars = {
title => $title,
result => $result,
};
$vars->{"defaultemail"} = Litmus::Auth::getCookie();
Litmus->template()->process("reporting/single_result.tmpl", $vars) ||
internalError(Litmus->template()->error());
} else {
internalError(Litmus->template()->error());
print "Error\n";
exit 1;
}
exit 0;

Просмотреть файл

@ -1,28 +1,36 @@
#!/usr/bin/perl -w
# -*- Mode: perl; indent-tabs-mode: nil -*-
# -*- mode: cperl; c-basic-offset: 8; indent-tabs-mode: nil; -*-
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is Litmus.
#
# The Initial Developer of the Original Code is Netscape Communications
# Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
# The Initial Developer of the Original Code is
# the Mozilla Corporation.
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#
# Contributor(s): Zach Lipton <zach@zachlipton.com>
# Contributor(s):
# Chris Cooper <ccooper@deadsquid.com>
# Zach Lipton <zach@zachlipton.com>
#
# ***** END LICENSE BLOCK *****
use strict;
use Litmus;
use Litmus::Auth;
use Litmus::Error;
use Litmus::DB::Product;
@ -64,12 +72,17 @@ while (@curtester = $sth->fetchrow_array()) {
my $vars = {
title => "Statistics",
numtests => $numtests,
numusers => $numusers,
numresults => $numresults,
toptesters => \@toptesters,
};
my $cookie = Litmus::Auth::getCookie();
$vars->{"defaultemail"} = $cookie;
$vars->{"show_admin"} = Litmus::Auth::istrusted($cookie);
Litmus->template()->process("stats/stats.html.tmpl", $vars) ||
internalError(Litmus->template()->error());

Просмотреть файл

@ -22,8 +22,21 @@
# $message - the error message
#%]
[% INCLUDE global/header.html.tmpl title = 'Error' %]
[% INCLUDE global/html_header.tmpl title = 'Error' %]
[% INCLUDE global/litmus_header.tmpl title = 'Error' %]
<p><strong>Error:</strong> [% message FILTER html %]</p>
<div id="page">
[% INCLUDE global/footer.html.tmpl %]
[% INCLUDE sidebar/sidebar.tmpl %]
<div id="content">
<h1 class="errorHeading">Error</h1>
<div class="error">[% message FILTER html %]</div>
</div> <!--END content-->
</div> <!--END page-->
[% INCLUDE global/html_footer.tmpl %]

Просмотреть файл

@ -0,0 +1 @@
<input type="text" size="20" name="summary" value="[% IF defaults.summary!='' %][% defaults.summary %][% ELSE %]-Summary-[% END %]" onFocus="if(this.value=='-Summary-'){this.value = '';}">

Просмотреть файл

@ -0,0 +1 @@
<input type="text" size="10" name="test_id" value="[% IF defaults.test_id!='' %][% defaults.test_id %][% ELSE %]-Testcase ID#-[% END %]" onFocus="if(this.value=='-Test #-'){this.value = '';}">

Просмотреть файл

@ -0,0 +1,25 @@
<table class="radio-testresults">
<tr class="not-run">
<td><input type="radio" name="testresult_[% test_id %]" id="testresult_[% test_id %]_0" value="0" checked="checked" /></td><td><label for="testresult_[% test_id %]_0">Not Run</label>
</td>
</tr>
<tr class="pass">
<td><input type="radio" name="testresult_[% test_id %]" id="testresult_[% test_id %]_1" value="1" /></td><td><label for="testresult_[% test_id %]_1">Pass</label>
</td>
</tr>
<tr class="fail">
<td><input type="radio" name="testresult_[% test_id %]" id="testresult_[% test_id %]_2" value="2" /></td><td><label for="testresult_[% test_id %]_2">Fail</label>
</td>
</tr>
<tr class="unclear">
<td><input type="radio" name="testresult_[% test_id %]" id="testresult_[% test_id %]_3" value="3" /></td><td><label for="testresult_[% test_id %]_3">Test unclear/broken</label>
</td>
</tr>
</table>

Просмотреть файл

@ -0,0 +1,8 @@
<select name="branch">
<option value="">-Branch-</option>
[% IF branches %]
[% FOREACH branch=branches %]
<option[% IF defaults.branch==branch.name %] selected[% END %] value="[% branch.name %]">[% branch.name %]</option>
[% END %]
[% END %]
</select>

Просмотреть файл

@ -0,0 +1,7 @@
<select name="[% name %]">
[% IF match_criteria %]
[% FOREACH match_criterion=match_criteria %]
<option value="[% match_criterion.name %]">[% match_criterion.display_string %]</option>
[% END %]
[% END %]
</select>

Просмотреть файл

@ -0,0 +1,8 @@
<select name="platform">
<option value="">-Platform-</option>
[% IF platforms %]
[% FOREACH platform=platforms %]
<option[% IF defaults.platform==platform.name %] selected[% END %] value="[% platform.name %]">[% platform.name %]</option>
[% END %]
[% END %]
</select>

Просмотреть файл

@ -0,0 +1,8 @@
<select name="product">
<option value="">-Product-</option>
[% IF products %]
[% FOREACH product=products %]
<option[% IF defaults.product==product.name %] selected[% END %] value="[% product.name %]">[% product.name %]</option>
[% END %]
[% END %]
</select>

Просмотреть файл

@ -0,0 +1,8 @@
<select name="result_status">
<option value="">-Status-</option>
[% IF result_statuses %]
[% FOREACH result_status=result_statuses %]
<option[% IF defaults.result_status==result_status.class_name %] selected[% END %] value="[% result_status.class_name %]">[% result_status.class_name %]</option>
[% END %]
[% END %]
</select>

Просмотреть файл

@ -0,0 +1,8 @@
<select name="[% name %]">
<option value="">-Field-</option>
[% IF fields %]
[% FOREACH field=fields %]
<option value="[% field.name %]">[% field.display_string %]</option>
[% END %]
[% END %]
</select>

Просмотреть файл

@ -0,0 +1,8 @@
<select name="[% name %]">
<option value="">-Sort Field-</option>
[% IF sort_fields %]
[% FOREACH sort_field=sort_fields %]
<option value="[% sort_field.name %]">[% sort_field.display_string %]</option>
[% END %]
[% END %]
</select>

Просмотреть файл

@ -0,0 +1,4 @@
<select name="[% name %]">
<option value="ASC">Ascending (A->Z)</option>
<option value="DESC">Descending (Z->A)</option>
</select>

Просмотреть файл

@ -0,0 +1,8 @@
<select name="test_group">
<option value="">-Test Group-</option>
[% IF test_groups %]
[% FOREACH test_group=test_groups %]
<option[% IF defaults.test_group==test_group.name %] selected[% END %] value="[% test_group.name %]">[% test_group.name %]</option>
[% END %]
[% END %]
</select>

Просмотреть файл

@ -0,0 +1,8 @@
<select name="test_id">
<option value="">-Testcase ID#-</option>
[% IF test_ids %]
[% FOREACH test_id=test_ids %]
<option[% IF defaults.test_id==test_id.test_id %] selected[% END %] value="[% test_id.test_id %]">[% test_id.test_id %]</option>
[% END %]
[% END %]
</select>

Просмотреть файл

@ -0,0 +1,8 @@
<select name="test_status">
<option value="">-State-</option>
[% IF test_statuses %]
[% FOREACH test_status=test_statuses %]
<option[% IF defaults.test_status==test_status.name %] selected[% END %] value="[% test_status.status_name %]">[% test_status.name %]</option>
[% END %]
[% END %]
</select>

Просмотреть файл

@ -0,0 +1,8 @@
<select name="timespan">
<option value="">-Timespan-</option>
<option[% IF defaults.timespan=="all" %] selected[% END %] value="all">All Results</option>
<option[% IF defaults.timespan=="-1" %] selected[% END %] value="-1">In the last day</option>
<option[% IF defaults.timespan=="-2" %] selected[% END %] value="-2">In the last 2 days</option>
<option[% IF defaults.timespan=="-7" %] selected[% END %] value="-7">In the last week</option>
<option[% IF defaults.timespan=="-14" %] selected[% END %] value="-14">In the last 2 weeks</option>
</select>

Просмотреть файл

@ -0,0 +1,3 @@
</body>
</html>

Просмотреть файл

@ -0,0 +1,54 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="KEYWORDS" content="Main Page" />
<meta name="robots" content="index,follow" />
<link rel="shortcut icon" href="favicon.ico" />
<link rel="stylesheet" type="text/css" media="all" href="css/litmus.css" />
<title>Litmus - [% title %]</title>
[% IF script %]
<script language="JavaScript" type="text/JavaScript">
// don't ask why this is here
function MM_findObj(n) {
var x = document.getElementById(n);
return x;
}
[% FOREACH curscript=script %]
[% # see if the current script looks like a path to a INCLUDE or an
# actual snippit of JS:
%]
[% IF curscript == "" %] [% NEXT %] [% END %]
[% IF curscript.match('\(|{') %] [% # looks like js %]
[% curscript %]
[% ELSE %] [% # looks like something to INCLUDE %]
[% INCLUDE $curscript %]
[% END %]
[% END %]
</script>
[% END %]
<script language="JavaScript" type="text/Javascript" src="data/litmusconfig.js"></script>
[% IF js_files %]
[% FOREACH js_file=js_files %]
<script language="JavaScript" type="text/Javascript" src="[% js_file %]"></script>
[% END %]
[% END %]
</head>

Просмотреть файл

@ -0,0 +1,5 @@
<div id="footer">
Search: <a href="search_results.cgi?order_by_created=DESC&amp;timespan=all&amp;result_status=fail&amp;limit=50">Recent Failures</a> | <a href="common_failures.cgi">Most Common Failures</a> | Test Runs In Progress
</div>
</div>

Просмотреть файл

@ -0,0 +1,12 @@
[% IF includeselects %]
[% onload = "$onload selects_onload();" %]
[% END %]
<body onLoad="init();[% IF onload %][% onload %][% END %]">
<script type="text/javascript">function init(){}</script>
<script type="text/javascript" src="js/FormPersist.js"></script>
<div id="container">
<p class="skipLink"><a href="#content" accesskey="2">Skip to main content</a></p>
<div id="mozilla-org"><a href="http://www.mozilla.org/">Visit Mozilla.org</a></div>

Просмотреть файл

@ -25,72 +25,6 @@
[% # Create js enabled select boxen for sysconfig and
# product/group/subgroup categories. %]
[% # javascript to allow for the editing of tests and the submission of
# test results
%]
[% BLOCK edittestsscript %]
var editedtests = new Array();
var fields = ["product", "summary", "testgroup", "subgroup",
"communityenabled_row"];
function showEdit(testid) {
for (var i=0; i<fields.length; i++) {
show(getField(fields[i]+"_edit",testid));
hide(getField(fields[i]+"_text",testid));
}
hide(getField("editlink", testid));
show(getField("canceleditlink", testid));
MM_findObj("Submit").value = "Submit Results and Edits";
editedtests.push(testid);
}
function findEdited() {
MM_findObj("editingTestcases").value = editedtests.toString();
}
function cancelEdit(testid) {
for (var i=0; i<fields.length; i++) {
hide(getField(fields[i]+"_edit",testid));
show(getField(fields[i]+"_text",testid));
}
show(getField("editlink", testid));
hide(getField("canceleditlink", testid));
// remove testid from the editedtests array:
var newarray = new Array();
for (var i=0; i<editedtests.length; i++) {
if (editedtests[i] != testid) {
newarray.push(testid);
}
}
editedtests=newarray;
if (! editedtests[0]) {
MM_findObj("Submit").value = "Submit Results";
}
}
// fields are in the format fieldname_testid
function getField(fieldname, testid) {
return MM_findObj(fieldname+"_"+testid);
}
function show(obj) {
if (obj) {
obj.style.display = "";
}
}
function hide(obj) {
if (obj) {
obj.style.display = "none";
}
}
[% END %]
[% # platform dropdown box
# defaultplatform - the object for the default platform selection
# (can be either a single object or a list)
@ -113,7 +47,6 @@ function hide(obj) {
</select>
[% END %]
[% # opsys dropdown box
# test (optional) - if given, the select name will be opsys_testid
# defaultopsys - the default opsys to select
@ -218,264 +151,4 @@ function hide(obj) {
onchange="changeProduct([%test.testid FILTER js%])"
class="select_product">
</select>
[% END %]
[% BLOCK selectscripts %]
<script>
function selects_onload() {
load_products(getElementByClass("select_product"));
load_testgroups(getElementByClass("select_testgroup"));
load_subgroups(getElementByClass("select_subgroup"));
load_platforms(getElementByClass("select_platform"));
load_opsyses(getElementByClass("select_opsys"));
load_branches(getElementByClass("select_branch"));
}
function load_products(selects) {
if (!selects) { return; }
// for each select box in selects, load in the list of products
for (var select=0; select<selects.length; select++) {
var productbox = selects[select];
clearSelect(productbox);
addNullEntry(productbox);
for (var i=0; i<litmusconfig.length; i++) {
var option = makeOption(litmusconfig[i]);
productbox.add(option, null);
// handle the default selection
if (isDefault(document.getElementById(productbox.name+"_default"), litmusconfig[i]['id'])) {
productbox.selectedIndex = i+1;
}
}
}
}
function load_testgroups(selects) {
if (!selects[0]) { return; }
// load the proper list of testgroups for the
// currently selected product for each testgroup
// select:
for (var select=0; select<selects.length; select++) {
var groupbox = selects[select];
clearSelect(groupbox);
addNullEntry(groupbox);
// find the currently selected product that goes with this select
var productbox = document.getElementById("product"+groupbox.name.substr(9));
var productid = productbox.options[productbox.selectedIndex].value;
var product = getProductById(productid);
if (!product) {
return;
}
// now get the list of testgroups that goes with that product:
var testgroups = product['testgroups'];
for (var group=0; group<testgroups.length; group++) {
var option = makeOption(testgroups[group])
groupbox.add(option, null);
// handle the default selection
if (isDefault(document.getElementById(groupbox.name+"_default"), testgroups[group]['id'])) {
groupbox.selectedIndex = group+1;
}
}
}
}
function load_subgroups(selects) {
if (!selects[0]) { return; }
for (var select=0; select<selects.length; select++) {
var subgroupbox = selects[select];
clearSelect(subgroupbox);
addNullEntry(subgroupbox);
// find the currently selected testgroup that goes with this select
var testgroupbox = document.getElementById("testgroup"+subgroupbox.name.substr(8));
var testgroupid = testgroupbox.options[testgroupbox.selectedIndex].value;
var testgroup = getTestgroupById(testgroupid);
if (!testgroup) {
// no testgroup set
return;
}
// now get the list of subgroups that goes with that testgroup
var subgroups = testgroup['subgroups'];
for (var i=0; i<subgroups.length; i++) {
var option = makeOption(subgroups[i]);
subgroupbox.add(option, null);
if (isDefault(document.getElementById(subgroupbox.name+"_default"), subgroups[i]['id'])) {
subgroupbox.selectedIndex = i+1;
}
}
}
} // wow, that was fun
function load_platforms(selects) {
if (!selects[0]) { return; }
for (var select=0; select<selects.length; select++) {
var platformbox = selects[select];
clearSelect(platformbox);
addNullEntry(platformbox);
// find the currently selected product that goes with this select
var productbox = document.getElementById("product"+platformbox.name.substr(8));
var productid = productbox.options[productbox.selectedIndex].value;
var product = getProductById(productid);
if (!product) {
// no product set
return;
}
var platforms = product['platforms'];
for (var i=0; i<platforms.length; i++) {
var option = makeOption(platforms[i]);
platformbox.add(option, null);
if (isDefault(document.getElementById(platformbox.name+"_default"), platforms[i]['id'])) {
platformbox.selectedIndex = i+1;
}
}
}
}
function load_branches(selects) {
if (!selects[0]) { return; }
for (var select=0; select<selects.length; select++) {
var branchbox = selects[select];
clearSelect(branchbox);
addNullEntry(branchbox);
// find the currently selected product that goes with this select
var productbox = document.getElementById("product"+branchbox.name.substr(6));
var productid = productbox.options[productbox.selectedIndex].value;
var product = getProductById(productid);
if (!product) {
// no product set
return;
}
var branches = product['branches'];
for (var i=0; i<branches.length; i++) {
var option = makeOption(branches[i]);
branchbox.add(option, null);
if (isDefault(document.getElementById(branchbox.name+"_default"), branches[i]['id'])) {
branchbox.selectedIndex = i+1;
}
}
}
}
function load_opsyses(selects) {
if (!selects[0]) { return; }
for (var select=0; select<selects.length; select++) {
var opsysbox = selects[select];
clearSelect(opsysbox);
addNullEntry(opsysbox);
// find the currently selected platform
var platformbox = document.getElementById("platform"+opsysbox.name.substr(5));
var platformid = platformbox.options[platformbox.selectedIndex].value;
var platform = getPlatformById(platformid);
if (!platform) {
return;
}
var opsyses = platform['opsyses'];
for (var i=0; i<opsyses.length; i++) {
var option = makeOption(opsyses[i]);
opsysbox.add(option, null);
if (isDefault(document.getElementById(opsysbox.name+"_default"), opsyses[i]['id'])) {
opsysbox.selectedIndex = i+1;
}
}
}
}
function changeProduct(testid) {
var testidflag = "";
if (testid) { testidflag = "_"+testid; }
load_testgroups([document.getElementById("testgroup"+testidflag)]);
changeTestgroup(testid);
load_platforms([document.getElementById("platform"+testidflag)]);
changePlatform(testid);
load_branches([document.getElementById("branch"+testidflag)]);
}
function changeTestgroup(testid) {
var testidflag = "";
if (testid) { testidflag = "_"+testid; }
load_subgroups([document.getElementById("subgroup"+testidflag)]);
}
function changePlatform(testid) {
var testidflag = "";
if (testid) { testidflag = "_"+testid; }
load_opsyses([document.getElementById("opsys"+testidflag)]);
}
function addNullEntry(select) {
// add a blank entry to the current select:
select.add(new Option("---", "---", false, false), null);
}
function clearSelect(select) {
// remove all options from a select:
while (select.options[0]) {
select.remove(0);
}
}
function getProductById(prodid) {
for (var i=0; i<litmusconfig.length; i++) {
if (litmusconfig[i]['id'] == prodid) {
return(litmusconfig[i]);
}
}
}
function getTestgroupById(testgroupid) {
for (var i=0; i<litmusconfig.length; i++) {
for (var j=0; j<litmusconfig[i]['testgroups'].length; j++) {
if (litmusconfig[i]['testgroups'][j]['id'] == testgroupid) {
return(litmusconfig[i]['testgroups'][j]);
}
}
}
}
function getPlatformById(platformid) {
for (var i=0; i<litmusconfig.length; i++) {
for (var j=0; j<litmusconfig[i]['platforms'].length; j++) {
if (litmusconfig[i]['platforms'][j]['id'] == platformid) {
return(litmusconfig[i]['platforms'][j]);
}
}
}
}
// pass this the <input> containing the list of possible default values
// and the current value, returns true if the current value appears in
// defaultInput, otherwise returns false
function isDefault(defaultInput, curvalue) {
if (! defaultInput) { return false; }
var defaultarray = defaultInput.value.split(',');
for (var i=0; i<defaultarray.length; i++) {
if (defaultarray[i] == curvalue) {
return true;
}
}
return false;
}
function makeOption(obj) {
return new Option(obj['name'], obj['id'], false, false)
}
function getElementByClass(theClass) {
var elements = new Array();
var all = document.getElementsByTagName("*");
for (var i=0; i<all.length; i++) {
if (all[i].className == theClass) {
elements.push(all[i]);
}
}
return elements;
}
</script>
[% END %]

Просмотреть файл

@ -0,0 +1,18 @@
[% INCLUDE global/html_header.tmpl %]
[% INCLUDE global/litmus_header.tmpl %]
<div id="page">
[% INCLUDE sidebar/sidebar.tmpl %]
<div id="content">
<h1 class="firstHeading">Recent Test Results</h1>
[% INCLUDE reporting/test_results.tmpl include_limit_criteria=1 %]
</div> <!--END content-->
</div> <!--END page-->
[% INCLUDE global/litmus_footer.tmpl %]
[% INCLUDE global/html_footer.tmpl %]

Просмотреть файл

@ -30,29 +30,40 @@
# from the current group
#%]
[% INCLUDE global/html_header.tmpl %]
[% INCLUDE global/litmus_header.tmpl %]
[% INCLUDE global/header.html.tmpl title = 'Run Tests' %]
<div id="page">
<p class="pagetitle">Run Tests</p>
<p class="pageinstruction">Thank you for your testing.</p>
[% INCLUDE sidebar/sidebar.tmpl %]
<div id="content">
<h1 class="firstHeading">[% title %]</h1>
<div class="section-full">
<div class="section-header">
Results submitted
</div>
<div class="section-content">
<p>Thank you for your testing efforts.</p>
[% IF testcount %]
[% IF testcount > 1 %] [% plural = 's' %] [% END %]
<p class="pageinstruction"> You have submitted [% testcount FILTER html %] test
result[% plural %].
</p>
<p>You have submitted <strong>[% testcount FILTER html %]</strong> test result[% plural %].</p>
[% END %]
[% IF resultcounts.keys.0 %]
<p><strong>Result Summary:</strong></p>
<table border="0">
<table class="testresults-submitted">
[% FOREACH curresult = resultcounts.keys %]
[% IF resultcounts.$curresult %]
[% count = resultcounts.$curresult %]
[% ELSE %]
[% count = 0 %]
[% END %]
<tr>
<tr class="[% curresult FILTER lower %]">
<td><strong>[% curresult FILTER html %]:</strong></td>
<td>[% count FILTER html %]</td>
</tr>
@ -70,13 +81,24 @@
</table>
[% END %]
<p class="pageinstruction">Go <a href="index.cgi">Home</a> or
[% IF return %]
<a href="[% return | uri | html %]">go back.</a>
[% ELSE %]
<p>
[% IF return %]
<a href="[% return | uri | html %]">Go Back</a> or
[% END %]
<a href="run_tests.cgi?product=[% product.productid | uri | html %]&continuetesting=1&defaulttestgroup=[% testgroup.testgroupid | uri | html %]">
run some more tests</a>.
[% END %]
Run Some More Tests</a>
</p>
[% INCLUDE global/footer.html.tmpl %]
</div> <!--END section-content-->
</div> <!--END section-full-->
</div> <!--END content-->
</div> <!--END page-->
[% INCLUDE global/litmus_footer.tmpl %]
[% INCLUDE global/html_footer.tmpl %]

Просмотреть файл

@ -0,0 +1,20 @@
[% INCLUDE global/html_header.tmpl %]
[% INCLUDE global/litmus_header.tmpl %]
<div id="page">
[% INCLUDE sidebar/search_sidebar.tmpl criteria=criteria %]
<div id="content">
<h1 class="firstHeading">[% title %]</h1>
[% INCLUDE reporting/advanced_search_form.tmpl %]
<h1 class="firstHeading">Search Results</h1>
[% INCLUDE reporting/test_results.tmpl %]
</div> <!--END content-->
</div> <!--END page-->
[% INCLUDE global/litmus_footer.tmpl %]
[% INCLUDE global/html_footer.tmpl %]

Просмотреть файл

@ -0,0 +1,189 @@
<form id="advanced_search" name="advanced_search" method="get" action="advanced_search.cgi">
<script>
function init()
{
FormInit(document.forms['advanced_search'], document.location.search);
}
</script>
<table class="section">
<tr>
<td class="subsection">
<div class="section-header">
Limit By Field
</div>
<div class="section-content">
<table class="advanced-search">
<tr>
<td colspan="2" class="instructions">
Limit your search to specific values of visible fields.
</td>
</tr>
<tr>
<td class="heading">Product:</td>
<td>[% INCLUDE form_widgets/select_product.tmpl %]</td>
</tr>
<tr>
<td class="heading">Platform:</td>
<td>[% INCLUDE form_widgets/select_platform.tmpl %]</td>
</tr>
<tr>
<td class="heading">Testgroup:</td>
<td>[% INCLUDE form_widgets/select_test_group.tmpl %]</td>
</tr>
<tr>
<td class="heading">Testcase ID#:</td>
<td>[% INCLUDE form_widgets/select_test_id.tmpl %]</td>
</tr>
<tr>
<td class="heading">Status:</td>
<td>[% INCLUDE form_widgets/select_result_status.tmpl%]</td>
</tr>
<tr>
<td class="heading">Branch:</td>
<td>[% INCLUDE form_widgets/select_branch.tmpl %]</td>
</tr>
</table>
</div>
</td>
<td class="subsection">
<div class="section-header">
Limit By Date
</div>
<div class="section-content">
<table class="advanced-search">
<tr>
<td colspan="2" class="instructions">Display only results between these two dates.</p><p>NOTE: the preferred format for dates is YYYYMMDDhhmmss, although the search engine will do its best (within reason) to parse dates from whatever is submitted.</td>
</tr>
<tr>
<td class="heading">Start Date:</td>
<td><input type="text" name="start_date" value=""></td>
</tr>
<tr>
<td class="heading">End Date:</td>
<td><input type="text" name="end_date" value="Now"></td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td class="subsection">
<div class="section-header">
Search By Field
</div>
<div class="section-content">
<table class="advanced-search">
<tr>
<td colspan="3" class="instructions">
Perform more elaborate pattern matching against all fields.
</td>
</tr>
<tr>
<td>[% INCLUDE form_widgets/select_search_field.tmpl name="search_field1" %]</td>
<td>[% INCLUDE form_widgets/select_match_criteria.tmpl name="match_criteria1" %]</td>
<td><input type="text" name="search_value1" value=""></td>
</tr>
<tr>
<td>[% INCLUDE form_widgets/select_search_field.tmpl name="search_field2" %]</td>
<td>[% INCLUDE form_widgets/select_match_criteria.tmpl name="match_criteria2" %]</td>
<td><input type="text" name="search_value2" value=""></td>
</tr>
<tr>
<td>[% INCLUDE form_widgets/select_search_field.tmpl name="search_field3" %]</td>
<td>[% INCLUDE form_widgets/select_match_criteria.tmpl name="match_criteria3" %]</td>
<td><input type="text" name="search_value3" value=""></td>
</tr>
<tr>
<td>[% INCLUDE form_widgets/select_search_field.tmpl name="search_field4" %]</td>
<td>[% INCLUDE form_widgets/select_match_criteria.tmpl name="match_criteria4" %]</td>
<td><input type="text" name="search_value4" value=""></td>
</tr>
</table>
</div>
</td>
<td class="subsection">
<div class="section-header">
Sort Order
</div>
<div class="section-content">
<table class="advanced-search">
<tr>
<td colspan="3" class="instructions">
Define the sort order for your results.
</td>
</tr>
<tr>
<td class="heading">Sort first by:</td>
<td>[% INCLUDE form_widgets/select_sort_field.tmpl name="sort_field1" %]</td>
<td>[% INCLUDE form_widgets/select_sort_order.tmpl name="sort_order1" %]</td>
</tr>
<tr>
<td class="heading">Then by:</td>
<td>[% INCLUDE form_widgets/select_sort_field.tmpl name="sort_field2" %]</td>
<td>[% INCLUDE form_widgets/select_sort_order.tmpl name="sort_order2" %]</td>
</tr>
<tr>
<td class="heading">Then by:</td>
<td>[% INCLUDE form_widgets/select_sort_field.tmpl name="sort_field3" %]</td>
<td>[% INCLUDE form_widgets/select_sort_order.tmpl name="sort_order3" %]</td>
</tr>
<tr>
<td class="heading">Then by:</td>
<td>[% INCLUDE form_widgets/select_sort_field.tmpl name="sort_field4" %]</td>
<td>[% INCLUDE form_widgets/select_sort_order.tmpl name="sort_order4" %]</td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td class="subsection">
<div class="section-header">
General Options
</div>
<div class="section-content">
<table class="advanced-search">
<tr>
<td colspan="2" class="instructions">
Use this to limit the number of results displayed.
</td>
</tr>
<td colspan="2">Limit to <input type="text" name="limit" value="15" size="5"> results</td>
</tr>
</table>
</div>
</td>
<td class="subsection">
<div class="section-header">
Admin Options
</div>
<div class="section-content">
<table class="advanced-search">
<tr>
<td colspan="2" class="instructions">
Admin-specific limiting criteria go here. These criteria are not available to regular users.
</td>
</tr>
<td colspan="2"><input type="checkbox" name="trusted_only">&nbsp;Display only test results from trusted sources</td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td colspan="2" class="submit">
<input type="reset" onclick="FormInit(this.parent, '');">&nbsp;<input type="submit">
</td>
</tr>
</table>
</form>

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

@ -0,0 +1,176 @@
<div class="section-full">
<div class="section-header">
Summary Information
</div>
<div class="section-content">
<table class="single-result">
<tr class="[% result.result.class_name %]">
<td width="20%">Status:</td><td>[% result.result.name %]</td>
</tr>
<tr class="even">
<td>Test Summary:</td><td>[% result.testid.summary %]</td>
</tr>
<tr class="odd">
<td>Testcase ID#:</td><td><a href="show_test.cgi?id=[% result.test_id %]">[% result.test_id %]</a></td>
</tr>
<tr class="even">
<td>Submitted on:</td><td>[% result.submission_time %]</td>
</tr>
<tr class="odd">
<td>Submitted by:</td><td>[% IF result.user.email != "" %]
<a href="mailto:[% result.user.email %]?subject='Litmus test result submission #[% result.testresult_id %]'">[% result.user.email %]</a>
[% ELSE %]
Not provided
[% END %]</td>
</tr>
</table>
</div> <!--END section-content-->
</div> <!--END section-full-->
<div class="section-full">
<div class="section-header">
Product and Platform
</div>
<div class="section-content">
<table class="single-result">
<tr class="odd">
<td width="20%">Product:</td><td>[% result.testid.subgroup.testgroup.product.name %]</td>
</tr>
<tr class="even">
<td>Platform:</td><td>[% result.platform.name %]</td>
</tr>
<tr class="odd">
<td>Operating System:</td><td>[% result.opsys.name %]</td>
</tr>
<tr class="even">
<td>Build ID:</td><td>[% result.buildid %]</td>
</tr>
<tr class="odd">
<td>User Agent:</td><td>[% result.user_agent %]</td>
</tr>
</table>
</div> <!--END section-content-->
</div> <!--END section-full-->
<form id="update_result" name="update_result" method="post" action="single_result.cgi">
<input type="hidden" name="id" value="[% result.testresult_id %]">
<div class="section-full">
<div class="section-header">
Referenced Bugs
</div>
<div class="section-content">
<table class="single-result">
<tr class="odd">
<td>
[% IF result.bugs %]
Bug IDs:
[% FOREACH bug=result.bugs %]
<a target="bugzilla" href="https://bugzilla.mozilla.org/show_bug.cgi?id=[% bug.bug_id %]">[% bug.bug_id %]</a>[% UNLESS loop.last %], [% END %]
[% END %]
[% ELSE %]
No bugs on file.
[% END %]
</td>
</tr>
<tr class="even">
<td>
Add bug references: <input name="new_bugs" type="text" value=""> (bug #,bug #,...) <input type="submit" value="Add Bug References">
</td>
</tr>
</table>
</div> <!--END section-content-->
</div> <!--END section-full-->
<div class="section-full">
<div class="section-header">
Comments
</div>
<div class="section-content">
<table class="comments">
<tr class="odd">
[% IF defaultemail %]
<td width="20%"><a name="add_comment"></a>Add a Comment:</td>
<td><textarea wrap="hard" name="new_comment" id="new_comment" rows="10" cols="80" accesskey="c"></textarea></td>
</tr>
<tr class="odd">
<td><td><input type="submit" value="Add Comment"></td>
[% ELSE %]
<td colspan="2" class="no-results">
You must log in before you can leave comments.
</td>
[% END %]
</tr>
[% IF result.comments %]
[% comment_num=1 %]
[% FOREACH comment=result.comments %]
<tr [% IF not (loop.count % 2) %]class="odd"[% ELSE %]class="even"[% END %]>
<td colspan="2">
<p><em>------- Comment <a name="c[% comment_num %]" href="#c[% comment_num %]">#[% comment_num %]</a> From
[% IF comment.user.email %]
<a href="mailto:[% comment.user.email %]">[% comment.user.email %]</a>
[% ELSE %]
Anonymous
[% END %]
[% comment.user.submission_time %] -------</em></p>
<p>[% comment.comment FILTER html %]</p>
[% comment_num=comment_num+1 %]
[% END %]
</td>
</tr>
[% ELSE %]
<tr class="even">
<td class="no-results" colspan="2">
No comments.
</td>
</tr>
[% END %]
</table>
</div> <!--END section-content-->
</div> <!--END section-full-->
</form>
<div class="section-full">
<div class="section-header">
Logs
</div>
<div class="section-content">
<table class="single-result">
<tr class="odd">
<td>
[% IF result.logs %]
[% FOREACH log=result.logs %]
[% log.log_type.name %]: <br/>
[% END %]
[% ELSE %]
No logs available.
[% END %]
</td>
</tr>
</table>
</div> <!--END section-content-->
</div> <!--END section-full-->

Просмотреть файл

@ -0,0 +1,18 @@
[% INCLUDE global/html_header.tmpl %]
[% INCLUDE global/litmus_header.tmpl %]
<div id="page">
[% INCLUDE sidebar/search_sidebar.tmpl criteria=criteria %]
<div id="content">
<h1 class="firstHeading">Search Results</h1>
[% INCLUDE reporting/test_results.tmpl include_limit_criteria=1 %]
</div> <!--END content-->
</div> <!--END page-->
[% INCLUDE global/litmus_footer.tmpl %]
[% INCLUDE global/html_footer.tmpl %]

Просмотреть файл

@ -0,0 +1,18 @@
[% INCLUDE global/html_header.tmpl %]
[% INCLUDE global/litmus_header.tmpl %]
<div id="page">
[% INCLUDE sidebar/sidebar.tmpl %]
<div id="content">
<h1 class="firstHeading">[% title %]</h1>
[% INCLUDE reporting/result_display.tmpl %]
</div> <!--END content-->
</div> <!--END page-->
[% INCLUDE global/litmus_footer.tmpl %]
[% INCLUDE global/html_footer.tmpl %]

Просмотреть файл

@ -0,0 +1,43 @@
<table class="test-results">
<tr>
<td colspan="2" class="header">Date</td>
<td class="header">Product</td>
<td class="header">Platform</td>
<td class="header">Testgroup</td>
<td class="header">Testcase ID#</td>
<td class="header">Summary</td>
<td class="header">Status</td>
<td class="header">Branch</td>
</tr>
<tr>
[% IF results AND results.size > 0 %]
[% FOREACH result=results %]
<tr class="[% result.result_status_class %]">
<td colspan="2" align="center">[% result.created %]</td>
<td align="center">[% result.product_name %]</td>
<td align="center">[% result.platform_name %]</td>
<td align="center">[% result.test_group_name %]</td>
<td align="center"><a href="show_test.cgi?id=[% result.test_id %]">[% result.test_id %]</a></td>
<td>[% result.summary %]</td>
<td align="center"><a href="single_result.cgi?id=[% result.testresult_id %]">[% result.result_status_class %]</a></td>
<td align="center">[% result.branch_name %]</td>
</tr>
[% END %]
[% ELSE %]
<tr>
<td class="no-results" colspan="9">No test results match the search criteria.</td>
</tr>
[% END %]
[% IF include_limit_criteria==1 %]
[% INCLUDE reporting/test_results_limit.tmpl %]
[% END %]
</table>
</form>

Просмотреть файл

@ -0,0 +1,85 @@
[% PROCESS global/selects.none.tmpl %]
<form name="search_results" method="get" action="search_results.cgi" onSubmit="if(this.test_id.value=='-Testcase ID#-'){this.test_id.value = '';}if(this.summary.value=='-Summary-'){this.summary.value = '';}">
<script>
function init()
{
FormInit(document.forms['search_results'], document.location.search);
}
</script>
<!--# Add a row to order the results by each field. -->
<tr class="search">
<td class="search-heading">Sort by</td>
<td class="search"><select name="order_by_created">
<option value="">-Sort-</option>
<option[% IF order_bys.created == 'ASC' %] selected[% END %] value="ASC">A->Z</option>
<option[% IF order_bys.created == 'DESC' %] selected[% END %] value="DESC">Z->A</option>
</select></td>
<td class="search"><select name="order_by_product">
<option value="">-Sort-</option>
<option[% IF order_bys.product == 'ASC' %] selected[% END %]
value="ASC">A->Z</option>
<option[% IF order_bys.product == 'DESC' %] selected[% END %] value="DESC">Z->A</option>
</select></td>
<td class="search"><select name="order_by_platform">
<option value="">-Sort-</option>
<option[% IF order_bys.platform == 'ASC' %] selected[% END %] value="ASC">A->Z</option>
<option[% IF order_bys.platform == 'DESC' %] selected[% END %] value="DESC">Z->A</option>
</select></td>
<td class="search"><select name="order_by_test_group">
<option value="">-Sort-</option>
<option[% IF order_bys.test_group == 'ASC' %] selected[% END %] value="ASC">A->Z</option>
<option[% IF order_bys.test_group == 'DESC' %] selected[% END %] value="DESC">Z->A</option>
</select></td>
<td class="search"><select name="order_by_test_id">
<option value="">-Sort-</option>
<option[% IF order_bys.test_id == 'ASC' %] selected[% END %] value="ASC">A->Z</option>
<option[% IF order_bys.test_id == 'DESC' %] selected[% END %] value="DESC">Z->A</option>
</select></td>
<td class="search"><select name="order_by_summary">
<option value="">-Sort-</option>
<option[% IF order_bys.summary == 'ASC' %] selected[% END %] value="ASC">A->Z</option>
<option[% IF order_bys.summary == 'DESC' %] selected[% END %] value="DESC">Z->A</option>
</select></td>
<td class="search"><select name="order_by_result_status">
<option value="">-Sort-</option>
<option[% IF order_bys.result_status == 'ASC' %] selected[% END %] value="ASC">A->Z</option>
<option[% IF order_bys.result_status == 'DESC' %] selected[% END %] value="DESC">Z->A</option>
</select></td>
<td class="search"><select name="order_by_branch">
<option value="">-Sort-</option>
<option[% IF order_bys.branch == 'ASC' %] selected[% END %] value="ASC">A->Z</option>
<option[% IF order_bys.branch == 'DESC' %] selected[% END %] value="DESC">Z->A</option>
</select></td>
</tr>
<!--# Add a row to order the results by each field. -->
<tr class="search">
<td class="search-heading" align="center">Limit by</td>
<td class="search">[% INCLUDE form_widgets/select_timespan.tmpl %]</td>
<td class="search">[% INCLUDE form_widgets/select_product.tmpl %]</td>
<td class="search">[% INCLUDE form_widgets/select_platform.tmpl %]</td>
<td class="search">[% INCLUDE form_widgets/select_test_group.tmpl %]</td>
<td class="search">[% INCLUDE form_widgets/input_test_id.tmpl %]</td>
<td class="search">[% INCLUDE form_widgets/input_summary.tmpl %]</td>
<td class="search">[% INCLUDE form_widgets/select_result_status.tmpl%]</td>
<td class="search">[% INCLUDE form_widgets/select_branch.tmpl %]</td>
</tr>
<tr class="search">
<td class="search-heading" align="center">
Limit to</td>
<td class="search"><input type="text" name="limit" value="[% limit %]" size="5"> results</td>
<td class="search-submit" colspan="7"><input type="reset" onclick="FormInit(this.parent, '');">&nbsp;<input type="submit" value="Show Results">
</td>
</tr>
</form>

Просмотреть файл

@ -30,11 +30,24 @@
# from the current group
#%]
[% INCLUDE global/html_header.tmpl %]
[% INCLUDE global/litmus_header.tmpl %]
[% INCLUDE global/header.html.tmpl title = 'Run Tests' %]
<div id="page">
<p class="pagetitle">Run Tests</p>
<p class="pageinstruction">Thank you for your testing.</p>
[% INCLUDE sidebar/sidebar.tmpl %]
<div id="content">
<h1 class="firstHeading">[% title %]</h1>
<div class="section-full">
<div class="section-header">
Results submitted
</div>
<div class="section-content">
<p>Thank you for your testing.</p>
[% IF testcount %]
[% IF testcount > 1 %] [% plural = 's' %] [% END %]
@ -70,7 +83,7 @@
</table>
[% END %]
<p class="pageinstruction">Go <a href="index.cgi">Home</a> or
<p>Go <a href="index.cgi">Home</a> or
[% IF return %]
<a href="[% return | uri | html %]">go back.</a>
[% ELSE %]
@ -79,4 +92,15 @@ run some more tests</a>.
[% END %]
</p>
[% INCLUDE global/footer.html.tmpl %]
</div> <!--END section-content-->
</div> <!--END section-full-->
</div> <!--END content-->
</div> <!--END page-->
[% INCLUDE global/litmus_footer.tmpl %]
[% INCLUDE global/html_footer.tmpl %]

Просмотреть файл

@ -27,59 +27,80 @@
# $defaultgroup (optional) - the default group to display
#%]
[% onload = 'showsubgroup()' %]
[% INCLUDE global/header.html.tmpl title = 'Run Tests' script = '
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
[% INCLUDE global/html_header.tmpl js_files=['js/SubGroup.js','js/SelectBoxes.js','js/RunTests.js'] %]
[% INCLUDE global/litmus_header.tmpl %]
function showsubgroup() {
var groupselect = MM_findObj("group");
var selnum;
for (var i=0; i<groupselect.length; i++) {
if (groupselect[i].checked)
selnum = groupselect[i].value;
}
// no selection yet so just keep everything as-is:
if (! selnum)
return;
// object to show
var obj = MM_findObj("divsubgroup_"+selnum);
// disable all of them
for (var i=0; i<groupselect.length; i++) {
var gnum = groupselect[i].value;
var disableobj = MM_findObj("divsubgroup_"+gnum);
disableobj.style.display = "none";
}
MM_findObj("divsubgroup_null").style.display = "none";
obj.style.display = "";
<div id="page">
}' onload = 'showsubgroup()' %]
[% INCLUDE sidebar/sidebar.tmpl %]
<div id="content">
<h1 class="firstHeading">[% title %]</h1>
<div class="section-full">
<div class="sec_head">
<table width="100%">
<tr>
<td class="l">Testing Summary</td>
<td class="r"><a href="#" onclick="divSWAP('sum'); return false;">Hide / Show Summary</a></td>
</tr>
</table>
</div>
<div id="sum" class="summary">
<table class="test-config">
<tr>
<td>
<div class="dh">Product:</div><div class="dv">[% sysconfig.product.name FILTER html %]</div>
<div class="t_link"><a href="run_tests.cgi">Change Configuration</a></div>
</td>
<td>
<div class="dh">Platform:</div><div class="dv">[% sysconfig.platform.name FILTER html %]</div>
<div class="dh">Opsys:</div><div class="dv">[% sysconfig.opsys.name FILTER html %]</div>
</td>
<td>
<div class="dh">Branch:</div><div class="dv">[% sysconfig.branch.name FILTER html %]</div>
<div class="dh">Build ID:</div><div class="dv">[% sysconfig.buildid FILTER html %]</div>
</td>
</tr>
</table>
</div> <!--END section-content-->
</div> <!--END section-full-->
<hr />
<div class="section-full">
<div class="section-header">
Select Testing Group
</div>
<div class="section-content">
<p class="pagetitle">Run Tests</p>
<p class="pageinstruction">Select a testing group and subgroup.</p>
<form action="run_tests.cgi" method="post" name="form" id="form">
<p>
<strong>Testing Group:</strong><br>
<ul>
[% IF defaultgroup.testgroupid=="" %]
[% select_first_avail_group=1 %]
[% ELSE %]
[% select_first_avail_group=0 %]
[% END %]
[% FOREACH curgroup = groups %]
[% IF defaultgroup.testgroupid == curgroup.testgroupid %]
[% group_completed = curgroup.percentcompleted(sysconfig.platform, 0) %]
[% IF group_completed != 100 AND group_completed!= 'N/A' AND (defaultgroup.testgroupid==curgroup.testgroupid OR select_first_avail_group==1) %]
[% selected = "checked" %]
[% ELSE %] [% selected = "" %] [% END %]
<li><input type="radio" name="group" value="[% curgroup.testgroupid FILTER html %]"
[% select_first_avail_group=0 %]
[% ELSE %]
[% selected = "" %]
[% END %]
<li><input [% IF group_completed == 100 OR group_completed == 'N/A' %]disabled [% END %] type="radio" name="group" value="[% curgroup.testgroupid FILTER html %]"
onchange="showsubgroup()" [% selected %]>
[% curgroup.name FILTER html %] - [% curgroup.percentcompleted(sysconfig.platform, 0) %]%</li>
[% curgroup.name FILTER html %] - [% group_completed %][% IF group_completed != 'N/A' %]%[% END %]</li>
[% END %]
[% # for some boneheaded reason, our js breaks if there is only one group,
# so we create a fake dummy group if this is the case: %]
@ -88,42 +109,58 @@ function showsubgroup() {
[% END %]
</ul>
</p>
<hr>
</div> <!--END section-content-->
</div> <!--END section-full-->
<div class="section-full">
<div class="section-header">
Select Subgroup
</div>
<div class="section-content">
<p>
<strong>Select Subgroup:</strong><br>
[% headerrow = '<tr><td><strong>Name</strong></td><td><strong>Number of Tests</td>
<td><strong>% Completed</strong></td></tr>' %]
[% headerrow = '<tr><th>Name</th><th>Number of Tests</th><th>% Completed</th></tr>' %]
<div id="divsubgroup_null" style="visibility: visible; position: absolute;">
<table border="1">
<div id="divsubgroup_null" style="visibility: visible;">
<table class="run-tests">
[% headerrow %]
<tr>
<td colspan="3" class="no-results">
Please select a testing group with testcases, or that has not yet been tested in its entirety.
</td>
</tr>
</table>
</div>
[% FOREACH curgroup = subgroups.keys %]
[% cursubgrouplist = subgroups.$curgroup %]
<div id="divsubgroup_[% curgroup FILTER html %]" style="display: none;">
<table border="1">
<table class="run-tests">
[% headerrow %]
[% FOREACH cursubgroup = cursubgrouplist %]
[% completed = cursubgroup.percentcompleted(sysconfig.platform, 0) %]
[% IF completed == 0 %]
[% groupstyle = '' %]
[% ELSIF completed == 100 OR completed == 'N/A' %]
[% IF completed == 100 OR completed == 'N/A' %]
[% groupstyle = 'completegroup' %]
[% ELSE %]
[% IF not (loop.count % 2) %]
[% groupstyle = 'even' %]
[% ELSE %]
[% groupstyle = 'odd' %]
[% END %]
[% END %]
<tr class="[% groupstyle %]">
<td><input type="radio" name="subgroup_[% curgroup FILTER html %]"
<td align="left"><input [% IF completed == 100 OR completed == 'N/A' %]disabled [% END %]type="radio" name="subgroup_[% curgroup FILTER html %]"
value="[% cursubgroup.id FILTER html %]">
[% cursubgroup.name FILTER html %]</input></td>
<td>[% counttests = cursubgroup.tests %]
<td align="center">[% counttests = cursubgroup.tests %]
[% IF ! counttests %] 0
[% ELSIF ! counttests.testid %][% counttests.list.size %]
[% ELSE %]
1[% END %]</td>
<td>[% completed FILTER html %]%</td>
<td align="center">[% completed FILTER html %][% IF completed != 'N/A' %]%[% END %]</td>
</tr>
[% END %]
</table>
@ -137,5 +174,16 @@ function showsubgroup() {
</div>
</form>
</p>
</div> <!--END section-content-->
</div> <!--END section-full-->
</div> <!--END content-->
</div> <!--END page-->
[% INCLUDE global/litmus_footer.tmpl %]
[% INCLUDE global/html_footer.tmpl %]
[% INCLUDE global/footer.html.tmpl %]

Просмотреть файл

@ -36,12 +36,25 @@
[% PROCESS global/selects.none.tmpl %]
[% INCLUDE global/header.html.tmpl title = 'Run Tests'
includeselects=1%]
[% includeselects=1 %]
[% INCLUDE global/html_header.tmpl js_files=['js/SelectBoxes.js'] %]
[% INCLUDE global/litmus_header.tmpl %]
<p class="pagetitle">Run Tests</p>
<p class="pageinstruction">Welcome to Litmus. To run tests, please enter some
information about your system configuration.</p>
<div id="page">
[% INCLUDE sidebar/sidebar.tmpl %]
<div id="content">
<h1 class="firstHeading">[% title %]</h1>
<div class="section-full">
<div class="section-header">
System Information
</div>
<div class="section-content">
<p>To run tests, please enter some information about your system configuration.</p>
<form action="[% goto %]" method="post" name="form" id="form">
<input name="isSysConfig" type="hidden" value="1">
<input name="testgroup" type="hidden" value="[% testgroup %]">
@ -59,7 +72,6 @@ information about your system configuration.</p>
[% END %]
[% END %]
<p><strong>System Information:</strong><br>
<table border="0" cellpadding="5">
<tr><td><div align="right">Product:</div></td><td>
@ -94,18 +106,28 @@ information about your system configuration.</p>
<td>[% INCLUDE branchbox branches=branches defaultbranch=ua.branch(product) %]</td>
</tr>
<tr>
<td><div align="right">Build Id:</div></td>
<td><input type="text" id="buildid" name="buildid" size="20"
value="[% ua.buildid FILTER html %]"></td>
<td><div align="right">Build ID:</div></td>
<td><input type="text" id="buildid" name="buildid" size="25" value="[% ua.buildid FILTER html %]"></td>
</tr>
<tr>
<td><div align="right">Email Address:</div></td>
<td><input type="text" id="email" name="email" size="20"
value="[% defaultemail.email FILTER html %]"></td>
<td><input type="text" id="email" name="email" size="25" value="[% defaultemail.email FILTER html %]"></td>
</tr>
<tr>
<td colspan="2">
<input type="submit" name="Submit" value="Submit">
</td>
</tr>
</table>
</p>
<input type="submit" name="Submit" value="Submit">
</form>
[% INCLUDE global/footer.html.tmpl %]
</div>
</div>
</div> <!--END content-->
</div> <!--END page-->
[% INCLUDE global/litmus_footer.tmpl %]
[% INCLUDE global/html_footer.tmpl %]

Просмотреть файл

@ -27,46 +27,221 @@
# @results - the list of all possible test results
#%]
[% PROCESS global/selects.none.tmpl %]
[% script = ['edittestsscript'] %]
[% onload="showTEST(1);" %]
[% INCLUDE global/header.html.tmpl title = 'Run Tests' script=script includeselects=1%]
[% INCLUDE global/html_header.tmpl js_files=['js/RunTests.js'] %]
[% INCLUDE global/litmus_header.tmpl %]
<p class="pagetitle">Run Tests</p>
<p class="pageinstruction">Testing Summary:</p>
<table border="0">
<tr><td><div align="right"><strong>Product:</strong></div></td><td>[% sysconfig.product.name FILTER html %]</td></tr>
<tr><td><div align="right"><strong>Platform:</strong></div></td><td>[% sysconfig.platform.name FILTER html %]</td></tr>
<tr><td><div align="right"><strong>Opsys:</strong></div></td><td>[% sysconfig.opsys.name FILTER html %]</td></tr>
<tr><td><div align="right"><strong>Branch:</strong></div></td><td>[% sysconfig.branch.name FILTER html %]</td></tr>
<tr><td><div align="right"><strong>Build ID:</strong></div></td><td>[% sysconfig.buildid FILTER html %]</td></tr>
<tr><td><div align="right"><strong>Group:</strong></div></td><td>[% group.name FILTER html %]</td></tr>
<tr><td><div align="right"><strong>Subgroup:</strong></div></td><td>[% subgroup.name FILTER html %]</td></tr>
<div id="page">
[% INCLUDE sidebar/runtests_sidebar.tmpl %]
<div id="content">
<h1 class="firstHeading">[% title %]</h1>
<div class="section-full">
<div class="sec_head">
<table width="100%">
<tr>
<td class="l">Testing Summary</td>
<td class="r"><a href="#" onclick="divSWAP('sum'); return false;">Hide / Show Summary</a></td>
</tr>
</table>
<p class="smallcaps"><a href="run_tests.cgi">change configuration</a>
</div>
<div id="sum" class="summary">
<table class="test-config">
<tr>
<td>
<div class="dh">Product:</div><div class="dv">[% sysconfig.product.name FILTER html %]</div>
<div class="t_link"><a href="run_tests.cgi">Change Configuration</a></div>
</td>
<td>
<div class="dh">Platform:</div><div class="dv">[% sysconfig.platform.name FILTER html %]</div>
<div class="dh">Opsys:</div><div class="dv">[% sysconfig.opsys.name FILTER html %]</div>
</td>
<td>
<div class="dh">Branch:</div><div class="dv">[% sysconfig.branch.name FILTER html %]</div>
<div class="dh">Build ID:</div><div class="dv">[% sysconfig.buildid FILTER html %]</div>
</td>
<td>
<div class="dh">Group:</div><div class="dv">[% group.name FILTER html %]</div>
<div class="dh">Subgroup:</div><div class="dv">[% subgroup.name FILTER html %]</div>
</td>
</tr>
</table>
</div>
</div>
<hr />
<form action="process_test.cgi" method="post" name="form" id="form">
<input name="isTestResult" type="hidden" value="true">
<input name="editingTestcases" id="editingTestcases" type="hidden" value="">
<input name="testgroup" type="hidden" value="[% tests.list.0.testgroup.testgroupid FILTER html %]">
<input name="isTestResult" type="hidden" value="true" />
<input name="editingTestcases" id="editingTestcases" type="hidden" value="" />
<input name="testgroup" type="hidden" value="[% tests.list.0.testgroup.testgroupid FILTER html %]" />
[% evenodd = 'odd' %]
[% FOREACH curtest = tests %]
<div class="testlist_[%evenodd%]">
<a href="show_test.cgi?id=[% curtest.testid FILTER html %]" class="smallcaps">show</a>
[% INCLUDE test/test.html.tmpl test=curtest style="testlist_$evenodd" showedit=istrusted %]
[% IF evenodd == 'odd' %]
[% evenodd = 'even' %]
[% ELSE %]
[% evenodd = 'odd' %]
[% END %]
</div>
<hr />
<div class="section-full">
<div class="sec_head">
<table cellspacing="0" cellpadding="0">
<tr>
<td class="l">Testcases</td>
<td class="r">
[% IF tests.size <= 1 %]
<div class="nav" id="ma1">Previous | Next | Show All</div>
[% ELSE %]
[% current_order=1 %]
[% FOREACH curtest=tests %]
[% next_num=current_order+1 %]
<div class="nav" id="ma[% current_order %]">
[% IF current_order==1 %]
Previous
[% ELSE %]
<a href="#" onclick="showTEST([% current_order - 1 %]); return false;">Previous</a>
[% END %]
|
[% IF current_order>=tests.size %]
Next
[% ELSE %]
<a href="#" onclick="showTEST([% next_num %]); return false;">Next</a>
[% END %]
| <a href="#" onclick="showTEST('all'); return false;">Show All</a></div>
[% current_order=current_order+1 %]
[% END %]
<div class="nav" id="mf"><a href="#" onclick="showTEST(tmp_pagepos); return false;">Show One</a></div>
[% END %]
</td>
</tr>
</table>
</div> <!--END sec_head-->
<input type="submit" id="Submit" name="Submit" value="Submit Results" onclick="findEdited()">
</div> <!--END section-full-->
[% first_test_id=0 %]
[% num_testcases=0 %]
[% separators=[] %]
[% test_ids=[] %]
[% i=1 %]
[% FOREACH curtest=tests %]
[% IF first_test_id==0 %]
[% first_test_id=curtest.testid %]
[% END %]
[% IF num_testcases!=0 %]
[% sep_id="p$num_testcases" %]
<div class="head_s" id="[% sep_id %]" style="display:none;"></div>
[% separators.push(sep_id) %]
[% END %]
[% num_testcases=num_testcases+1 %]
[% test_ids.push(curtest.testid) %]
<!-- Test [% i %] Start -->
<div class="section-full" id="t[% i %]" style="display:[% IF num_testcases==1 %]block[% ELSE %]none[% END %];">
<div class="testcase-head">
<table cellpadding="0" cellspacing="0">
<tr>
<td class="l"><a name="test_4"></a>[% loop.count %]: [% curtest.summary %] (ID: [% curtest.testid %])</td>
<td class="r"><a href="http://testrunner.mozilla.org/litmus_staging/coop/show_test.cgi?id=[% curtest.testid %]">View / Edit</a></td>
</tr>
</table>
</div> <!--END testcase-head-->
<div class="section-content">
<table cellspacing="0" cellpadding="0" class="tcm">
<tr>
<td width="50%" class="content"><div class="dh">Steps to Perform:</div><div class="dv">[% curtest.steps %]</div></td>
<td width="50%" class="content"><div class="dh">Expected Results:</div><div class="dv">[% curtest.expected_results %]</div></td>
</tr>
<tr>
<td class="content" colspan="2">
<table cellspacing="0" cellpadding="0" class="tcmf">
<tr>
<td width="210px">
<div class="dh">Result:</div>
[% INCLUDE form_widgets/radio_testresults.tmpl test_id=curtest.testid %]
<br/>
<div><input type="submit" id="Submit[% curtest.testid %]" name="Submit[% curtest.testid %]" value="Submit This Result" /></div>
</td>
<td>
<div class="dh">Notes/Comments (optional):</div>
<div class="dv"><textarea name="comment_[% curtest.testid %]" cols="45" rows="4" id="note_[% curtest.testid %]"></textarea></div>
<div class="dh">Associated Bug #:</div>
<div class="dv"><input type="text" name="bug1_[% curtest.testid %]" class="result_bug" /> <input type="text" name="bug2_[% curtest.testid %]" class="result_bug" /></div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</div>
<!-- Test [% i %] End -->
[% i=i+1 %]
[% END %]
<script language="JavaScript" type="text/JavaScript">
var tmp_pagepos=1;
var tmp_pagetotal=[% num_testcases %];
var tmp_tests=new Array([% i=1 %][% FOREACH test_id=test_ids %][% IF i>1 %],[% END %]"t[% i %]"[% i=i+1 %][% END %]);
var tmp_separ=new Array([% i=1 %][% FOREACH separator=separators %][% IF i>1 %],[% END %]"[% separator %]"[% i=i+1 %][% END %]);
var tmp_menua=new Array([% i=1 %][% FOREACH test_id=test_ids %]"ma[% i %]",[% i=i+1 %][% END %]"mf");
var tmp_menub=new Array([% i=1 %][% FOREACH test_id=test_ids %]"mb[% i %]",[% i=i+1 %][% END %]"ml");
</script>
<div class="sec_head">
<table cellspacing="0" cellpadding="0">
<tr>
<td class="submitall"><div class="v3"><input type="submit" id="Submit" name="Submit" value="Submit All Results" onclick="findEdited()" /></div></td>
<td class="r">
[% IF tests.size <= 1 %]
<div class="nav" id="mb1">Previous | Next | Show All</div>
[% ELSE %]
[% current_order=1 %]
[% FOREACH curtest=tests %]
[% next_num=current_order+1 %]
<div class="nav" id="mb[% current_order %]">
[% IF current_order==1 %]
Previous
[% ELSE %]
<a href="#" onclick="showTEST([% current_order - 1 %]); return false;">Previous</a>
[% END %]
|
[% IF current_order>=tests.size %]
Next
[% ELSE %]
<a href="#" onclick="showTEST([% next_num %]); return false;">Next</a>
[% END %]
| <a href="#" onclick="showTEST('all'); return false;">Show All</a></div>
[% current_order=current_order+1 %]
[% END %]
<div class="nav" id="ml"><a href="#" onclick="showTEST(tmp_pagepos); return false;">Show One</a></div>
[% END %]
</td>
</tr>
</table>
</div>
</form>
[% INCLUDE global/footer.html.tmpl %]
</div> <!--END content-->
</div> <!--END page-->
[% INCLUDE global/litmus_footer.tmpl %]
[% INCLUDE global/html_footer.tmpl %]

Просмотреть файл

@ -22,16 +22,35 @@
# no interface for this template
#%]
[% title="View Test" %]
[% INCLUDE global/header.html.tmpl title = 'Show Testcase' %]
[% INCLUDE global/html_header.tmpl %]
[% INCLUDE global/litmus_header.tmpl %]
<p class="pagetitle">Show Testcase</p>
<p class="pageinstruction">Please enter a testcase ID.</p>
<div id="page">
[% INCLUDE sidebar/sidebar.tmpl %]
<div id="content">
<h1 class="firstHeading">[% title %]</h1>
<div class="section-full">
<div class="section-header">
Please enter a Testcase ID #
</div>
<div class="section-content">
<form action="show_test.cgi" method="get" name="form" id="form">
<input type="text" id="id" name="id" size="7" />
<br /><br />
<input type="submit" name="Submit" value="Submit">
<p><input type="text" id="id" name="id" size="7" />&nbsp;<input type="submit" value="Submit"></p>
</form>
[% INCLUDE global/footer.html.tmpl %]
</div>
</div>
</div> <!--END content-->
</div> <!--END page-->
[% INCLUDE global/litmus_footer.tmpl %]
[% INCLUDE global/html_footer.tmpl %]

Просмотреть файл

@ -28,14 +28,29 @@
[% PROCESS global/selects.none.tmpl %]
[% script = ['edittestsscript'] %]
[% INCLUDE global/header.html.tmpl title = "Testcase $test.testid - $test.summary"
script=script includeselects=1 %]
[% title="Testcase ID #$test.testid - $test.summary" %]
[% includeselects=1 %]
<p class="pageinstruction">Test [% test.testid %] - [% test.summary %]</p>
[% INCLUDE global/html_header.tmpl js_files=['js/EditTests.js', 'js/SelectBoxes.js'] %]
[% INCLUDE global/litmus_header.tmpl %]
<strong>Current Status:</strong> [% INCLUDE platformtable test=test %]
<div id="page">
[% INCLUDE sidebar/sidebar.tmpl %]
<div id="content">
<h1 class="firstHeading">[% title %]</h1>
<div class="section-full">
<div class="section-header">
Current Status
</div>
<div class="section-content">
<p>[% INCLUDE platformtable test=test %]</p>
<form action="process_test.cgi" method="post" name="form" id="form">
<input name="isTestResult" type="hidden" value="true">
@ -49,60 +64,22 @@
<td><br /><input type="submit" id="Submit" name="Submit" value="Submit Results" onclick="findEdited()"></td>
</tr>
<tr><td colspan="3"><hr /></td></tr>
<tr>
<td colspan="2">
<table border="0">
[%
# by default, we show only recent results and the last
# three non-recent results. the showallresults switch
# causes us to show all results:
%]
[% nonrecentcount = 0 %]
[% FOREACH curresult = test.testresults %]
[% UNLESS showallresults %]
[% IF curresult.isrecent == 0 && nonrecentcount >= 3 %]
[% NEXT %]
[% ELSIF curresult.isrecent == 0 %]
[% nonrecentcount = nonrecentcount+1 %]
[% END %]
[% END %]
<tr>
<td colspan="2" style="[% curresult.result.style %]">
------- Test Result From
<a href="mailto:[% curresult.user.email FILTER html | email %]">
[% curresult.user.email FILTER html | email %]</a>
[% curresult.timestamp FILTER html %] -------
</td>
</tr>
<tr><td colspan="2">
<div align="center"><strong>Result: [% curresult.result.name FILTER html %]</strong></div><br />
</td></tr>
<tr width="40%">
<td valign="top">
<table border="0">
<tr><td><div align="right"><strong>Product:</strong></div></td><td>[% INCLUDE product_to_img product=curresult.testid.product %]</td></tr>
<tr><td><div align="right"><strong>Platform:</strong></div></td><td>[% INCLUDE platform_to_img platform=curresult.platform %]</td></tr>
<tr><td><div align="right"><strong>Opsys:</strong></div></td><td>[% IF curresult.opsys %][% curresult.opsys.name FILTER html %][% ELSE %]Unknown[% END %]</td></tr>
<tr><td><div align="right"><strong>Branch:</strong></div></td><td>[% curresult.branch.name FILTER html %]</td></tr>
<tr><td><div align="right"><strong>Build ID:</strong></div></td><td>[% curresult.buildid FILTER html %]</td></tr>
<tr><td><br /></td></tr>
</table>
</td>
</div>
</div>
<td valign="top">[% IF curresult.note %]
<strong>Note: </strong> [% curresult.note FILTER html %]
[% END %]
</td>
</tr>
[% END %]
</table>
<a href="show_test.cgi?showallresults=1&id=[%test.testid FILTER html | uri%]">Show all results</a>
</td></tr>
</table>
<h1 class="firstHeading">Recent Test Results for [% title %]</h1>
[% INCLUDE global/footer.html.tmpl %]
[% INCLUDE reporting/test_results.tmpl results=test_results %]
</div>
</div>
</div> <!--END content-->
</div> <!--END page-->
[% INCLUDE global/litmus_footer.tmpl %]
[% INCLUDE global/html_footer.tmpl %]

Просмотреть файл

@ -0,0 +1,15 @@
<div id="sidebar">
[% INCLUDE sidebar/widget_header.tmpl %]
[% INCLUDE sidebar/widget_login.tmpl %]
[% INCLUDE sidebar/widget_testcases.tmpl %]
[% INCLUDE sidebar/widget_options.tmpl %]
[% INCLUDE sidebar/widget_admin.tmpl %]
[% INCLUDE sidebar/widget_legend.tmpl %]
</div>

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше