Bugzilla – Attachment 144229 Details for
Bug 32350
We should die if TestBuilder is passed a column we're not expecting
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32350: Die on unrecognised column passed to testbuilder
Bug-32350-Die-on-unrecognised-column-passed-to-tes.patch (text/plain), 1.13 KB, created by
Martin Renvoize (ashimema)
on 2022-11-25 08:20:53 UTC
(
hide
)
Description:
Bug 32350: Die on unrecognised column passed to testbuilder
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-11-25 08:20:53 UTC
Size:
1.13 KB
patch
obsolete
>From bf467b9b5d192a8389849ef1a71bcefb603dba38 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 25 Nov 2022 08:19:09 +0000 >Subject: [PATCH] Bug 32350: Die on unrecognised column passed to testbuilder > >This should prevent mis-matches between tests and database fields in the >future and reduce our chances of hitting random test failures. > >However, it may have a performance impact on the test suite. >--- > t/lib/TestBuilder.pm | 5 +++++ > 1 file changed, 5 insertions(+) > >diff --git a/t/lib/TestBuilder.pm b/t/lib/TestBuilder.pm >index d065835ded..4e512e83fc 100644 >--- a/t/lib/TestBuilder.pm >+++ b/t/lib/TestBuilder.pm >@@ -280,6 +280,11 @@ sub _buildColumnValues { > my @columns = $self->schema->source($source)->columns; > my %unique_constraints = $self->schema->source($source)->unique_constraints(); > >+ for my $key ( keys %{$original_value} ) { >+ die "value passed for unrecognised column: $key" >+ if !( any { $key eq $_ } @columns ); >+ } >+ > my $build_value = 5; > # we try max $build_value times if there are unique constraints > BUILD_VALUE: while ( $build_value ) { >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 32350
:
144229
|
144230
|
144233
|
144234
|
144235
|
144239
|
144245
|
144246
|
144247
|
144248
|
144276
|
144277
|
144349
|
144350