If the LabKey Server team has provided you with pull request permission, you can submit changes that you make to the LabKey Server source. Before you submit any changes, you must make sure that your code builds, that it runs as expected, and that it passes the relevant automated tests.

Update and Perform a Clean Build

Before you run any tests, follow these steps to ensure that you are able to build with the latest source:

  1. Stop your development instance of Tomcat if it is running.
  2. From a command prompt, navigate to <labkey-home>/server
  3. Run the gradlew cleanBuild build task to delete existing build information.
  4. From your <labkey-home> directory (the root directory of your LabKey Server enlistment), update your enlistment using your version control system to incorporate the latest changes made by other developers. Resolve any conflicts
  5. Run the gradlew deployApp target to build the latest sources from scratch.

Run the Test Suite(s)

LabKey maintains automated tests that verify most areas of the product.

If you modify server code, you should run tests relevant to the feature area you modified before pushing those changes to other developers. For changes to core platform modules, you should run a test suite with broad coverage (e.g. DRT , Daily, and/or BVT). For changes to other modules you should run tests specific to those modules. Many modules have a test suite specific to that module.

See: Run Automated Tests

Test Failures

If a test fails, you'll see error information output to the command prompt, including the nature of the error and a stacktrace indicating where the test failed. A screenshot and HTML dump of page state when the failure occurred will be written to the <labkey-home>/server/test/build/logs directory, which can be viewed to see the state of the browser at the time the test failed.

Checking In Code Changes

Once you pass the tests successfully, you can submit a pull request. Make sure that you have updated your enlistment to include any recent changes checked in by other developers. See the Feature Branch Workflow topic for more information on how we use feature branches and then merge them to the target branch.

After every check in, TeamCity will build the complete sources and run the full BVT on all of the supported databases as an independent verification.

Related Topics

Was this content helpful?

Log in or register an account to provide feedback


previousnext
 
expand allcollapse all