Details
-
Type: Task
-
Status: Done/Fixed
-
Priority: Major
-
Resolution: Won't Do
-
Affects Version/s: HR-1.0
-
Fix Version/s: HR-1.0
-
Component/s: None
-
Labels:None
Description
When running the test suite for CiviHR, we currently overload "WebTest_AllTests" in each of the HR extensions and spawn subjobs to execute each. These tests run independently in Jenkins, but this has the side-effect of consuming a lot of disk and CPU. (Each test requires its own working copy of CiviCRM+CiviHR, and each working copy has to be initialized for each test run.) Thus test runs are rather slow/expensive.
The goal is to run more tests together in the same job. (We will still need a couple jobs – but fewer.)
In the past, I tried using a simple shell script to run multiple test suites in the same job, e.g.
--------------------
#!/bin/bash
cd hrjob; phpunit api_v3_AllTests
cd hrjob; phpunit CRM_AllTests
cd hrreport; phpunit WebTest_AllTests
--------------------
This kind of works, but: (1) If you mix api/CRM-tests with web-tests, the web-tests will fail (because API/CRM clobbers the DB). (2) The exit code should indicate whether any one of the test suites failed. (An incorrect exit code causes Jenkins to incorrectly display the result.) You can use "set -e/set +e" and "$?" to facilitate.