Also worth mentioning:
- does some sql-foo to create a db with some data
- runs maven as follows:
export MAVEN_OPTS=" -XX:MaxPermSize=512m"
mvn \
-P enable-dao-tests \
-D engine.db.username=engine \
-D engine.db.password=engine \
-s /home/jenkins/workspace/ovirt-engine_3.5_dao-unit-tests_gerrit/artifactory-ovirt-org-settings.xml \
-Dengine.db.url=jdbc:postgresql://localhost/ovirt_engine_3_5_dao_unit_tests_gerrit_369 \
install
mvn \
-f ovirt-engine/pom.xml \
-s /home/jenkins/workspace/ovirt-engine_3.5_unit_tests_gerrit/artifactory-ovirt-org-settings.xml \
-DGERRIT_HOST=gerrit.ovirt.org \
-DGERRIT_PATCHSET_UPLOADER="Alon Bar-Lev <alonbl@redhat.com>" \
-DGERRIT_EVENT_ACCOUNT_NAME="Alon Bar-Lev" \
-DGERRIT_EVENT_TYPE=patchset-created \
-DGERRIT_CHANGE_ID=I97fa20e0f5205ebddb6aff1cbfebf3f2879fa34e \
-DGERRIT_TOPIC=host-deploy \
-DGERRIT_CHANGE_NUMBER=44875 \
-DGERRIT_VERSION="2.10.3.1" \
-DGERRIT_PATCHSET_UPLOADER_NAME="Alon Bar-Lev" \
-DGERRIT_CHANGE_COMMIT_MESSAGE=aG9zdC1kZXBsb3k6IHJlbW92ZSB0aW1lc3RhbXAgY2FjaGUgY2hlY2sgZm9yIHRhcmJhbGwKCndoZW4gbXVsdGlwbGUgcGFja2FnZXMgbWFuYWdlIHRoZSBkaXJlY3RvcnkgdHJlZSwgdGhlIGxhc3QgZmlsZQp0aW1lc3RhbXAgY2Fubm90IGJlIHVzZWQgYXMgcmVmZXJlbmNlIHRvIGNhY2hlIGludGVncml0eSBhcyBhbiBvbGRlcgpwYWNrYWdlIG1heSBiZSBhcHBsaWVkIGFmdGVyIG5ld2VyIG9uZS4KCndlIGNvdWxkIGhhdmUgdXNlZCBoYXNoIG1lY2hhbmlzbSwgYnV0IHRoZW4gd2UgaGFkIHRvIHJlYWQgZmlsZXMgb25jZQpwZXIgaGFzaCBhbmQgb25jZSBwZXIgY3JlYXRpb24sIHNvIGJldHRlciB0byBqdXN0IGNyZWF0ZSB0aGUgdGFyYmFsbCBhdApkZXNpZ25hdGVkIGludGVydmFsLgoKQnVnLVVybDogaHR0cHM6Ly9idWd6aWxsYS5yZWRoYXQuY29tL3Nob3dfYnVnLmNnaT9pZD0xMjUyMzY0CkNoYW5nZS1JZDogSTk3ZmEyMGUwZjUyMDVlYmRkYjZhZmYxY2JmZWJmM2YyODc5ZmEzNGUKU2lnbmVkLW9mZi1ieTogQWxvbiBCYXItTGV2IDxhbG9uYmxAcmVkaGF0LmNvbT4K \
-DGERRIT_PATCHSET_UPLOADER_EMAIL=alonbl@redhat.com \
-DGERRIT_BRANCH=ovirt-engine-3.5 \
-DGERRIT_EVENT_HASH=-1504677913 \
-DGERRIT_PORT=29418 \
-DGERRIT_NAME=gerrit.ovirt.org \
-DGERRIT_CHANGE_OWNER_NAME="Alon Bar-Lev" \
-DGERRIT_EVENT_ACCOUNT="Alon Bar-Lev <alonbl@redhat.com>" \
-DGERRIT_EVENT_ACCOUNT_EMAIL=alonbl@redhat.com \
-DGERRIT_CHANGE_OWNER="Alon Bar-Lev <alonbl@redhat.com>" \
-DGERRIT_CHANGE_URL=https://gerrit.ovirt.org/44875 \
-DGERRIT_SCHEME=ssh \
-DGERRIT_CHANGE_SUBJECT="host-deploy: remove timestamp cache check for tarball" \
-DGERRIT_REFSPEC=refs/changes/75/44875/1 \
-DGERRIT_PATCHSET_NUMBER=1 \
-DGERRIT_PATCHSET_REVISION=fb26eba4f8ebe696a31c584e162edca9c17ef801 \
-DGERRIT_PROJECT=ovirt-engine \
-DGERRIT_CHANGE_OWNER_EMAIL=alonbl@redhat.com \
-Dmaven.repo.local=/home/jenkins/workspace/ovirt-engine_3.5_unit_tests_gerrit/.repository \
test
Maybe we could do as follows: sequential run of combined job doing
- maybe in parallel:
- run: sql foo
- job2 run - general unit tests:
mvn clean test <with params of job2>
- wait for 1.1 and 1.2. to complete, and then job1 run:
mvn test -P enable-dao-tests <with params of job1>
The above could theoretically reduce total runtime of job1+job2 by 1/3.
Given: job1 runs ~16m, job2 runs ~15m [most time ~10m is spent waiting for artifactory downloads, IIRC]
Expected outcome:
we could save 10m, reaching 21m, or even more, if the 2nd mvn run could probably reuse some of already compiled .class files, we'd could be even faster than 20m.
Possible Pitfals:
- problems combining tests result reports [if it indeed happens. devs, please comment]
- we might need to be able to run job1 and job2 separately:
- Workaround:
- split job1 into II parts: job1.sql-foo and job1.mvn
- run "workflow" (sharing workspace): parallel(job1.sql-foo,job2) ==> run job1.mvn
WDYT?