Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Equinox/p2/Testing

< Equinox‎ | p2
Revision as of 22:12, 29 September 2008 by John arthorne.ca.ibm.com (Talk | contribs) (Publisher tests)

This page collects information on working with and running the automated and manual tests for p2.

Automated tests

To run the automated tests, start by checking out org.eclipse.equinox.p2.releng from /cvsroot/rt/org.eclipse.equinox/p2. Then import one of the project sets in this project depending on whether you want to use the extssh (for committers) or pserver (for others) connection method. Select the appropriate project set file and click "Import Project Set" from the context menu.

The p2 tests all require Java 5 or later to run. The tests are all regularly run on Windows, Linux, and Mac, but should run on other platforms as well. Please enter bug reports for test failures on any os/ws/arch combination supported by Equinox.

Structurally all but the UI tests fall under the single AutomatedTests suite in org.eclipse.equinox.p2.tests. The UI tests have their own separate AutomatedTests entry point because they use the GUI test runner as opposed to the headless test runner. This means there are two suites to run to exercise all the tests. Note that the UI tests also exercise core code so it is valuable to run both suites even when changes are made in core areas.

With the exception of the End2EndTest, all of these tests are quite fast to run, so we should all be in the habit of running these tests before releasing any code changes. If you're on a slow connection you can either comment out the End2EndTest, or kill the test run when the last core test is started (this test always runs last).

Framework admin tests

Due to the fact that frameworkadmin has no knowledge of or dependency on p2, its tests are stored in a separate project: org.eclipse.equinox.frameworkadmin.test. However, its main test suite is linked into the AutomatedTests class in org.eclipse.equinox.p2.tests, so no extra step is needed to run these tests.

Installer tests

Repository tests

We have a fairly good collection of *real* metadata repositories, artifact repositories, and legacy update site repositories in org.eclipse.equinox.p2.tests/testData{artifactRepo,metadataRepo,updatesite}. This makes it fairly easy to write tests involving various kinds of well-formed and invalid repositories. Feel free to add further reasonably sized repositories here for testing other code paths, failure cases, regression tests, etc. Typically we try to write tests against local repositories to ensure good test performance, but there are a small number of tests that access repositories on http://eclipse.org for testing issues that only arise on remote repositories.

Dropins reconciler tests

To run the reconciler tests, there is a one-time setup required because it requires a copy of the platform runtime binary. You need to do the following:

  1. Download the latest release of the Eclipse project platform runtime binary zip for your os/ws/arch.
  2. Use a system property to specify the location of this zip in the test launch configuration (-Dorg.eclipse.equinox.p2.reconciler.tests.platform.archive=<some_path>eclipse-platform-3.4-win32.zip).

The "all p2 tests" launch configuration in the p2.tests bundle has this property set, but you'll likely need to tweak the path of the zip for your machine.

Publisher tests

The publisher test make use of the [[1]] testing framework. You'll need to know a bit about EasyMock to understand and work with these tests.

Manual tests

The p2 team maintains a set of manual smoke test scenarios for exercising functionality difficult to capture in automated tests. See the manual test scripts for more details.

Back to the top