lhupfeldt / jenkinsflow

Python API with high level build flow constructs for jenkins/hudson
BSD 3-Clause "New" or "Revised" License
13 stars 4 forks source link

Automatically download Jenkins and start it on random port #10

Closed lechat closed 10 years ago

lechat commented 10 years ago

Got code from Jenkinsapi for doing that and adopted it for use by pytest.

Unfortunately, pytest requires passing fixtures to all test methods, so example is in one test for now:

def test_boolean_and_int_params(jenkins_server):
    with mock_api.api(__file__, jenkinsurl=jenkins_server) as api:
...

That requres adding parameter to all tests that use jenkins... :-1:

lhupfeldt commented 10 years ago

Hi Aleksey

I don't really see the need for this automatic download. I think anybody using jenkinsflow will already have jenkins installed. It adds quite a few lines of code that needs to be maintained. Also I'm not happy about having to add the fixture to all tests, for two reasons: 1) pylint is not happy with fixtures, so I try to keep tham to a minimum. 2) I spent quite a lot of time making sure the mocked tests run in 1second. I think that that test run by setup.py by default should be the mocked tests, and the few testcases that actually require jenkins to be running, even when mocked, should be xfail in that scenario. After all this is not for testing jenkinsapi, but for testing the logic of the flowcontroller. The dependency on jenkinsapi/jenkins is quite small. Actually setup.py should run test.py instead of invoking pytest. Then the download could be done in test.py, if not mocked and jenkins is not already running on lodalhos:8080 tand if it can use the launcher from jenkinsapi. I don't think we should copy the launcher to jenkinsflow.

lechat commented 10 years ago

Sorry, was to tired to reply properly...

The goal of automatic Jenkins download is to enable continuous integration using one of the free CI servers (TravisCI, Shippable, etc.) for jenkinsflow. Of course everybody can test everything on their local machine, but having external clean build for free is useful too.

lhupfeldt commented 10 years ago

Can it be setup to execute the test.py script instead? That also runs the demos. If this can be setup then I think it is better to let the test.py script handle the download. I still think the launcher script from jenkinsapi should be used, instead of copying the functionality.

Regards / Venlig Hilsen Lars Hupfeldt Nielsen Hupfeldt IT

Phone: +45 2060 3546

2014-03-14 16:46 GMT+01:00 Aleksey Maksimov notifications@github.com:

Sorry, was to tired to reply properly...

The goal of automatic Jenkins download is to enable continuous integration using one of the free CI servers (TravisCI, Shippable, etc.) for jenkinsflow. Of course everybody can test everything on their local machine, but having external clean build for free is useful too.

— Reply to this email directly or view it on GitHubhttps://github.com/lhupfeldt/jenkinsflow/pull/10#issuecomment-37662357 .