Use Cases

Ability for any user, internal or external, to easily run a suite of tests before commit

Continuous integration (checkout, build, test, report)

Use JUnit framework for all testing

Enable health checks against production database to be part of test suite

New test cases can be added easily

Running the OSEE Test Suite

The OSEE test suite uses the org.eclipse.osee.ats.config.demo plugin to initialize a demo database, populate it with demo data and run the majority of the OSEE tests against this common data set.

These tests are contributed to the MasterTestSuite groups using Eclipse's extension point framework. Any Test Suite can implement IOseeTest and extend the OseeTest extension point to be contributed to the appropriate test suite(s).

Steps to test

Checkout org.eclipse.osee.ats.config.demo

Checkout org.eclipse.osee.support.test

Run the following tests in order and resolve any errors:

Run the Demo database tests:

Run the OSEE Demo Application Server launch config

Run the MasterTestSuite_DemoDbInit launch config. This initializes the postgres database for demo populate and tests

Run the MasterTestSuite_DemoDbPopulate launch config. This loads the database with branches, actions and sets conditions for populate tests.

Run the MasterTestSuite_DemoDbTests launch config. This runs tests against the DemoDb Populated database.

Stop the OSEE Demo Application Server if still running

Run the Production TestDb tests:

Run the OSEE Application Server launch config.

Run the MasterTestSuite_TestDbInit launch config. This initializes the postgres database for production testdb tests

Run the MasterTestSuite_TestDbTests launch config. - This runs production specific tests using a TestDb.

Run the Production tests and health checks against the current production release

Run the MasterTestSuite_ProductionTests launch config. This runs tests and health checks against the current production released database.

Common test utility plugin

The plugin org.eclipse.osee.support.test.util is in support of our testing framework. It has a number of common enums and a TestUtil class that should be used by any junit tests. The intent is to keep this plugin lightweight and without many dependencies cause all the testing fragments "should" include it. In addition, it should not be included by any production plugins, only test fragments.

Adding new Tests to MasterTestSuite

To create test fragment off plugin to be tested

All OSEE JUnit tests should live in a fragment of the plugin to be tested.

Select plugin to be tested

Right-click -> New Project -> Plugin Project -> Plugin Fragment

Enter plugin to be tested as Host plugin

Complete wizard

In plugin to be tested (eg org.eclipse.osee.ats)

Add "Eclipse-ExtensibleAPI: true" to MANIFEST.MF of plugin to be tested. This allows test suites to see tests in this plugin

In new fragment (eg org.eclipse.osee.ats.test)

Add org.junit4 (make sure junit4, not junit) to dependencies

Add the common test utility plugin org.eclipse.osee.support.test.util plugin to dependencies