Bugzilla – Attachment 169474 Details for
Bug 37448
Add build_sample_ill_request to TestBuilder.pm
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37448 - Add script to allow developers to quickly generate large amounts of data for development and testing
Bug-37448---Add-script-to-allow-developers-to-quic.patch (text/plain), 2.96 KB, created by
Kyle M Hall (khall)
on 2024-07-24 12:55:24 UTC
(
hide
)
Description:
Bug 37448 - Add script to allow developers to quickly generate large amounts of data for development and testing
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2024-07-24 12:55:24 UTC
Size:
2.96 KB
patch
obsolete
>From d995be0e7bc92dcb46c3008625acd61facec54ad Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Wed, 24 Jul 2024 08:16:19 -0400 >Subject: [PATCH] Bug 37448 - Add script to allow developers to quickly > generate large amounts of data for development and testing > >Test Plan: >1) Apply this patch >2) Run: misc/devel/create_test_data.pl -n 99 -s Borrower -d surname=Hall -d zipcode=111111 >3) Search patrons' for the name "Hall" >4) Note there are 99 Hall's in your results! > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > misc/devel/create_test_data.pl | 87 ++++++++++++++++++++++++++++++++++ > 1 file changed, 87 insertions(+) > create mode 100755 misc/devel/create_test_data.pl > >diff --git a/misc/devel/create_test_data.pl b/misc/devel/create_test_data.pl >new file mode 100755 >index 00000000000..61ccbed0b42 >--- /dev/null >+++ b/misc/devel/create_test_data.pl >@@ -0,0 +1,87 @@ >+#!/usr/bin/perl >+ >+# This file is part of Koha. >+# >+# Copyright (C) 2012 ByWater Solutions >+# Copyright (C) 2013 Equinox Software, Inc. >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ >+use Modern::Perl; >+ >+use Getopt::Long qw( GetOptions ); >+use Pod::Usage qw( pod2usage ); >+ >+use t::lib::TestBuilder; >+my $builder = t::lib::TestBuilder->new; >+ >+my $source; >+my $values; >+my $number; >+my $help; >+my $verbose; >+ >+GetOptions( >+ "s|source=s" => \$source, >+ "d|data=s%" => \$values, >+ "n|number=i" => \$number, >+ "h|help" => \$help, >+ "v|verbose" => \$verbose, >+); >+ >+# If we were asked for usage instructions, do it >+pod2usage(1) if $help || !$number || !$source; >+ >+for ( 1 .. $number ) { >+ $builder->build( >+ { >+ source => $source, >+ value => $values, >+ } >+ ); >+} >+ >+=head1 NAME >+ >+misc/devel/create_test_data.pl >+ >+=head1 SYNOPSIS >+ >+ create_test_data.pl -n 99 -s ObjectName [ -d foreignkey=somevalue ] >+ >+This script allows for quickly generated large numbers of test data for development purposes. >+ >+=head1 OPTIONS >+ >+=over 8 >+ >+=item B<-s|--source> <source> >+ >+The DBIx::Class ResultSet source to use ( e.g. Branch, Category, EdifactMessage, etc. ) >+ >+=item B<-d|--data> <valumn>=<value> >+ >+Repeatable, set a given column to the specificed value for all generated data. >+ >+create_test_data.pl -n 5 -s Issue -d borrowernumber=42 -d -d branchcode=MPL >+ >+=item B<-n|--number> <number> >+ >+The number of rows to create >+ >+=item B<-h|--help> >+ >+prints this help text >+ >+=back >-- >2.30.2
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 37448
:
169472
|
169474
|
169486
|
169487
|
169488
|
169489
|
169490
|
169550
|
169551
|
169552
|
169553
|
174526
|
174528
|
174834
|
174835