Upped copyright to 2012
[Test-Smoke-Metabase.git] / lib / Test / Smoke / Metabase.pm
blob2a21a1d62d855e0f7ab16a559e98b125c0aed8ac
1 package Test::Smoke::Metabase;
3 use strict;
4 use warnings;
6 our $VERSION = "0.23";
8 use base "Metabase::Report";
9 __PACKAGE__->load_fact_classes;
11 use Carp;
12 use Test::Smoke::Metabase::Transport;
14 sub report_spec
16 return {
17 "Test::Smoke::Fact::SmokeID" => 1,
18 "Test::Smoke::Fact::Node" => 1,
19 "Test::Smoke::Fact::Build" => 1,
20 "Test::Smoke::Fact::Config" => 1,
21 "Test::Smoke::Fact::Result" => "0+",
23 } # report_spec
25 sub send
27 my ($self, $dest) = @_;
29 ref $dest eq "HASH" && exists $dest->{uri} && exists $dest->{id_file} or
30 croak ("usage: \$report->send ({ uri => '...', id_file => '...')");
32 my $transport = Test::Smoke::Metabase::Transport->new (
33 uri => $dest->{uri},
34 id_file => $dest->{id_file},
36 $transport->send ($self);
37 } # send
41 __END__
43 =head1 NAME
45 Test::Smoke::Metabase - Test::Smoke Metabase interface object
47 =head1 SYNOPSIS
49 my $report = Test::Smoke::Metabase->open (
50 resource => "perl:///commit/8c57606294f48eb065dff03f7ffefc1e4e2cdce4",
53 $report->add ("Test::Smoke::Fact::SmokeID" => {
54 smoke_date => "2011-04-17 13:41:14 +01",
55 git_id => "1f656fcf060e343780f7a91a2ce567e8a9de9414",
56 perl_id => "5.14.0",
57 git_describe => "5.13.11-452-g1f656fc",
58 applied_patches => "-",
59 });
61 $report->add ("Test::Smoke::Fact::Node" => {
62 hostname => "smokebox",
63 architecture => "ia64",
64 osname => "HP-UX",
65 osversion => "B.11.31/64",
66 cpu_count => 2,
67 cpu_description => "Itanium 2 9100/1710",
68 cc => "cc",
69 ccversion => "B3910B",
70 user => "tux",
71 });
73 $report->add ("Test::Smoke::Fact::Build" => {
74 TEST_JOBS => $ENV{TEST_JOBS},
75 LC_ALL => $ENV{LC_ALL},
76 LANG => $ENV{LANG},
77 manifest_msgs => "...",
78 compiler_msgs => "...",
79 skipped_tests => "-",
80 harness_only => 0,
81 summary => "F",
82 });
84 $report->add ("Test::Smoke::Fact::Config" => {
85 arguments => "-Duse64bitall -DDEBUGGING",
86 parallel => 1,
87 debugging => 1,
88 });
90 $report->add ("Test::Smoke::Fact::Result" => {
91 io_env => "perlio",
92 output => "...",
93 summary => "F",
94 statistics => "Files=1802, Tests=349808, 228 wallcl...",
95 });
97 $report->close ();
99 $report->send ({
100 uri => "http://metabase.example.com:3000/",
101 id_file => "/home/tux/smoke/metabase_id.json",
104 =head1 DESCRIPTION
106 Metabase report class encapsulating Facts about a Test::Smoke report
108 This describes the interface of sending Test::Smoke reports to the
109 CPANTESTERS-2.0 infrastructure. This interface describes what facts
110 are stored and how they relate to a complete report.
112 =head2 SmokeID
114 This fact identify what is smoked. Together with the C<Node> it
115 identifies what I<Fact>'s belong together in a complete L<Test::Smoke>
116 run. A more detailed description can be found in
117 L<Test::Smoke::Fact::SmokeID>.
119 =head2 Node
121 This fact identifies where the smoke is executed. Together with the
122 C<SmokeID> it identifies what I<Fact>'s belong together in a complete
123 L<Test::Smoke> run. A more detailed description can be found in
124 L<Test::Smoke::Fact::Node>.
126 =head2 Build
128 This fast describes how a L<Test::Smoke> is built, it holds the overall
129 information regarding how the smoke was started and generic information
130 about a single build attempt. A more detailed description can be found
131 in L<Test::Smoke::Fact::Build>.
133 =head2 Config
135 This fact describes the arguments that were used for this smoke build.
136 For each configuration smoked in a full smoke run, this describes the
137 configuration for the C<Result>'s (if available). A more detailed
138 description can be found in L<Test::Smoke::Fact::Config>.
140 Note that the C<parallel> attribute logically would fit better in the
141 C<Build> Fact, but that it is stored in C<Config> Fact for indexing
142 (and searching) purposes.
144 =head2 Result
146 These are the results for a finished test run. It will hold as much
147 information as possible. Up to three C<Result> Facts can be found
148 inside the Report. A more detailed description can be found in
149 L<Test::Smoke::Fact::Result>.
151 =begin nopod
153 =head2 report_spec
155 =end nopod
157 =head2 send
159 Will send the report using Test::Smoke::Metabase::Transport
161 =head1 SEE ALSO
163 L<Test::Smoke>, L<Test::Smoke::Fact::SmokeID>, L<Test::Smoke::Fact::Node>,
164 L<Test::Smoke::Fact::Build>, L<Test::Smoke::Fact::Config>,
165 L<Test::Smoke::Fact::Result>, L<Metabase::Report>, L<Metabase::Fact>.
167 =head1 AUTHOR
169 H.Merijn Brand
171 =head1 COPYRIGHT AND LICENSE
173 Copyright (c) 2010-2012 by H.Merijn Brand
175 This library is free software; you can redistribute it and/or modify it
176 under the same terms as Perl itself.
178 =cut