def test_update_build(self, session): session.app.post_json('/api/builds/ceph/', params=self.data) data = self.data.copy() data['status'] = "completed" result = session.app.post_json('/api/builds/ceph/', params=data) assert result.status_int == 200 build = Build.get(1) assert build.status == "completed"
def test_update_build(self, session): session.app.post_json('/api/builds/ceph/', params=self.data) data = self.data.copy() data['status'] = "completed" result = session.app.post_json('/api/builds/ceph/', params=data) assert result.status_int == 200 build = Build.get(1) assert build.status == "completed" assert build.completed
def __init__(self, _id): self.project = Project.get(request.context['project_id']) self.build = Build.get(_id) if not self.project: # TODO: nice project not found error template abort(404, 'project not found') if not self.build: # TODO: nice project not found error template abort(404, 'build not found')
def test_can_create(self, session): Build(self.p, **self.data) session.commit() b = Build.get(1) assert b.ref == "master" assert b.sha1 == "sha1" assert b.url == "jenkins.ceph.com/build" assert b.log_url == "jenkins.ceph.com/build/console" assert b.build_id == "250" assert b.status == "failed"
def test_create_a_build(self, session): result = session.app.post_json('/api/builds/ceph/', params=self.data) assert result.status_int == 200 build = Build.get(1) assert build.ref == "master" assert build.project.name == "ceph" assert build.flavor == "default" assert build.sha1 == "sha1" assert build.url == "jenkins.ceph.com/build" assert build.log_url == "jenkins.ceph.com/build/console" assert build.extra["version"] == "10.2.2" assert not build.distro
def test_distro_version_can_be_null(self, session): Build(self.p, **self.data) session.commit() b = Build.get(1) assert not b.distro_version
def test_update_queued_build_is_completed(self, session): data = get_build_data(status='queued', url='jenkins.ceph.com/trigger') session.app.post_json('/api/builds/ceph/', params=data) data = get_build_data(status='completed') session.app.post_json('/api/builds/ceph/', params=data) assert Build.get(1).status == 'completed'
def test_default_gives_full_url(self, session): Build(self.p, **self.data) session.commit() result = Build.get(1).get_url() assert result == '/builds/ceph/master/sha1/default/1/'
def test_can_create_with_extra(self, session): b = Build(self.p, **self.data) b.extra = dict(version="10.2.2") session.commit() build = Build.get(1) assert build.extra['version'] == "10.2.2"
def test_update_queued_build_is_completed(self, session): data = get_build_data(status='queued', url='jenkins.ceph.com/trigger') session.app.post_json('/api/builds/ceph/', params=data) data = get_build_data(status='completed') result = session.app.post_json('/api/builds/ceph/', params=data) assert Build.get(1).status == 'completed'
def test_update_queued_build_is_completed(self, session): data = get_build_data(status="queued", url="jenkins.ceph.com/trigger") session.app.post_json("/api/builds/ceph/", params=data) data = get_build_data(status="completed") result = session.app.post_json("/api/builds/ceph/", params=data) assert Build.get(1).status == "completed"