Commit 35394265 authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

tests can now also be run in Debug

parent 7b2893a6
# Generated by Django 2.0.5 on 2018-06-06 15:19
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('rainboard', '0014_py3'),
]
operations = [
migrations.AddField(
model_name='image',
name='debug',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='project',
name='debug',
field=models.BooleanField(default=False),
),
migrations.AlterUniqueTogether(
name='image',
unique_together={('robotpkg', 'target', 'py3', 'debug')},
),
]
......@@ -154,6 +154,7 @@ class Project(Links, NamedModel, TimeStampedModel):
updated = models.DateTimeField(blank=True, null=True)
tests = models.BooleanField(default=True)
docs = models.BooleanField(default=True)
debug = models.BooleanField(default=False)
def git_path(self):
return settings.RAINBOARD_GITS / self.main_namespace.slug / self.slug
......@@ -549,11 +550,12 @@ class Robotpkg(NamedModel):
return f'{RPKG_URL}/rbulk/robotpkg{path}/{self.name}'
def update_images(self):
py3s = [False, True] if self.name.startswith('py-') else [False]
debugs = [False, True] if self.project.debug else [False]
for target in Target.objects.all():
Image.objects.get_or_create(robotpkg=self, target=target, py3=False)[0].update()
if self.name.startswith('py-'):
for target in Target.objects.all():
Image.objects.get_or_create(robotpkg=self, target=target, py3=True)[0].update()
for py3 in py3s:
for debug in debugs:
Image.objects.get_or_create(robotpkg=self, target=target, py3=py3, debug=debug)[0].update()
def update(self, pull=True):
path = settings.RAINBOARD_RPKG
......@@ -601,9 +603,10 @@ class Image(models.Model):
created = models.DateTimeField(blank=True, null=True)
image = models.CharField(max_length=12, blank=True, null=True)
py3 = models.BooleanField(default=False)
debug = models.BooleanField(default=False)
class Meta:
unique_together = ('robotpkg', 'target', 'py3')
unique_together = ('robotpkg', 'target', 'py3', 'debug')
def __str__(self):
py = '-py3' if self.py3 else ''
......@@ -628,7 +631,8 @@ class Image(models.Model):
return f'https://{project.registry()}/v2/{project.main_namespace.slug}/{project}/{manifest}'
def get_job_name(self):
return f'robotpkg-{self}'.replace(':', '-')
mode = 'debug' if self.debug else 'release'
return f'robotpkg-{self}-{mode}'.replace(':', '-')
def build(self):
args = self.get_build_args()
......
......@@ -11,9 +11,8 @@ cache:
{% for robotpkg in project.robotpkg_set.all %}.robotpkg-{{ robotpkg }}: &robotpkg-{{ robotpkg }}
except:
- gh-pages
before_script:
- mkdir -p ccache
script:
- mkdir -p ccache
- cd /root/robotpkg/{{ robotpkg.category }}/{{ robotpkg }}
- git pull
- make checkout MASTER_REPOSITORY="dir ${CI_PROJECT_DIR}"
......@@ -27,7 +26,9 @@ cache:
{% for image in robotpkg.valid_images %}{{ image.get_job_name }}:
<<: *robotpkg-{{ robotpkg }}
image: {{ image.get_image_name }}
{% if project.docs and image.target.name == '16.04' and not image.py3 %} artifacts:
{% if image.debug %} before_script:
- echo PKG_OPTIONS.{{ robotpkg }}=debug >> /opt/openrobots/etc/robotpkg.conf
{% elif project.docs and image.target.name == '16.04' and not image.py3 %} artifacts:
expire_in: 1 day
paths:
- doxygen-html/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment