* New testsuite database structure

This commit is contained in:
Michaël Van Canneyt 2025-01-15 23:17:19 +01:00
parent 33cb23e99b
commit 762d1d2f1e
5 changed files with 174 additions and 306 deletions

124
tests/utils/README.md Normal file
View File

@ -0,0 +1,124 @@
# DBDigest tool.
## Configuration
There are 2 kinds of configuration data for DBDigest.
- global configuration
- Test run data
### Global configuration
This includes database configuration and run mode.
the database configuration can be specified in 3 different ways:
- in the global `/etc/dbdigest.ini`
- the `dbigest.cfg` run file (deprecated)
- the command-line. (deprecated)
The global file is read first, if it exists. The `dbdigest.cfg` file is read
next, and the command-line options are list:
The recommended way is to put it in the global config file, which has the
following format (the values are examples):
```ini
[Database]
Name=testsuite
Host=localhost
username=user
password=secret
port=5432
```
In the 'dbdigest.cfg' file, the format is backwards-compatible:
```text
databasename=NAME
host=HOST
password=PWD
username=USER
```
On the command-line the options are:
```
-d --databasename=NAME database name
-h --host=HOST database hostname
-p --password=PWD database user password
-P --port=NNN database connection port
-u --username=USER database user name
```
Other than the database connection, the following global options can be
given:
- `-r --relsrcdir=DIR` the relative source dir for getting test files.
- `-S --testsrcdir=DIR` the absolute test source dir
- `-T --threadlist=FILE` file with configuration file names to import.
- `-j --threadcount=N` Maximum number of threads to use when importing.
- `-V --verbose` be more verbose (writes lots of debug info)
- `-f --config=FILENAME` in case a single digest file is imported, the name of the config file.
If not set, dbdigest.cfg is used.
If the -T --threadlist option is given, then -f/--config is ignored: no
default file will be read. Only the files in the threadlist file will be
treated.
Example of a thread list file:
```
2025-05-01-i386/gcc-dbdigest.cfg
2025-05-01-arm/llvm-dbdigest.cfg
```
The `logfile` and `longlogfile` will be treated as relative to the dbdigest.cfg files
if they are relative filenames. If they are absolute filenames, they're used
as-is.
### Test Run data
Run data describes one test run: basically, one dbdigest.cfg.
For a single test run, the dbdigest.cfg file is read and the command-line
options are examined to compose all data for a test run.
- `-l --logfile=FILE` set log file to analyse
- `-L --longlogfile=FILE` set long log filename (logs of run tests)
- `-o --os=OS` set OS for testrun
- `-c --cpu=CPU` set CPU
- `-a --category=CAT` set category
- `-v --version=VER` set compiler version
- `-t --date=DATE` date in YYYMMDD(hhmmnn) format (only the date part is retained)
- `-s --submitter=NAME` submitter name
- `-m --machine=NAME` set machine name on which testsuite was run
- `-C --compile-flags=FLAGS` set used compilation flags
- ` --comment=FLAGS` backwards compatible way to set compilation flags (deprecated)
- `-D --description=DESC` set config description (helpful comment)
- ` --compilerdate=DATE` set compiler date
- ` --compilerfullversion=VERSION` set full compiler version
- ` --svncompilerrevision=REV` set revision of used compiler
- ` --svntestsrevision=REV` set revision of testsuite files
- ` --svnrtlrevision=REV` set revision of RTL
- ` --svnpackagesrevision=REV` set revison of packages
The preferred way to specify the options is in a `dbdigest.cfg` file. The
name of this file is settable using the -f or --config command-line option.
The `dbdigest.cfg` accepts all long versions of the command-line options,
and you can specify comments using the usual # sign.
## Examples
Import data from a single testrun, with testrun data in `mytest.cfg`:
```text
dbdigest -f mytest.cfg
```
The database connection data will be read from the global configuration.
Import data from a list of testruns in `mytests.lst` (4 threads):
```text
dbdigest -T mytests.cfg
```
Import data from a list of testruns in `mytests.lst` (8 threads):
```text
dbdigest -T mytests.cfg -j 8
```
# DBAdd tool.
To add new CPUs or OSes to the database, use the `dbadd` tool. It will use
the global `dbdigest.ini` file to connect to the database, and will add the
new record in the appropriate table. The tool accepts 3 command-line options:
- `-t --type=TYPE` where `TYPE` is one of `os`, `cpu`, `category` or `version`
- `-v --value=value` the value to add
- `-d --date=YYYYMMDD` only used when adding a version: the release date of
the version (if not specified, today is used).
Test definitions are added automatically during import.

View File

@ -1,151 +0,0 @@
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
CREATE TABLE TESTS (
T_ID int(11) NOT NULL auto_increment,
T_NAME varchar(40) default NULL,
T_CPU varchar(20) default NULL,
T_OS varchar(30) default NULL,
T_VERSION varchar(10) default NULL,
T_ADDDATE date NOT NULL default '0000-00-00',
T_GRAPH char(1) NOT NULL default '-',
T_INTERACTIVE char(1) NOT NULL default '-',
T_RESULT int(11) NOT NULL default '0',
T_FAIL char(1) NOT NULL default '-',
T_RECOMPILE char(1) NOT NULL default '-',
T_NORUN char(1) NOT NULL default '-',
T_NEEDLIBRARY char(1) NOT NULL default '-',
T_KNOWNRUNERROR int(11) NOT NULL default '0',
T_KNOWN char(1) NOT NULL default '-',
T_NOTE varchar(255) default NULL,
T_DESCRIPTION text,
T_SOURCE text,
T_OPTS varchar(255) default NULL,
PRIMARY KEY (T_ID),
UNIQUE KEY T_NAME (T_NAME)
);
CREATE TABLE TESTRESULTS (
TR_ID int(11) NOT NULL auto_increment,
TR_TESTRUN_FK int(11) NOT NULL default '0',
TR_TEST_FK int(11) default NULL,
TR_OK char(1) NOT NULL default '-',
TR_SKIP char(1) NOT NULL default '-',
TR_RESULT int(11) NOT NULL default '0',
TR_LOG text,
PRIMARY KEY (TR_ID),
UNIQUE KEY TR_TESTCOMP (TR_TESTRUN_FK,TR_TEST_FK),
KEY I_TRTESTRUN (TR_TESTRUN_FK),
KEY I_TRTEST (TR_TEST_FK)
);
CREATE TABLE TESTRUN (
TU_ID int(11) NOT NULL auto_increment,
TU_DATE timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
TU_CPU_FK int(11) NOT NULL default '0',
TU_OS_FK int(11) NOT NULL default '0',
TU_VERSION_FK int(11) NOT NULL default '0',
TU_CATEGORY_FK int(11) NOT NULL default '1',
TU_FAILEDTOCOMPILE int(11) NOT NULL default '0',
TU_SUCCESSFULLYFAILED int(11) NOT NULL default '0',
TU_FAILEDTOFAIL int(11) NOT NULL default '0',
TU_SUCCESFULLYCOMPILED int(11) NOT NULL default '0',
TU_FAILEDTORUN int(11) NOT NULL default '0',
TU_KNOWNPROBLEM int(11) NOT NULL default '0',
TU_SUCCESSFULLYRUN int(11) NOT NULL default '0',
TU_SKIPPEDGRAPHTEST int(11) NOT NULL default '0',
TU_SKIPPEDINTERACTIVETEST int(11) NOT NULL default '0',
TU_KNOWNBUG int(11) NOT NULL default '0',
TU_COMPILERVERIONTOOLOW int(11) NOT NULL default '0',
TU_COMPILERVERIONTOOHIGH int(11) NOT NULL default '0',
TU_OTHERCPU int(11) NOT NULL default '0',
TU_OTHERTARGET int(11) NOT NULL default '0',
TU_UNIT int(11) NOT NULL default '0',
TU_SKIPPINGRUNTEST int(11) NOT NULL default '0',
TU_SUBMITTER varchar(128) NOT NULL default '',
TU_MACHINE varchar(128) NOT NULL default '',
TU_COMMENT varchar(255) NOT NULL default '',
PRIMARY KEY (TU_ID),
UNIQUE KEY TU_OVERVIEW (TU_ID,TU_CPU_FK,TU_OS_FK,TU_VERSION_FK,TU_DATE),
KEY TU_IDATE (TU_DATE)
);
CREATE TABLE `TESTCATEGORY` (
TCAT_ID int(11) NOT NULL auto_increment,
TCAT_NAME varchar(20) default NULL,
PRIMARY KEY (`TCAT_ID`),
UNIQUE KEY `TCAT_NAME` (`TCAT_NAME`)
) AUTO_INCREMENT=3 ;
CREATE TABLE TESTOS (
TO_ID int(11) NOT NULL auto_increment,
TO_NAME varchar(10) default NULL,
PRIMARY KEY (`TO_ID`),
UNIQUE KEY `TR_INAME` (`TO_NAME`)
) AUTO_INCREMENT=18 ;
CREATE TABLE TESTVERSION (
TV_ID int(11) NOT NULL auto_increment,
TV_VERSION varchar(10) default NULL,
TV_RELEASEDATE timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
PRIMARY KEY (TV_ID),
UNIQUE KEY TR_INAME (TV_VERSION)
) AUTO_INCREMENT=7;
CREATE TABLE TESTCPU (
TC_ID int(11) NOT NULL auto_increment,
TC_NAME varchar(10) default NULL,
PRIMARY KEY (TC_ID),
UNIQUE KEY TC_INAME (TC_NAME)
) AUTO_INCREMENT=10 ;
INSERT INTO TESTCATEGORY VALUES (1, 'Compiler/RTL');
INSERT INTO TESTCATEGORY VALUES (2, 'DB');
ALTER SEQUENCE SEQ_TESTCATEGORY RESTART WITH 3;
INSERT INTO TESTCPU VALUES (1, 'i386');
INSERT INTO TESTCPU VALUES (6, 'arm');
INSERT INTO TESTCPU VALUES (3, 'm68k');
INSERT INTO TESTCPU VALUES (4, 'sparc');
INSERT INTO TESTCPU VALUES (5, 'powerpc');
INSERT INTO TESTCPU VALUES (7, 'x86_64');
INSERT INTO TESTCPU VALUES (8, 'All');
INSERT INTO TESTCPU VALUES (9, 'powerpc64');
INSERT INTO TESTCPU VALUES (10, 'wasm32');
INSERT INTO TESTCPU VALUES (11, 'longsoon');
INSERT INTO TESTCPU VALUES (12, 'longsoon64');
INSERT INTO TESTCPU VALUES (13, 'mips');
INSERT INTO TESTCPU VALUES (14, 'mips64');
INSERT INTO TESTCPU VALUES (15, 'avr');
INSERT INTO TESTCPU VALUES (16, 'xtensa');
ALTER SEQUENCE SEQ_TESTCPU RESTART WITH 17;
INSERT INTO TESTOS VALUES (1, 'linux');
INSERT INTO TESTOS VALUES (2, 'win32');
INSERT INTO TESTOS VALUES (3, 'go32v2');
INSERT INTO TESTOS VALUES (4, 'os2');
INSERT INTO TESTOS VALUES (5, 'freebsd');
INSERT INTO TESTOS VALUES (6, 'netbsd');
INSERT INTO TESTOS VALUES (7, 'openbsd');
INSERT INTO TESTOS VALUES (8, 'amiga');
INSERT INTO TESTOS VALUES (9, 'atari');
INSERT INTO TESTOS VALUES (10, 'qnx');
INSERT INTO TESTOS VALUES (11, 'beos');
INSERT INTO TESTOS VALUES (12, 'solaris');
INSERT INTO TESTOS VALUES (13, 'darwin');
INSERT INTO TESTOS VALUES (14, 'macos');
INSERT INTO TESTOS VALUES (15, 'All');
INSERT INTO TESTOS VALUES (16, 'win64');
INSERT INTO TESTOS VALUES (17, 'wince');
INSERT INTO TESTOS VALUES (18, 'wasi');
ALTER SEQUENCE SEQ_TESTOS RESTART WITH 19;
INSERT INTO TESTVERSION VALUES (1, '2.0.4', '2006-08-22 22:38:20');
INSERT INTO TESTVERSION VALUES (2, '2.0.5', '2006-08-22 22:38:20');
INSERT INTO TESTVERSION VALUES (3, '2.3.1', '2007-03-04 23:40:07');
INSERT INTO TESTVERSION VALUES (4, '2.1.2', '2007-03-19 10:49:30');
INSERT INTO TESTVERSION VALUES (5, '2.1.3', '2007-03-19 10:49:47');
INSERT INTO TESTVERSION VALUES (6, '2.1.4', '2007-03-19 10:50:03');
INSERT INTO TESTVERSION VALUES (7, '3.2.2', '2020-04-01 10:50:03');
INSERT INTO TESTVERSION VALUES (8, '3.3.1', '2020-04-01 10:50:03');
ALTER SEQUENCE SEQ_TESTVERSION RESTART WITH 9;

View File

@ -162,3 +162,53 @@ CREATE TABLE TESTPREVIOUSRESULTS (
CREATE UNIQUE INDEX UDX_TESTPREVIOUSRESULTS ON TESTPREVIOUSRESULTS(TPR_PLATFORM_FK,TPR_TEST_FK);
INSERT INTO TESTCATEGORY VALUES (1, 'Compiler/RTL');
INSERT INTO TESTCATEGORY VALUES (2, 'DB');
ALTER SEQUENCE SEQ_TESTCATEGORY RESTART WITH 3;
INSERT INTO TESTCPU VALUES (1, 'i386');
INSERT INTO TESTCPU VALUES (6, 'arm');
INSERT INTO TESTCPU VALUES (3, 'm68k');
INSERT INTO TESTCPU VALUES (4, 'sparc');
INSERT INTO TESTCPU VALUES (5, 'powerpc');
INSERT INTO TESTCPU VALUES (7, 'x86_64');
INSERT INTO TESTCPU VALUES (8, 'All');
INSERT INTO TESTCPU VALUES (9, 'powerpc64');
INSERT INTO TESTCPU VALUES (10, 'wasm32');
INSERT INTO TESTCPU VALUES (11, 'longsoon');
INSERT INTO TESTCPU VALUES (12, 'longsoon64');
INSERT INTO TESTCPU VALUES (13, 'mips');
INSERT INTO TESTCPU VALUES (14, 'mips64');
INSERT INTO TESTCPU VALUES (15, 'avr');
INSERT INTO TESTCPU VALUES (16, 'xtensa');
ALTER SEQUENCE SEQ_TESTCPU RESTART WITH 17;
INSERT INTO TESTOS VALUES (1, 'linux');
INSERT INTO TESTOS VALUES (2, 'win32');
INSERT INTO TESTOS VALUES (3, 'go32v2');
INSERT INTO TESTOS VALUES (4, 'os2');
INSERT INTO TESTOS VALUES (5, 'freebsd');
INSERT INTO TESTOS VALUES (6, 'netbsd');
INSERT INTO TESTOS VALUES (7, 'openbsd');
INSERT INTO TESTOS VALUES (8, 'amiga');
INSERT INTO TESTOS VALUES (9, 'atari');
INSERT INTO TESTOS VALUES (10, 'qnx');
INSERT INTO TESTOS VALUES (11, 'beos');
INSERT INTO TESTOS VALUES (12, 'solaris');
INSERT INTO TESTOS VALUES (13, 'darwin');
INSERT INTO TESTOS VALUES (14, 'macos');
INSERT INTO TESTOS VALUES (15, 'All');
INSERT INTO TESTOS VALUES (16, 'win64');
INSERT INTO TESTOS VALUES (17, 'wince');
INSERT INTO TESTOS VALUES (18, 'wasi');
ALTER SEQUENCE SEQ_TESTOS RESTART WITH 19;
INSERT INTO TESTVERSION VALUES (1, '2.0.4', '2006-08-22 22:38:20');
INSERT INTO TESTVERSION VALUES (2, '2.0.5', '2006-08-22 22:38:20');
INSERT INTO TESTVERSION VALUES (3, '2.3.1', '2007-03-04 23:40:07');
INSERT INTO TESTVERSION VALUES (4, '2.1.2', '2007-03-19 10:49:30');
INSERT INTO TESTVERSION VALUES (5, '2.1.3', '2007-03-19 10:49:47');
INSERT INTO TESTVERSION VALUES (6, '2.1.4', '2007-03-19 10:50:03');
INSERT INTO TESTVERSION VALUES (7, '3.2.2', '2020-04-01 10:50:03');
INSERT INTO TESTVERSION VALUES (8, '3.3.1', '2020-04-01 10:50:03');
ALTER SEQUENCE SEQ_TESTVERSION RESTART WITH 9;

View File

@ -1,61 +0,0 @@
-- MySQL dump 8.22
--
-- Host: localhost Database: TESTSUITE
---------------------------------------------------------
-- Server version 3.23.52-log
--
-- Dumping data for table 'TESTCPU'
--
INSERT INTO TESTCPU VALUES (1,'i386');
INSERT INTO TESTCPU VALUES (6,'arm');
INSERT INTO TESTCPU VALUES (3,'m68k');
INSERT INTO TESTCPU VALUES (4,'sparc');
INSERT INTO TESTCPU VALUES (5,'powerpc');
INSERT INTO TESTCPU VALUES (7,'x86_64');
INSERT INTO TESTCPU VALUES (0,'All');
--
-- Dumping data for table 'TESTOS'
--
INSERT INTO TESTOS VALUES (1,'linux');
INSERT INTO TESTOS VALUES (2,'win32');
INSERT INTO TESTOS VALUES (3,'go32v2');
INSERT INTO TESTOS VALUES (4,'os2');
INSERT INTO TESTOS VALUES (5,'freebsd');
INSERT INTO TESTOS VALUES (6,'netbsd');
INSERT INTO TESTOS VALUES (7,'openbsd');
INSERT INTO TESTOS VALUES (8,'amiga');
INSERT INTO TESTOS VALUES (9,'atari');
INSERT INTO TESTOS VALUES (10,'qnx');
INSERT INTO TESTOS VALUES (11,'beos');
INSERT INTO TESTOS VALUES (12,'sunos');
INSERT INTO TESTOS VALUES (13,'darwin');
INSERT INTO TESTOS VALUES (14,'macos');
INSERT INTO TESTOS VALUES (0,'All');
--
-- Dumping data for table 'TESTVERSION'
--
INSERT INTO TESTVERSION VALUES (1,'1.0.6',20021220154940);
INSERT INTO TESTVERSION VALUES (2,'1.0.7',20021220154940);
INSERT INTO TESTVERSION VALUES (3,'1.0.8',20021220154940);
INSERT INTO TESTVERSION VALUES (4,'1.1.0',20021220154940);
INSERT INTO TESTVERSION VALUES (5,'1.1',20021220155122);
INSERT INTO TESTVERSION VALUES (6,'1.0.10',20030601155122);
INSERT INTO TESTVERSION VALUES (7,'1.9.0',20031103164832);
INSERT INTO TESTVERSION VALUES (8,'1.9.1',20031103165215);
INSERT INTO TESTVERSION VALUES (9,'1.9.2',20040104182007);
INSERT INTO TESTVERSION VALUES (10,'1.9.3',20040104182038);
INSERT INTO TESTVERSION VALUES (11,'1.0.11',20040225131159);
INSERT INTO TESTVERSION VALUES (12,'1.9.4',20040531101027);
INSERT INTO TESTVERSION VALUES (13,'1.9.5',20040531101036);
INSERT INTO TESTVERSION VALUES (0,'All',20040922232934);

View File

@ -1,94 +0,0 @@
--
-- Table structure for table 'TESTCPU'
--
CREATE TABLE TESTCPU (
TC_ID int(11) NOT NULL auto_increment,
TC_NAME varchar(10) default NULL,
PRIMARY KEY (TC_ID),
UNIQUE KEY TC_INAME (TC_NAME)
) TYPE=MyISAM;
--
-- Table structure for table 'TESTOS'
--
CREATE TABLE TESTOS (
TO_ID int(11) NOT NULL auto_increment,
TO_NAME varchar(10) default NULL,
PRIMARY KEY (TO_ID),
UNIQUE KEY TR_INAME (TO_NAME)
) TYPE=MyISAM;
--
-- Table structure for table 'TESTRESULTS'
--
CREATE TABLE TESTRUN (
TU_ID int(11) NOT NULL auto_increment,
TU_DATE timestamp(14) NOT NULL,
TU_CPU_FK int(11) NOT NULL,
TU_OS_FK int(11) NOT NULL,
TU_VERSION_FK int(11) NOT NULL,
PRIMARY KEY (TU_ID),
KEY TU_IDATE (TU_DATE),
UNIQUE TU_UNIQUE(TU_DATE,TU_CPU_FK,TU_OS_FK,TU_VERSION_FK)
) TYPE=MyISAM;
--
-- Table structure for table 'TESTRESULTS'
--
CREATE TABLE TESTRESULTS (
TR_ID int(11) NOT NULL auto_increment,
TR_TESTRUN_FK int(11) NOT NULL,
TR_TEST_FK int(11),
TR_OK char(1) NOT NULL default '-',
TR_SKIP char(1) NOT NULL default '-',
TR_RESULT int(11) NOT NULL default '0',
TR_LOG text,
PRIMARY KEY (TR_ID),
INDEX I_TRTESTRUN (TR_TESTRUN_FK),
INDEX I_TRTEST (TR_TEST_FK)
) TYPE=MyISAM;
--
-- Table structure for table 'TESTS'
--
CREATE TABLE TESTS (
T_ID int(11) NOT NULL auto_increment,
T_NAME varchar(80) NOT NULL default '',
T_FULLNAME varchar(255) NOT NULL default '',
T_CPU varchar(20) default NULL,
T_OS varchar(30) default NULL,
T_VERSION varchar(10) default NULL,
T_ADDDATE date NOT NULL default '0000-00-00',
T_GRAPH char(1) NOT NULL default '-',
T_INTERACTIVE char(1) NOT NULL default '-',
T_RESULT int(11) NOT NULL default '0',
T_FAIL char(1) NOT NULL default '-',
T_RECOMPILE char(1) NOT NULL default '-',
T_NORUN char(1) NOT NULL default '-',
T_NEEDLIBRARY char(1) NOT NULL default '-',
T_KNOWNRUNERROR int(11) NOT NULL default '0',
T_KNOWN char(1) NOT NULL default '-',
T_NOTE varchar(255) default NULL,
T_DESCRIPTION text,
T_SOURCE text,
T_OPTS varchar(255) default NULL,
PRIMARY KEY (T_ID),
UNIQUE KEY TESTNAME (T_NAME)
) TYPE=MyISAM;
--
-- Table structure for table 'TESTVERSION'
--
CREATE TABLE TESTVERSION (
TV_ID int(11) NOT NULL auto_increment,
TV_VERSION varchar(10) default NULL,
TV_RELEASEDATE timestamp(14) NOT NULL,
PRIMARY KEY (TV_ID),
UNIQUE KEY TR_INAME (TV_VERSION)
) TYPE=MyISAM;