Bug 12787 - Unit test files should be better organized
Summary: Unit test files should be better organized
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Jonathan Druart
QA Contact: Galen Charlton
URL:
Keywords:
Depends on: 15757
Blocks:
  Show dependency treegraph
 
Reported: 2014-08-19 15:34 UTC by Jonathan Druart
Modified: 2016-12-05 21:27 UTC (History)
5 users (show)

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


Attachments
Bug 12787: Reorganise t/db_dependent files (31.17 KB, patch)
2016-04-07 13:26 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 12787: Reorganise t/db_dependent files (31.23 KB, patch)
2016-04-07 15:59 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 12787: (QA followup) small QA fixes (1.33 KB, patch)
2016-04-07 16:00 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 12787: Reorganise t/db_dependent files (31.28 KB, patch)
2016-04-21 14:46 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 12787: Reorganise t/db_dependent files (31.28 KB, patch)
2016-04-21 14:47 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 12787: (QA followup) small QA fixes (1.38 KB, patch)
2016-04-21 14:47 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 12787 [QA Followup] - Retain change to Reports_Guided.t (1.12 KB, patch)
2016-04-21 14:47 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2014-08-19 15:34:59 UTC
The t/db_dependent directory contains directory and files like module_routinename.t
It should be better to have 1 way to name UT files.
Comment 1 Mark Tompsett 2015-05-08 19:51:33 UTC
I agree with this idea.

If it is in C4::Context...
and is not database dependent:
t/C4/Context/{function or method}.t

and is database dependent:
t/db_dependent/C4/Context/{function or method}.t

I know that would eventually mean splitting large tests up, but in the meantime we could use 00-default.t for the large test everything ones.

Thoughts?
Comment 2 Jonathan Druart 2016-04-07 13:26:02 UTC Comment hidden (obsolete)
Comment 3 Tomás Cohen Arazi 2016-04-07 15:59:41 UTC Comment hidden (obsolete)
Comment 4 Tomás Cohen Arazi 2016-04-07 16:00:25 UTC Comment hidden (obsolete)
Comment 5 Marcel de Rooy 2016-04-08 06:28:35 UTC
Applying: Bug 12787: Reorganise t/db_dependent files
fatal: sha1 information is lacking or useless (t/db_dependent/Circulation_issuingrules.t).
Comment 6 Jonathan Druart 2016-04-08 08:27:19 UTC
(In reply to Marcel de Rooy from comment #5)
> Applying: Bug 12787: Reorganise t/db_dependent files
> fatal: sha1 information is lacking or useless
> (t/db_dependent/Circulation_issuingrules.t).

Did you apply 15757 first?
Comment 7 Marcel de Rooy 2016-04-08 08:33:49 UTC
(In reply to Jonathan Druart from comment #6)
> (In reply to Marcel de Rooy from comment #5)
> > Applying: Bug 12787: Reorganise t/db_dependent files
> > fatal: sha1 information is lacking or useless
> > (t/db_dependent/Circulation_issuingrules.t).
> 
> Did you apply 15757 first?

Oh sorry. How can that still be in NSO?
Comment 8 Kyle M Hall 2016-04-21 14:46:51 UTC Comment hidden (obsolete)
Comment 9 Kyle M Hall 2016-04-21 14:47:05 UTC
Created attachment 50522 [details] [review]
Bug 12787: Reorganise t/db_dependent files

This patch tries to reorganise test files in the db_dependent directory:
- Circulation_Branch.t       has been moved to Circulation/Branch.t
- Circulation_issuingrules.t has been moved to Circulation/CalcDateDue.t
- Circulation_Issuingrule.t  has been moved to Circulation/GetHardDueDate.t
- Circulation_dateexpiry.t   has been moved to Circulation/dateexpiry.t
- Circulation_issue.t        has been moved to Circulation/issue.t
- Circulation_transfers.t    has been moved to Circulation/transfers.t
- Items_DelItem.t            has been moved to Items/DelItem.t
- BiblioObject.t             has been moved to Koha/Biblio.t
- Members_Attributes.t       has been moved to Members/Attributes.t
- Members_columns.t          has been moved to Members/columns.t
- Circulation_OfflineOperation.t   has been moved to Circulation/OfflineOperation.t
- Koha_template_plugin_KohaDates.t has been moved to Template/Plugin/KohaDates.t
- Koha_template_plugin_Branches.t  has been moved to Template/Plugin/Branches.t
- Reports/Guided.t, ReportsGuided.t and Reports_Guided.t have been
  merged

Test plan:
Confirm that all the modified tests still pass

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 10 Kyle M Hall 2016-04-21 14:47:12 UTC
Created attachment 50523 [details] [review]
Bug 12787: (QA followup) small QA fixes

Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 11 Kyle M Hall 2016-04-21 14:47:15 UTC
Created attachment 50524 [details] [review]
Bug 12787 [QA Followup] - Retain change to Reports_Guided.t

Adds change from Bug 16224: Fix t/db_dependent/Reports_Guided.t
(08017f89f150394b6224fafb64fe8d12fc146ff1) to Reports/Guided.t

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 12 Brendan Gallagher 2016-04-22 00:55:14 UTC
Pushed to Master - Should be in the May 2016 release!  Thanks!