The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Smolder::DB::SmokeReport

DESCRIPTION

Class::DBI based model class for the 'smoke_report' table in the database.

METHODS

ACCESSSOR/MUTATORS

Each column in the borough table has a method with the same name that can be used as an accessor and mutator.

The following columns will return objects instead of the value contained in the table:

added

A DateTime object representing the datetime stored.

developer

The Smolder::DB::Developer object who added this report

project

The Smolder::DB::Project object that this report is about

OBJECT METHODS

add_tag

This method will add a tag to a given smoke report

    $report->add_tag('foo');

delete_tag

This method will remove a tag from a given smoke report

    $report->delete_tag('foo');

tags

Returns a list of all of tags that have been added to this smoke report. (in the smoke_report_tag table).

    # returns a simple list of scalars
    my @tags = $report->tags();

data_dir

The directory in which the data files for this report reside. If it doesn't exist it will be created.

file

This returns the file name of where the full report file for this smoke report does (or will) reside. If the directory does not yet exist, it will be created.

html

A reference to the HTML text of this Test Report.

html_test_detail

This method will return the HTML for the details of an individual test file. This is useful when you only need the details for some of the test files (such as an AJAX request).

It receives one argument, which is the index of the test file to show.

tap_stream

This method will return the file name that holds the recorded TAP stream given the index of that stream.

delete_files

This method will delete all of the files that can be created and stored in association with a smoke test report (the 'data_dir' directory). It will croak if the files can't be deleted for some reason. Returns true if all is good.

summary

Returns a text string summarizing the whole test run.

total_percentage

Returns the total percentage of passed tests.

CLASS METHODS

upload_report

This method will take the name of the uploaded file and the project it's being added, and various other details and process them. If everything is successful then the resulting Smolder::DB::SmokeReport object will be returned.

If the given file is compressed, it will be uncompressed before being processed. After all processing is done, the details file will also be compressed.

It takes the following named arguments

file

The full path to the uploaded file. This is required.

project

The Smolder::DB::Project object that this report is being associated with. This is required.

developer

The Smolder::DB::Developer who is uploading this file. If none is given, then the anonymous guest account will be used. This is optional.

architecture

The architecture this test was run on. This is optional.

platform

The platform this test was run on. This is optional.

comments

Any comments associated with this report. This is optional.

update_all_report_html

Look at all existing reports in the database and regenerate the HTML for each of these reports. This is useful for development and also upgrading when the report HTML template files have changed and you want that change to propagate.