Merge lp:~jcsackett/charmworld/trigger-test-builds into lp:charmworld
Status: | Merged |
---|---|
Approved by: | j.c.sackett |
Approved revision: | 480 |
Merged at revision: | 475 |
Proposed branch: | lp:~jcsackett/charmworld/trigger-test-builds |
Merge into: | lp:charmworld |
Diff against target: |
146 lines (+64/-2) 4 files modified
charmworld/jobs/ingest.py (+17/-0) charmworld/jobs/tests/test_ingest.py (+36/-2) default.ini (+6/-0) test-setup.ini (+5/-0) |
To merge this branch: | bzr merge lp:~jcsackett/charmworld/trigger-test-builds |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Gui Bot | continuous-integration | Approve | |
Curtis Hovey (community) | code | Approve | |
Review via email: mp+201466@code.launchpad.net |
Commit message
Automatically trigger builds for new charms and new revisions of existing charms.
Description of the change
This branch introduces a feature to automatically trigger test builds for new
charms and new revisions of existing charms as they are ingested.
charmworld/
-------
* `trigger_tests` triggers a test build for a branch and revision on launchpad.
The associated jenkins instance is configured to start a build whenever a GET
is made on the created URL in this function.
* `trigger_tests` is added to the block corresponding to updating a charm, as we
only want to run it under the circumstances when the charm needs updating on
charmworld.
Misc
----
* Tests have been added.
* Settings specific to the jenkins instance for testing have been added to the
ini.
Line 18 'run_test_ builds' ] != 'false': 'run_test_ builds' ] == 'true':
if settings[
could be expressed as a positive
if settings[
which also ensures tests only run under a narrow condition that we control
The test and format string appear to be missing 'token' %s/job/ charm-delegator /buildWithParam eters?= %s&branch= lp:foo& revno=1 %s/job/ charm-delegator /buildWithParam eters?token= %s&branch= lp:foo& revno=1
http://
I expected
http://
The jenkins_url should not be configured by default. Developers will run this. Maybe someone will run it themselves. Only manage. jujucharms. com will be configured to send data to jenkins, only it will have all the information to trigger a jenkins job. The tests or develop can configure the jenkins url as needed.
It's an error to run_test_builds to true, not but not set jenkins_url. I imagine we would see ingest slow,
waiting for each call to timeout. Maybe we don't need run_test_builds, or we want a sanity check to verify charmworld has enough information. I am not sure raising an error will help though. We will only see it if we look in the log.
It might be nice to print to stdout and maybe log that the url is not configured.
jenkins_url and run_test_builds don't appear related by name. As charm test data might come from several
places, maybe we want names that describe the intent clearly. Maybe charm_test_url and run_charm_tests?
The jenkins URL is somewhat brittle. The protocol might change. I don't think we need to separate the token from the URL. Can we place a formate template in a single value? 1.2.3.4: 8080/job/ charm-delegator /buildWithParam eters?token= DING-DONG& branch={branch} &revno= {revno} ' 'charm_ test_url' ] url.format( dict(branch= charm_branch, revno=revision))
charm_test_url: http://
and trigger_tests() might do
charm_test_url = settings[
url = charm_test_
charmworld only cares about a template that defines {branch} and {revno}; Everything is Jenkin's concern.