line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Tapper::Schema::TestrunDB::ResultSet::Precondition; |
2
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:TAPPER'; |
3
|
|
|
|
|
|
|
$Tapper::Schema::TestrunDB::ResultSet::Precondition::VERSION = '5.0.11'; |
4
|
7
|
|
|
7
|
|
15054
|
use strict; |
|
7
|
|
|
|
|
17
|
|
|
7
|
|
|
|
|
180
|
|
5
|
7
|
|
|
7
|
|
32
|
use warnings; |
|
7
|
|
|
|
|
12
|
|
|
7
|
|
|
|
|
170
|
|
6
|
|
|
|
|
|
|
|
7
|
7
|
|
|
7
|
|
33
|
use parent 'DBIx::Class::ResultSet'; |
|
7
|
|
|
|
|
13
|
|
|
7
|
|
|
|
|
32
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub add { |
11
|
0
|
|
|
0
|
1
|
|
my ($self, $preconditions) = @_; |
12
|
|
|
|
|
|
|
|
13
|
0
|
|
|
|
|
|
my @precond_list = @$preconditions; |
14
|
0
|
|
|
|
|
|
my @precond_ids; |
15
|
|
|
|
|
|
|
|
16
|
0
|
|
|
|
|
|
require YAML::Syck; |
17
|
0
|
|
|
|
|
|
foreach my $precond_data (@precond_list) { |
18
|
|
|
|
|
|
|
# (XXX) decide how to handle empty preconditions |
19
|
0
|
0
|
|
|
|
|
next if not (ref($precond_data) eq 'HASH'); |
20
|
0
|
|
0
|
|
|
|
my $shortname = $precond_data->{shortname} || ''; |
21
|
0
|
|
|
|
|
|
my $timeout = $precond_data->{timeout}; |
22
|
0
|
|
|
|
|
|
my $precondition = $self->result_source->schema->resultset('Precondition')->new |
23
|
|
|
|
|
|
|
({ |
24
|
|
|
|
|
|
|
shortname => $shortname, |
25
|
|
|
|
|
|
|
precondition => YAML::Syck::Dump($precond_data), |
26
|
|
|
|
|
|
|
timeout => $timeout, |
27
|
|
|
|
|
|
|
}); |
28
|
0
|
|
|
|
|
|
$precondition->insert; |
29
|
0
|
|
|
|
|
|
push @precond_ids, $precondition->id; |
30
|
|
|
|
|
|
|
} |
31
|
0
|
|
|
|
|
|
return @precond_ids; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
__END__ |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=pod |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=encoding UTF-8 |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 NAME |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
Tapper::Schema::TestrunDB::ResultSet::Precondition |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head2 add |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
Create (add) a list of preconditions and return them with their now |
49
|
|
|
|
|
|
|
associated db data (eg. ID). |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 AUTHORS |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=over 4 |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=item * |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
AMD OSRC Tapper Team <tapper@amd64.org> |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=item * |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
Tapper Team <tapper-ops@amazon.com> |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=back |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
This software is Copyright (c) 2019 by Advanced Micro Devices, Inc.. |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
This is free software, licensed under: |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
The (two-clause) FreeBSD License |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=cut |