[open-ils-commits] [GIT] Evergreen ILS branch master updated. 7e8eec68388a661c68970622bccc07711b80fe47
Evergreen Git
git at git.evergreen-ils.org
Thu Aug 1 11:35:44 EDT 2013
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".
The branch, master has been updated
via 7e8eec68388a661c68970622bccc07711b80fe47 (commit)
via bd4d76518cd3ce3476d5ea39bd584aaba2a8b69e (commit)
via 97983b6660718a9420ba245a13945efe064c03ce (commit)
via bb98f3fd2887468ada6b3cee7cdccd05b809c545 (commit)
via c36c86e4bf1e8be3a613a267e7462ff3c080c45d (commit)
from 33b6b485aff2b89312b9f6c3cb7f39e4857e2551 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 7e8eec68388a661c68970622bccc07711b80fe47
Author: Jason Etheridge <jason at esilibrary.com>
Date: Mon Jun 24 16:07:44 2013 -0400
Use the .pg extension
Signed-off-by: Jason Etheridge <jason at esilibrary.com>
Signed-off-by: Mike Rylander <mrylander at gmail.com>
diff --git a/Open-ILS/src/sql/Pg/t/0799.state_field_required_toggle.s b/Open-ILS/src/sql/Pg/t/0799.state_field_required_toggle.pg
similarity index 100%
rename from Open-ILS/src/sql/Pg/t/0799.state_field_required_toggle.s
rename to Open-ILS/src/sql/Pg/t/0799.state_field_required_toggle.pg
diff --git a/Open-ILS/src/sql/Pg/t/dewey.s b/Open-ILS/src/sql/Pg/t/dewey.pg
similarity index 100%
rename from Open-ILS/src/sql/Pg/t/dewey.s
rename to Open-ILS/src/sql/Pg/t/dewey.pg
diff --git a/Open-ILS/src/sql/Pg/t/schema.s b/Open-ILS/src/sql/Pg/t/schema.pg
similarity index 100%
rename from Open-ILS/src/sql/Pg/t/schema.s
rename to Open-ILS/src/sql/Pg/t/schema.pg
diff --git a/Open-ILS/src/sql/Pg/t/versions.s b/Open-ILS/src/sql/Pg/t/versions.pg
similarity index 100%
rename from Open-ILS/src/sql/Pg/t/versions.s
rename to Open-ILS/src/sql/Pg/t/versions.pg
commit bd4d76518cd3ce3476d5ea39bd584aaba2a8b69e
Author: Galen Charlton <gmc at esilibrary.com>
Date: Fri Apr 12 02:41:47 2013 -0400
add regression test for LP#1155329
Signed-off-by: Galen Charlton <gmc at esilibrary.com>
Signed-off-by: Mike Rylander <mrylander at gmail.com>
diff --git a/Open-ILS/src/sql/Pg/t/regress/lp1155329_use_id_for_tcn.pg b/Open-ILS/src/sql/Pg/t/regress/lp1155329_use_id_for_tcn.pg
new file mode 100644
index 0000000..fd55e09
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/t/regress/lp1155329_use_id_for_tcn.pg
@@ -0,0 +1,22 @@
+BEGIN;
+
+SELECT plan(2);
+
+UPDATE config.internal_flag SET enabled = FALSE WHERE name = 'cat.bib.use_id_for_tcn';
+INSERT INTO biblio.record_entry (marc, last_xact_id)
+VALUES ('<record xmlns="http://www.loc.gov/MARC21/slim"/>', 'test');
+
+SELECT matches((SELECT tcn_value FROM biblio.record_entry
+ WHERE id = CURRVAL('biblio.record_entry_id_seq')),
+ '^AUTOGENERATED-',
+ 'TCN is autogenerated when cat.bib.use_id_for_tcn is disabled');
+
+UPDATE config.internal_flag SET enabled = TRUE WHERE name = 'cat.bib.use_id_for_tcn';
+INSERT INTO biblio.record_entry (marc, last_xact_id)
+VALUES ('<record xmlns="http://www.loc.gov/MARC21/slim"/>', 'test');
+SELECT is((SELECT tcn_value FROM biblio.record_entry
+ WHERE id = CURRVAL('biblio.record_entry_id_seq')),
+ (SELECT CURRVAL('biblio.record_entry_id_seq')::TEXT),
+ 'TCN equals BRE ID when cat.bib.use_id_for_tcn is enabled');
+
+ROLLBACK;
commit 97983b6660718a9420ba245a13945efe064c03ce
Author: Galen Charlton <gmc at esilibrary.com>
Date: Fri Apr 12 02:21:09 2013 -0400
use .pg extension for pgTAP test cases
That way, pg_prove --recurse t/ will DWIM.
Signed-off-by: Galen Charlton <gmc at esilibrary.com>
Signed-off-by: Mike Rylander <mrylander at gmail.com>
diff --git a/Open-ILS/src/sql/Pg/t/naco_normalize.sql b/Open-ILS/src/sql/Pg/t/naco_normalize.pg
similarity index 100%
rename from Open-ILS/src/sql/Pg/t/naco_normalize.sql
rename to Open-ILS/src/sql/Pg/t/naco_normalize.pg
commit bb98f3fd2887468ada6b3cee7cdccd05b809c545
Author: Galen Charlton <gmc at esilibrary.com>
Date: Wed Apr 10 20:18:10 2013 -0400
start adding pgTAP test cases
pgTAP is a PostgreSQL unit testing framework; about which
more can be found at http://pgtap.org/
This commit introduces the first pgTAP test case, which exercises
the NACO normalization functions.
To run the tests, install pgTAP, create an Evergreen database that
contains (for now) just the seed data, and from the top of the
source tree run
pg_prove -vr -U evergreen Open-ILS/src/sql/Pg/t/*
Replace '-U evergreen' with the psql command-line switches
needed to access your database.
To install pgTAP on a Debian Wheezy system, you can do:
Then, to load the pgTAP extension into the database, run
psql> CREATE EXTENSION pgtap;
Signed-off-by: Galen Charlton <gmc at esilibrary.com>
Signed-off-by: Mike Rylander <mrylander at gmail.com>
diff --git a/Open-ILS/src/sql/Pg/t/naco_normalize.sql b/Open-ILS/src/sql/Pg/t/naco_normalize.sql
new file mode 100644
index 0000000..0e59107
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/t/naco_normalize.sql
@@ -0,0 +1,44 @@
+BEGIN;
+
+SELECT plan(25);
+
+CREATE FUNCTION nfkd(TEXT) RETURNS TEXT AS $$
+ use strict;
+ use warnings;
+ use Unicode::Normalize;
+ my $str = shift;
+ return NFKD($str);
+$$ LANGUAGE PLPERLU STABLE;
+
+SELECT is( public.naco_normalize('abc'), 'abc', 'regular text' );
+SELECT is( public.naco_normalize('ABC'), 'abc', 'regular text' );
+SELECT is( public.naco_normalize('åbçdéñœöîøæÇıÂÅÍÎÏÔÔÒÚÆŒè'), 'abcdenoeoioaeciaaiiiooouaeoee', 'European diacritics' );
+SELECT is( public.naco_normalize('“‘„«quotes»’”'), 'quotes', 'special quotes' );
+SELECT is( public.naco_normalize('abc def'), 'def', 'special non-filing characters designation' );
+SELECT is( public.naco_normalize('abcdef'), 'abcdef', 'unpaired start of string' );
+SELECT is( public.naco_normalize('ß'), 'ss', 'sharp S (eszett)' );
+SELECT is( public.naco_normalize('flfiff'), 'flfiff', 'ligatures' );
+SELECT is( public.naco_normalize('ƠơƯư²IJij'), 'oouu2ijij', 'NFKD applied correctly' );
+SELECT is( public.naco_normalize('ÆØÞæðøþĐđıŁłŒœʻʼℓ'), 'aeothaedothddilloeoel', 'part 3.6' );
+SELECT is( public.naco_normalize('Ð'), 'd', 'uppercase eth (missing from 3.6?)' );
+SELECT is( public.naco_normalize('ıİ'), 'ii', 'Turkish I' );
+SELECT is( public.naco_normalize('[book''s cover]'), 'books cover', 'square brackets and apostrophe' );
+SELECT is( public.naco_normalize(' grue food '), 'grue food', 'trim spaces' );
+-- note addition of nfkd() to transform expected output
+SELECT is( public.naco_normalize('한국어 조선말'), nfkd('한국어 조선말'), 'Korean text' );
+SELECT is( public.naco_normalize('普通話 / 普通话'), '普通話 普通话', 'Chinese text' );
+SELECT is( public.naco_normalize('العربية'), 'العربية', 'Arabic text' );
+SELECT is( public.naco_normalize('ქართული ენა'), 'ქართული ენა', 'Georgian text' );
+SELECT is( public.naco_normalize('русский язык'), 'русскии язык', 'Russian text' );
+SELECT is( public.naco_normalize(E'\r\npa\tper\f'), 'paper', 'other whitespace' );
+SELECT is( public.naco_normalize('#1: ∃ C++, @ home & abroad'), '#1 c++ @ home & abroad', 'other punctuation' );
+SELECT is( public.naco_normalize('٠١٢٣٤٥'), '012345', 'other decimal digits' );
+SELECT is( public.naco_normalize('²³¹'), '231', 'superscript numbers' );
+SELECT is( public.naco_normalize('♭©®♯'), '♭ ♯', 'other symbols' );
+
+SELECT is( public.naco_normalize('Smith, Jane. Poet, painter, and author', 'a'), 'smith, jane poet painter and author',
+ 'retain first comma' );
+
+SELECT * FROM finish();
+
+ROLLBACK;
commit c36c86e4bf1e8be3a613a267e7462ff3c080c45d
Author: Jason Etheridge <jason at esilibrary.com>
Date: Mon Jun 24 15:36:10 2013 -0400
pgTAP examples
These specific ones do not assume stock test data such as the concerto bibs, and
I think such tests should go elsewhere. You need to install pgTAP. I did the
following for my test environment:
git clone git://github.com/theory/pgtap.git
cd pgtap
make
make installcheck
sudo make install
Then in my Evergreen database with psql, I did:
CREATE EXTENSION pgtap;
I also installed a CPAN module to get pg_prove:
sudo cpan TAP::Parser::SourceHandler::pgTAP
You can use psql to run a given test like so:
opensrf at dev141:~/git/Evergreen/Open-ILS/src/sql/Pg/t (pgtap)$ psql -d evergreen -f 0799.state_field_required_toggle.s
1..4
ok 1 - actor.usr_address.state does not have the NOT NULL constraint
ok 2 - ui.patron.edit.au.state.require exists
ok 3 - ui.patron.edit.au.state.show exists
ok 4 - ui.patron.edit.au.state.suggest exists
Or you can use pg_prove on all or some of them:
opensrf at dev141:~/git/Evergreen/Open-ILS/src/sql/Pg/t (pgtap)$ pg_prove -d evergreen *.s
0799.state_field_required_toggle.s .. ok
dewey.s ............................. 1/6
# Failed (TODO) test 6: "testing prefix plus decimal"
# 'YR_DVD_800_100000000000000'
# <
# 'YR_000000000000000_DVD_900'
dewey.s ............................. ok
schema.s ............................ ok
versions.s .......................... ok
All tests successful.
Files=4, Tests=39, 0 wallclock secs ( 0.05 usr 0.03 sys + 0.13 cusr 0.07 csys = 0.28 CPU)
Result: PASS
Signed-off-by: Jason Etheridge <jason at esilibrary.com>
Signed-off-by: Mike Rylander <mrylander at gmail.com>
diff --git a/Open-ILS/src/sql/Pg/t/0799.state_field_required_toggle.s b/Open-ILS/src/sql/Pg/t/0799.state_field_required_toggle.s
new file mode 100644
index 0000000..8855937
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/t/0799.state_field_required_toggle.s
@@ -0,0 +1,47 @@
+\set ECHO
+\set QUIET 1
+-- Turn off echo and keep things quiet.
+
+-- Format the output for nice TAP.
+\pset format unaligned
+\pset tuples_only true
+\pset pager
+
+-- Revert all changes on failure.
+\set ON_ERROR_ROLLBACK 1
+\set ON_ERROR_STOP true
+\set QUIET 1
+
+-- Load the TAP functions.
+BEGIN;
+
+-- Plan the tests.
+SELECT plan(4);
+
+-- Run the tests.
+
+SELECT col_is_null(
+ 'actor',
+ 'usr_address',
+ 'state',
+ 'actor.usr_address.state does not have the NOT NULL constraint'
+);
+
+SELECT isnt_empty(
+ 'SELECT * FROM config.org_unit_setting_type WHERE name = $$ui.patron.edit.au.state.require$$',
+ 'ui.patron.edit.au.state.require exists'
+);
+
+SELECT isnt_empty(
+ 'SELECT * FROM config.org_unit_setting_type WHERE name = $$ui.patron.edit.au.state.show$$',
+ 'ui.patron.edit.au.state.show exists'
+);
+
+SELECT isnt_empty(
+ 'SELECT * FROM config.org_unit_setting_type WHERE name = $$ui.patron.edit.au.state.suggest$$',
+ 'ui.patron.edit.au.state.suggest exists'
+);
+
+-- Finish the tests and clean up.
+SELECT * FROM finish();
+ROLLBACK;
diff --git a/Open-ILS/src/sql/Pg/t/README b/Open-ILS/src/sql/Pg/t/README
new file mode 100644
index 0000000..e40a652
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/t/README
@@ -0,0 +1 @@
+For the tests we put here, let's not assume the stock test data is loaded.
diff --git a/Open-ILS/src/sql/Pg/t/dewey.s b/Open-ILS/src/sql/Pg/t/dewey.s
new file mode 100644
index 0000000..50f42ba
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/t/dewey.s
@@ -0,0 +1,67 @@
+\set ECHO
+\set QUIET 1
+-- Turn off echo and keep things quiet.
+
+-- Format the output for nice TAP.
+\pset format unaligned
+\pset tuples_only true
+\pset pager
+
+-- Revert all changes on failure.
+\set ON_ERROR_ROLLBACK 1
+\set ON_ERROR_STOP true
+\set QUIET 1
+
+-- Load the TAP functions.
+BEGIN;
+
+-- Plan the tests.
+SELECT plan(6);
+
+-- Run the tests. Converted from Koha's ClassSortRoutine_Dewey.t
+
+SELECT is(
+ asset.label_normalizer_dewey(NULL),
+ '',
+ 'testing whitespace'
+);
+
+SELECT is(
+ asset.label_normalizer_dewey('.... .....'),
+ '',
+ 'testing fullstops'
+);
+
+-- I think these tests below may be looking too deeply into the implementation,
+-- but including them for now
+
+SELECT is(
+ asset.label_normalizer_dewey('123 456'),
+ '123_456000000000000',
+ 'testing numbers'
+);
+
+SELECT is(
+ asset.label_normalizer_dewey('abc123 456'),
+ 'ABC_123_456000000000000',
+ 'testing alphanumeric'
+);
+
+SELECT is(
+ asset.label_normalizer_dewey('ab c123 45 6'),
+ 'AB_C123_45_600000000000000',
+ 'testing middle whitespace'
+);
+
+SELECT todo('Desired behavior in contention. See https://bugs.launchpad.net/evergreen/+bug/1150939', 1);
+
+SELECT cmp_ok(
+ asset.label_normalizer_dewey('YR DVD 800.1'),
+ '<',
+ asset.label_normalizer_dewey('YR DVD 900'),
+ 'testing prefix plus decimal'
+);
+
+-- Finish the tests and clean up.
+SELECT * FROM finish();
+ROLLBACK;
diff --git a/Open-ILS/src/sql/Pg/t/schema.s b/Open-ILS/src/sql/Pg/t/schema.s
new file mode 100644
index 0000000..7d4feca
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/t/schema.s
@@ -0,0 +1,52 @@
+\set ECHO
+\set QUIET 1
+-- Turn off echo and keep things quiet.
+
+-- Format the output for nice TAP.
+\pset format unaligned
+\pset tuples_only true
+\pset pager
+
+-- Revert all changes on failure.
+\set ON_ERROR_ROLLBACK 1
+\set ON_ERROR_STOP true
+\set QUIET 1
+
+-- Load the TAP functions.
+BEGIN;
+
+-- Plan the tests.
+SELECT plan(27);
+
+-- Run the tests.
+SELECT has_schema('action','Has action schema');
+SELECT has_schema('action_trigger','Has action_trigger schema');
+SELECT has_schema('actor','Has actor schema');
+SELECT has_schema('acq','Has acq schema');
+SELECT has_schema('asset','Has actor schema');
+SELECT has_schema('auditor','Has auditor schema');
+SELECT has_schema('authority','Has authority schema');
+SELECT has_schema('biblio','Has biblio schema');
+SELECT has_schema('booking','Has booking schema');
+SELECT has_schema('config','Has config schema');
+SELECT has_schema('container','Has container schema');
+SELECT has_schema('evergreen','Has evergreen schema');
+SELECT has_schema('extend_reporter','Has extend_reporter schema');
+SELECT has_schema('metabib','Has metabib schema');
+SELECT has_schema('money','Has money schema');
+SELECT has_schema('offline','Has offline schema');
+SELECT has_schema('permission','Has permission schema');
+SELECT has_schema('public','Has public schema');
+SELECT has_schema('query','Has query schema');
+SELECT has_schema('reporter','Has reporter schema');
+SELECT has_schema('search','Has search schema');
+SELECT has_schema('serial','Has serial schema');
+SELECT has_schema('staging','Has staging schema');
+SELECT has_schema('stats','Has stats schema');
+SELECT has_schema('url_verify','Has url_verify schema');
+SELECT has_schema('vandelay','Has vandelay schema');
+SELECT has_schema('unapi','Has unapi schema');
+
+-- Finish the tests and clean up.
+SELECT * FROM finish();
+ROLLBACK;
diff --git a/Open-ILS/src/sql/Pg/t/versions.s b/Open-ILS/src/sql/Pg/t/versions.s
new file mode 100644
index 0000000..b611cbc
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/t/versions.s
@@ -0,0 +1,35 @@
+\set ECHO
+\set QUIET 1
+-- Turn off echo and keep things quiet.
+
+-- Format the output for nice TAP.
+\pset format unaligned
+\pset tuples_only true
+\pset pager
+
+-- Revert all changes on failure.
+\set ON_ERROR_ROLLBACK 1
+\set ON_ERROR_STOP true
+\set QUIET 1
+
+-- Load the TAP functions.
+BEGIN;
+
+-- Plan the tests.
+SELECT plan(2);
+
+-- Run the tests.
+
+SELECT CASE WHEN pg_version_num() >= 90000
+ THEN pass('Running PostgreSQL 9+')
+ ELSE fail('Not running PostgreSQL 9+')
+END;
+
+SELECT isnt_empty(
+ 'SELECT COUNT(*) FROM config.upgrade_log',
+ 'Have rows in config.upgrade_log'
+);
+
+-- Finish the tests and clean up.
+SELECT * FROM finish();
+ROLLBACK;
-----------------------------------------------------------------------
Summary of changes:
.../sql/Pg/t/0799.state_field_required_toggle.pg | 47 ++++++++++++++
Open-ILS/src/sql/Pg/t/README | 1 +
Open-ILS/src/sql/Pg/t/dewey.pg | 67 ++++++++++++++++++++
Open-ILS/src/sql/Pg/t/naco_normalize.pg | 44 +++++++++++++
.../sql/Pg/t/regress/lp1155329_use_id_for_tcn.pg | 22 +++++++
Open-ILS/src/sql/Pg/t/schema.pg | 52 +++++++++++++++
Open-ILS/src/sql/Pg/t/versions.pg | 35 ++++++++++
7 files changed, 268 insertions(+), 0 deletions(-)
create mode 100644 Open-ILS/src/sql/Pg/t/0799.state_field_required_toggle.pg
create mode 100644 Open-ILS/src/sql/Pg/t/README
create mode 100644 Open-ILS/src/sql/Pg/t/dewey.pg
create mode 100644 Open-ILS/src/sql/Pg/t/naco_normalize.pg
create mode 100644 Open-ILS/src/sql/Pg/t/regress/lp1155329_use_id_for_tcn.pg
create mode 100644 Open-ILS/src/sql/Pg/t/schema.pg
create mode 100644 Open-ILS/src/sql/Pg/t/versions.pg
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list