opensource.activestate.com
About opensource.activestate.com
/ Projects / Papers /
ASPN ActiveState
PyPerl
PyXPCOM
Smoke
Smoke Database Schema

Smoke Database Schema

Introduction

Smoke is basically a database of data on projects, builds, test results, and performance metrics. There is an API for adding such data (the Smoke Client API) and web front-end to viewing this data. This document describes the database schema used to store Smoke data.

There are 7 primary database tables plus one addition attributes table for each of these, for a total of 14 tables. The primary tables are:

Table Description
project Each row defines a project for which there might be build, test and perf results.
machine Each row defines a machine on which builds, tests or performance measurements might have been carried out.
build Each row represents a build for a project package.
testspec Each row represents a test specification (or type) for a project. Any test table entry must refer to a testspec.
test Each row represents a regression test result on a specific build.
perfspec Each row represents a performance metric specification (or type) for a project. Any perf table entry must refer to a perfspec.
perf Each row represents a performance measurement on a specific build.

Each of the above tables also has an attributes table to allow the assignment of arbitrary name/value pairs of data to any entry.

Schema: Text Description

Bolded fields are required.

project table: project descriptions

The project table captures project meta-data and provides a way to group a collection of regrssion test (testspec table) and performance metric (perfspec table) specifications relevant to a project.

Field Type Description
id int A unique numeric id assigned by the backend database.
name string A unique short name for a project.
fullname string A longer, "prettier" name for the project. This is typically used for display in UI whereas the name field is used in URLs in the web front end.
description string  

machine table: build/test machine information

Any build, test result or performance measurement must refer to the id of the machine on which it was built/tested/measured. A unique id is assigned to any unique combination of name, os_family, os_release, os and architecture.

The specific allowed values for the os_family, os_release, os and architecture fields are not that well documented or controlled. However, typical use does not require the user to know these. Usually a build or test result, for example, will be added from the machine on which it was built/run. The Smoke Client API, with which this data is added, will default to using (and adding if necessary) a machine id for the current machine.

Field Type Description
id int A unique numeric id assigned by the backend database.
name string the machine name
os_family string Windows|Linux|Mac|Solaris|HP-UX
os_release string e.g. 95|98|2000|2.2.18|...
os string win32|solaris8|linux|...
architecture string ix86|sun4u|...
description string  

build table: build results

Field Type Description
id int A unique numeric id assigned by the backend database.
machine_id int The machine on which this build was built.
project_id int The project to which this build belongs.
package string The name of the package that was built (e.g. installer, source, documentation). This field allows for different packages for one project.
version string Version of the built package.
starttime datetime Time at which the build was started.
is_dev_build boolean Boolean indicating whether this entry identifies a development build. See the getDevBuildId() Client API method.
scc_revision string Source code control system revision to which this build can be linked (if possible).
build_flags string Special configuration build flags.
environment string Dump of relevant/special environment settings.
log_file string In the database the path to a local copy of any uploaded log file is stored here.
result boolean Indicates if build was successful.
checksum string MD5 digest of the built package, if available.

Notes on scc_revision: If this can be specified then it may be possible for the Web front-end to provide useful direct links from build/test/performance data to specific change descriptions, e.g. to a specific revision on p4db: http://caliper.activestate.com/p4db/changeView.cgi?CH=51234

Notes on checksum: using an md5sum of a build's installer is an excellent way to uniquely identify a built package. Obviously, such a checksum can only be obtained if there is a successful build. See the getBuildId() Client API method.

Notes on is_dev_build: Development build entries are treated somewhat differently. A development build is, in general, not trackable. It changes with time. None of scc_revision, build_flags, starttime, environment, checksum are applicable. This concept exists in Smoke to allow the adding of test data for development builds without the burden of having to add new build entries for every such test.

testspec table: regression test specifications

Each type of regression test for a project that is added to a Smoke database must refer to a testspec entry. A test specification belongs to a specific project and is uniquely defined by its name and project_id (see the getTestSpecId() Client API method).

Field Type Description
id int A unique numeric id assigned by the backend database.
name string A short name for this test specification.
project_id int The project to which this test type belongs.
fullname string A longer, "prettier" name for the test spec. This is typically used for display in UI whereas the name field is used in URLs in the web front end.
description string  

test table: regression test results

Field Type Description
id int A unique numeric id assigned by the backend database.
testspec_id int The test specification defining meta-data about this test result (such as what project it belongs to).
build_id int Identifies the build that was tested.
machine_id int Identifies the machine on which the test was run. This may differ from the machine on which the package was built.
starttime datetime The time at which this test was begun.
result boolean Indicates whether the test was successful.
log_file string A log of the test run. In the database the path to a local copy of any uploaded log file is stored here.

perfspec table: performance metric specifications

Each type of performance metric for a project that is added to a Smoke database must refer to a perfspec entry. A performance metric specification belongs to a specific project and is uniquely defined by its name and project_id (see the getPerfSpecId() Client API method).

Field Type Description
id int A unique numeric id assigned by the backend database.
name string A short name for this perf specification.
project_id int The project to which this perf type belongs.
more_is_good boolean Indicates if a higher perf measurements is a good thing. For example, this would be false for a "memory footprint" metric.
target float A target value for this metric, i.e. it is hoped that future measurements will reach this value.
units string Indicates the units for the target and perf entry result fields.
fullname string A longer, "prettier" name for the perf spec. This is typically used for display in UI whereas the name field is used in URLs in the web front end.
description string  

perf table: performance measurements

Field Type Description
id int A unique numeric id assigned by the backend database.
perfspec_id int The perf specification defining meta-data about this perf result (such as what project it belongs to).
build_id int Identifies the build that was measured.
machine_id int Identifies the machine on which the measurement was taken. This may differ from the machine on which the package was built.
starttime datetime The time at which this measurement was begun.
result float The measurement result.
log_file string A log of the measurement run. In the database the path to a local copy of any uploaded log file is stored here.

attributes tables

There is one *_attributes table for each of the primary tables described above. Each such table has the same basic structure:

Field Type Description
<tablename>_id int Refers to entry in its associated table.
name string Cannot contain a newline or '=' character.
value string Cannot contain a newline character.

Schema: SQL

See "src/sql/empty_smoke_db.sql" in the Smoke source tree. This file can be imported into an empty database to setup a Smoke database for use. Note that this may be MySQL-specific.

© ActiveState 2003 All rights reserved