Bug 18448 - Fix a few db_dependent tests
Summary: Fix a few db_dependent tests
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Marcel de Rooy
QA Contact: Galen Charlton
URL:
Keywords:
Depends on: 18420
Blocks: 18766
  Show dependency treegraph
 
Reported: 2017-04-18 15:02 UTC by Marcel de Rooy
Modified: 2018-06-04 20:10 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 18448: Fix a few db_dependent tests (15.15 KB, patch)
2017-04-19 14:00 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 18448: Fix a few db_dependent tests (15.05 KB, patch)
2017-04-19 14:00 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 18448: Fix a few db_dependent tests (15.05 KB, patch)
2017-04-19 15:24 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 18448: Fix a few db_dependent tests (15.18 KB, patch)
2017-04-19 15:56 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 18448: Fix a few db_dependent tests (15.26 KB, patch)
2017-04-19 19:34 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel de Rooy 2017-04-18 15:02:08 UTC

    
Comment 1 Marcel de Rooy 2017-04-19 14:00:03 UTC Comment hidden (obsolete)
Comment 2 Marcel de Rooy 2017-04-19 14:00:27 UTC
Created attachment 62368 [details] [review]
Bug 18448: Fix a few db_dependent tests

Tests in db_dependent may expect a Koha database, but should not rely on
hardcoded categories, currencies, branch codes, etc.

This patch fixes a bunch of those. But this is a continuous project. We also
need QA to closely watch new edits.

Accounts.t: hardcoded category PT replaced
Acquisition/OrderFromSubscription.t: hardcoded USD
Acquisition/StandingOrders.t: same
ArticleRequests.t: create itemtype, branch and category for testing
AuthorisedValues.t: remove $dbh, add two test branches
AuthoritiesMarc.t: add hardcoded GEOGR_NAME authtype
Bookseller.t: add test currency
Koha.t: add test itemtype instead of hardcoded BK
UsageStats.t: add test branch and category

Test plan:
Run the adjusted tests.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 3 Marc Véron 2017-04-19 14:41:47 UTC
Sorry, I get a merge conflict with t/db_dependent/Koha.t
Comment 4 Marcel de Rooy 2017-04-19 14:46:59 UTC
(In reply to Marc Véron from comment #3)
> Sorry, I get a merge conflict with t/db_dependent/Koha.t

Dependency?
Or could you copy/paste the conflict?
Comment 5 Marc Véron 2017-04-19 15:10:10 UTC
Switched to an other vm with a new install, git pull to make sure to be on the newest master (is: 16.12.00.024), HEAD is 8e5c9ba Bug 17835: (followup) Make TestBuilder skip views, git bz apply 18448, result:

Wende an: Bug 18448: Fix a few db_dependent tests
Verwende Informationen aus der Staging-Area, um einen Basisverzeichnis nachzustellen
M	t/db_dependent/Koha.t
Falle zurück zum Patchen der Basis und des 3-Wege-Merges...
automatischer Merge von t/db_dependent/Koha.t
KONFLIKT (Inhalt): Merge-Konflikt in t/db_dependent/Koha.t
Merge der Änderungen fehlgeschlagen
Anwendung des Patches fehlgeschlagen bei 0001 Bug 18448: Fix a few db_dependent tests
Comment 6 Marc Véron 2017-04-19 15:15:17 UTC
Forgot to mention dependencies: I tried on top of 18420
Comment 7 Marcel de Rooy 2017-04-19 15:24:34 UTC
Created attachment 62392 [details] [review]
Bug 18448: Fix a few db_dependent tests

Tests in db_dependent may expect a Koha database, but should not rely on
hardcoded categories, currencies, branch codes, etc.

This patch fixes a bunch of those. But this is a continuous project. We also
need QA to closely watch new edits.

Accounts.t: hardcoded category PT replaced
Acquisition/OrderFromSubscription.t: hardcoded USD
Acquisition/StandingOrders.t: same
ArticleRequests.t: create itemtype, branch and category for testing
AuthorisedValues.t: remove $dbh, add two test branches
AuthoritiesMarc.t: add hardcoded GEOGR_NAME authtype
Bookseller.t: add test currency
Koha.t: add test itemtype instead of hardcoded BK
UsageStats.t: add test branch and category

Test plan:
Run the adjusted tests.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 8 Marcel de Rooy 2017-04-19 15:25:05 UTC
(In reply to Marc Véron from comment #5)
> Switched to an other vm with a new install, git pull to make sure to be on
> the newest master (is: 16.12.00.024), HEAD is 8e5c9ba Bug 17835: (followup)
> Make TestBuilder skip views, git bz apply 18448, result:
> 
> Wende an: Bug 18448: Fix a few db_dependent tests
> Verwende Informationen aus der Staging-Area, um einen Basisverzeichnis
> nachzustellen
> M	t/db_dependent/Koha.t
> Falle zurück zum Patchen der Basis und des 3-Wege-Merges...
> automatischer Merge von t/db_dependent/Koha.t
> KONFLIKT (Inhalt): Merge-Konflikt in t/db_dependent/Koha.t
> Merge der Änderungen fehlgeschlagen
> Anwendung des Patches fehlgeschlagen bei 0001 Bug 18448: Fix a few
> db_dependent tests

Should be resolved now. Rebased on top of the itemtype changes.
Comment 9 Marc Véron 2017-04-19 15:53:53 UTC
Testing immediately after minimal install, Marc21, mandatory data only installed

prove -v t/db_dependent/Accounts.t
OK
t/db_dependent/Acquisition/OrderFromSubscription.t
OK
prove -v t/db_dependent/Acquisition/StandingOrders.t
OK
prove -v t/db_dependent/ArticleRequests.t
OK
prove -v t/db_dependent/AuthorisedValues.t
OK
prove -v t/db_dependent/AuthoritiesMarc.t
OK
prove -v t/db_dependent/Bookseller.t
OK
prove -v t/db_dependent/Koha.t
OK
prove -v t/db_dependent/UsageStats.t
OK
Comment 10 Marc Véron 2017-04-19 15:56:41 UTC
Created attachment 62398 [details] [review]
Bug 18448: Fix a few db_dependent tests

Tests in db_dependent may expect a Koha database, but should not rely on
hardcoded categories, currencies, branch codes, etc.

This patch fixes a bunch of those. But this is a continuous project. We also
need QA to closely watch new edits.

Accounts.t: hardcoded category PT replaced
Acquisition/OrderFromSubscription.t: hardcoded USD
Acquisition/StandingOrders.t: same
ArticleRequests.t: create itemtype, branch and category for testing
AuthorisedValues.t: remove $dbh, add two test branches
AuthoritiesMarc.t: add hardcoded GEOGR_NAME authtype
Bookseller.t: add test currency
Koha.t: add test itemtype instead of hardcoded BK
UsageStats.t: add test branch and category

Test plan:
Run the adjusted tests.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

All tests successful (see comment #9)
Signed-off-by: Marc Véron <veron@veron.ch>
Comment 11 Jonathan Druart 2017-04-19 19:34:29 UTC
Created attachment 62418 [details] [review]
Bug 18448: Fix a few db_dependent tests

Tests in db_dependent may expect a Koha database, but should not rely on
hardcoded categories, currencies, branch codes, etc.

This patch fixes a bunch of those. But this is a continuous project. We also
need QA to closely watch new edits.

Accounts.t: hardcoded category PT replaced
Acquisition/OrderFromSubscription.t: hardcoded USD
Acquisition/StandingOrders.t: same
ArticleRequests.t: create itemtype, branch and category for testing
AuthorisedValues.t: remove $dbh, add two test branches
AuthoritiesMarc.t: add hardcoded GEOGR_NAME authtype
Bookseller.t: add test currency
Koha.t: add test itemtype instead of hardcoded BK
UsageStats.t: add test branch and category

Test plan:
Run the adjusted tests.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

All tests successful (see comment #9)
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 12 Marcel de Rooy 2017-04-20 06:28:40 UTC
Thanks Marc and Jonathan!
Comment 13 Kyle M Hall (khall) 2017-04-21 18:10:46 UTC
Pushed to master for 17.05, thanks Marcel!
Comment 14 Katrin Fischer 2017-04-21 23:17:51 UTC
Blocked by dependency...
Comment 15 Katrin Fischer 2017-07-16 12:09:06 UTC
Dependency still doesn't apply to 16.11.x. Closing.