示例#1
0
 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"
示例#2
0
 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
示例#3
0
 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')
示例#4
0
 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')
示例#5
0
 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"
示例#6
0
 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"
示例#7
0
 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
示例#8
0
 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
示例#9
0
 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
示例#10
0
 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'
示例#11
0
 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/'
示例#12
0
 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"
示例#13
0
 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
示例#14
0
 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"
示例#15
0
 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'
示例#16
0
 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/'
示例#17
0
 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"