developer.jelix.org is not used any more and exists only for history. Post new tickets on the Github account.
developer.jelix.org n'est plus utilisée, et existe uniquement pour son historique. Postez les nouveaux tickets sur le compte github.

Opened 7 years ago

Closed 7 years ago

#1282 closed enhancement (fixed)

There should be a way to separate different categories of tests

Reported by: rahal Owned by:
Priority: low Milestone: Jelix 1.3 beta 1
Component: module:junittests Version: trunk
Severity: normal Keywords: tests
Cc: Blocked By:
Blocking: Documentation needed: no
Hosting Provider: Php version:

Description

WeWe? could have unit tests, functional ( and certainly other categories ).

This separation has as a main goal to make it possible to have a very fast test suite that could be run by developers before commits ( or while testing and coding ).

As junittest already have a similar separation between html or cli tests, we could use some naming convention to separate between different categories.

Change History (4)

comment:1 Changed 7 years ago by laurentj

  • Priority changed from high to low

well: html tests for integration, cli test for unit tests...

comment:2 Changed 7 years ago by rahal

I'd like to run unit tests from html as i certainly want to run integration tests from cli , so html or cli is not an acceptable solution as i can't run integration tests from cli ( for continuous integration, and continuous deployment sake ) .

I commited a changeset adressing this ticket here https://bitbucket.org/rahal/jelix-trunk/changeset/9a78be3e974b, it is now possible to specify a category for a test using name like mytest.htm_cli_.unit.php, or mytest.htm_cli_.functional.php, or even mytest.html_cli.stress.php ; we can now use :

php tests.php default:index --categ unit  // should run only the "unit" tests
php tests.php default:index --categ functional  // should run only the "functional" tests
php tests.php default:index --categ yourspecialcategory  // should run only the "yourspecialcategory" tests
php tests.php   // should run all the tests
php tests.php default:help --categ unit  // should list only the "unit" tests
php tests.php default:help --categ yourspecialcategory  // should list only the "yourspecialcategory" tests
php tests.php  default:help // should list all the tests

I also added the possiblity to run those seperated sets of tests ( actually just unit or functional ) from html ui (junittest module).

The changeset also enhances the reporting in case there is not tests, and i had to do some refactoring.

I also added a "unit" test testing my refactored class ( in junittests module ).

You are welcome to pull from my branch available here https://bitbucket.org/rahal/jelix-trunk

comment:4 Changed 7 years ago by laurentj

  • Milestone set to Jelix 1.3
  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.