Bug 16173 - db_structure.t shouldn't have a fixed number of tests
Summary: db_structure.t shouldn't have a fixed number of 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: Tomás Cohen Arazi (tcohen)
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-30 15:46 UTC by Tomás Cohen Arazi (tcohen)
Modified: 2016-12-05 21:27 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 16173: db_structure.t shouldn't have a fixed number of tests (1.93 KB, patch)
2016-03-30 15:50 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 16173: db_structure.t shouldn't have a fixed number of tests (1.98 KB, patch)
2016-03-30 23:12 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 16173: db_structure.t shouldn't have a fixed number of tests (2.08 KB, patch)
2016-04-01 08:16 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Tomás Cohen Arazi (tcohen) 2016-03-30 15:46:12 UTC
Right now, this file contains a fixed number of tests. So any structure change on the relevant tables should taouch this file to adjust the number to what it expects.
The point of tests is that they reflect problems, not cause them :-D So this specific tests file should not have a fixed number of tests, and it will serve its purpose by comparing the table vs deletedtable cases no matter how many columns they have.
Comment 1 Tomás Cohen Arazi (tcohen) 2016-03-30 15:50:10 UTC Comment hidden (obsolete)
Comment 2 Mark Tompsett 2016-03-30 23:11:00 UTC
Comment on attachment 49689 [details] [review]
Bug 16173: db_structure.t shouldn't have a fixed number of tests

Review of attachment 49689 [details] [review]:
-----------------------------------------------------------------

::: t/db_dependent/db_structure.t
@@ +12,5 @@
> +# 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>.

Beyond scope, but good idea to fix anyways. :)
Comment 3 Mark Tompsett 2016-03-30 23:12:30 UTC Comment hidden (obsolete)
Comment 4 Marcel de Rooy 2016-04-01 08:16:02 UTC
Created attachment 49775 [details] [review]
Bug 16173: db_structure.t shouldn't have a fixed number of tests

This patch makes db_structure.t more flexible regarding how many tests are run.
This is important because it would fail on each db structure change, masking potential
real problems.

To test:
- Run
  $ prove t/db_dependent/db_structure.t
=> FAIL: the number of tests ran doesn't match what is expected
- Apply the patch
- Run
  $ prove t/db_dependent/db_structure.t
=> SUCCESS: Tests count is not an issue [1]
- Sign off

[1] Right now the tests run successfuly, they might fail if a real bug is introduced
on the DB structure, in the meantime.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 5 Brendan Gallagher 2016-04-01 19:15:20 UTC
Pushed to Master - Should be in the May 2016 release.  Thanks!