Commit 7a37a98f authored by Luis Araujo's avatar Luis Araujo

Add Tester column to the database

The Tester column can be used to record the tester name, it can be
'lava' for automated tests and the username login for manual tests.
Signed-off-by: Luis Araujo's avatarLuis Araujo <luis.araujo@collabora.co.uk>
parent bf0ee02a
Pipeline #4167 passed with stage
in 1 minute and 26 seconds
"""Add Tester column to save tester name for Jobs
This record the tester (lava or tester login username) for Jobs.
Revision ID: 6951d2025d13
Revises: b5d2d0ec9599
Create Date: 2019-07-04 09:00:39.311081
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '6951d2025d13'
down_revision = 'b5d2d0ec9599'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('jobs', sa.Column('tester', sa.String(length=50), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('jobs', 'tester')
# ### end Alembic commands ###
......@@ -60,6 +60,8 @@ class Job(db.Model):
description = db.Column(db.String)
visibility = db.Column(db.String(20), nullable=False)
# Tester (lava for automated and tester login name for manual tests)
tester = db.Column(db.String(50))
class TestCase(db.Model):
"""Test cases for tests jobs."""
......
......@@ -74,7 +74,7 @@ def save_job(job, db):
db.session.add(job_db)
db.session.commit()
def save_manual_job(manual_tests_results, db,
def save_manual_job(username, manual_tests_results, db,
image_release, image_version,
image_type, image_deployment):
......
......@@ -152,9 +152,8 @@ def submit_report(image_release, image_version, image_type, image_deployment):
# Remove csrf_token received by the form.
manual_tests_results.pop('csrf_token')
save_manual_job(manual_tests_results, db,
image_release, image_version,
image_type, image_deployment)
save_manual_job(session['username'], manual_tests_results, db,
image_release, image_version, image_type, image_deployment)
return generate_submitted()
# Generate a submit report page with only manual test cases for the specified
......
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