Data Store DDLs

JDBC Database DDLs

MOCA Database DDLs

MySql for Cycle version 2.2.0 (Run first for later versions)

CREATE TABLE cycle_test_execution (
execution_id varchar(100) NOT NULL,
  execution_start_ts datetime(3) NOT NULL,
  cycle_user varchar(100) NOT NULL,
  cycle_version varchar(100) NOT NULL,
  hardware_id varchar(100) NOT NULL,
  computer_username varchar(100) NOT NULL,
  os varchar(100) NOT NULL,
  invoker varchar(100) NOT NULL,
  PRIMARY KEY (execution_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE cycle_execution_results (
  execution_id varchar(100) NOT NULL,
  node_id varchar(255) NOT NULL,
  parent_node_id varchar(255) DEFAULT NULL,
  sending_node_id varchar(255) NOT NULL,
  node_sequence int(11) NOT NULL,
  node_type varchar(100) NOT NULL,
  block_type varchar(100) DEFAULT NULL,
  name TEXT DEFAULT NULL,
  status varchar(100) NOT NULL,
  message TEXT DEFAULT NULL,
  error_message TEXT DEFAULT NULL,
  file_uri TEXT DEFAULT NULL,
  start_line int(11) DEFAULT NULL,
  end_line int(11) DEFAULT NULL,
  data_file_path TEXT DEFAULT NULL,
  worker_name TEXT DEFAULT NULL,
  tags TEXT DEFAULT NULL,
  step_id varchar(100) DEFAULT NULL,
  delay_start_time datetime(3) DEFAULT NULL,
  start_time datetime(3) NOT NULL,
  end_time datetime(3) DEFAULT NULL,
  PRIMARY KEY (execution_id,node_id),
  CONSTRAINT FK_cycle_execution_results FOREIGN KEY (execution_id) REFERENCES cycle_test_execution (execution_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE  INDEX cycle_node_type_IDX ON cycle_execution_results (node_type) USING BTREE;;
CREATE  INDEX cycle_parent_node_IDX ON cycle_execution_results (execution_id,parent_node_id) USING BTREE;;
CREATE  INDEX cycle_sending_node_IDX ON cycle_execution_results (execution_id,sending_node_id) USING BTREE;;

CREATE VIEW cycle_execution_view AS
SELECT test.execution_id,
       test.cycle_user,
       test.os,
       test.computer_username,
       test.hardware_id,
       test.cycle_version,
       cyc_group.name as group_name,
       cyc_group.data_file_path,
       worker.worker_name,
       dtl.node_id,
       dtl.node_type,
       dtl.name,
       dtl.block_type,
       dtl.tags,
       dtl.status,
       dtl.message,
       dtl.error_message,
       dtl.file_uri,
       dtl.start_line,
       dtl.end_line,
       dtl.delay_start_time,
       dtl.start_time,
       dtl.end_time,
       CEIL((dtl.end_time - dtl.start_time) * 1000) as duration,
       CEIL((dtl.end_time - dtl.delay_start_time) * 1000) as duration_with_delay,
       dtl.node_sequence
  from cycle_test_execution as test
  join cycle_execution_results as dtl
    on test.execution_id = dtl.execution_id
   and node_type not in ('Group','GroupTest','ConditionalBlock','ConditionalExpression')
  left join (select execution_id, node_id, parent_node_id, sending_node_id, worker_name from cycle_execution_results where node_type = 'Feature') as worker
    on dtl.execution_id = worker.execution_id
   and dtl.sending_node_id = worker.node_id
  left join (select execution_id, node_id, name, data_file_path from cycle_execution_results where node_type = 'Group') as cyc_group
    on worker.execution_id = cyc_group.execution_id
   and worker.parent_node_id = cyc_group.node_id;

MySql for Cycle version 2.3.0

CREATE TABLE cycle_image (
  id varchar(100) NOT NULL,
  image LONGBLOB,
  PRIMARY KEY (id)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;
CREATE TABLE cycle_image_results (
  id varchar(100) NOT NULL,
  execution_id varchar(100) NOT NULL,
  node_id varchar(255) NOT NULL,
  template_file TEXT,
  template_image_id varchar(100) DEFAULT NULL,
  screenshot_image_id varchar(100) DEFAULT NULL,
  found_image BOOL DEFAULT NULL,
  min_value DOUBLE DEFAULT NULL,
  max_value DOUBLE DEFAULT NULL,
  min_location_x int(11) DEFAULT NULL,
  min_location_y int(11) DEFAULT NULL,
  max_location_x int(11) DEFAULT NULL,
  max_location_y int(11) DEFAULT NULL,
  source_width int(11) DEFAULT NULL,
  source_height int(11) DEFAULT NULL,
  template_width int(11) DEFAULT NULL,
  template_height int(11) DEFAULT NULL,
  correlation_threshold DOUBLE DEFAULT NULL,
  PRIMARY KEY (id) ,
  CONSTRAINT FK_CYCLE_IMAGE_RESULTS FOREIGN KEY (execution_id, node_id) REFERENCES cycle_execution_results (execution_id,node_id) ,
  CONSTRAINT FK_CYCLE_TERMINAL_T FOREIGN KEY (template_image_id) REFERENCES cycle_image (id) ,
  CONSTRAINT FK_CYCLE_TERMINAL_S FOREIGN KEY (screenshot_image_id) REFERENCES cycle_image (id)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;


CREATE TABLE cycle_terminal_screens (
  id varchar(100) NOT NULL,
  execution_id varchar(100) NOT NULL,
  node_id varchar(255) NOT NULL,
  screen TEXT,
  PRIMARY KEY (id) ,
  CONSTRAINT FK_CYCLE_TERMINAL FOREIGN KEY (execution_id,node_id) REFERENCES cycle_execution_results (execution_id,node_id)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;


CREATE TABLE cycle_file_diagnostics (
  id varchar(100) NOT NULL,
  execution_id varchar(100) NOT NULL,
  node_id varchar(255) NOT NULL,
  start_line int(11),
  start_character int(11),
  end_line int(11),
  end_character int(11),
  message TEXT,
  severity varchar(100),
  code int(11),
  source TEXT,
  PRIMARY KEY (id) ,
  CONSTRAINT FK_FILE_DIAGNOSTICS FOREIGN KEY (execution_id,node_id) REFERENCES cycle_execution_results (execution_id,node_id)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;

SqlServer for Cycle version 2.2.0 (Run first for later versions)

CREATE TABLE cycle_test_execution (
execution_id nvarchar(100) NOT NULL,
execution_start_ts datetime2(7) NOT NULL,
cycle_user nvarchar(100) NOT NULL,
cycle_version nvarchar(100) NOT NULL,
hardware_id nvarchar(100) NOT NULL,
computer_username nvarchar(100) NOT NULL,
os nvarchar(100) NOT NULL,
invoker nvarchar(100) NOT NULL,
CONSTRAINT PK_test_execution PRIMARY KEY (execution_id)
) ;

CREATE TABLE cycle_execution_results (
execution_id nvarchar(100) NOT NULL,
node_id nvarchar(255) NOT NULL,
parent_node_id nvarchar(255) DEFAULT NULL,
sending_node_id nvarchar(255) NOT NULL,
node_sequence int NOT NULL,
node_type nvarchar(100) NOT NULL,
block_type nvarchar(100) DEFAULT NULL,
name TEXT DEFAULT NULL,
status nvarchar(100) NOT NULL,
message TEXT DEFAULT NULL,
error_message TEXT DEFAULT NULL,
file_uri TEXT DEFAULT NULL,
start_line int DEFAULT NULL,
end_line int DEFAULT NULL,
data_file_path TEXT DEFAULT NULL,
worker_name TEXT DEFAULT NULL,
tags TEXT DEFAULT NULL,
step_id nvarchar(100) DEFAULT NULL,
delay_start_time datetime2(7) DEFAULT NULL,
start_time datetime2(7) NOT NULL,
end_time datetime2(7) DEFAULT NULL,
CONSTRAINT PK_cycle_execution_results PRIMARY KEY (execution_id,node_id),
CONSTRAINT FK_cycle_execution_results FOREIGN KEY (execution_id) REFERENCES cycle_test_execution(execution_id)
) ;
CREATE  INDEX cycle_node_type_IDX ON cycle_execution_results (node_type);;
CREATE  INDEX cycle_parent_node_IDX ON cycle_execution_results (execution_id,parent_node_id);;
CREATE  INDEX cycle_sending_node_IDX ON cycle_execution_results (execution_id,sending_node_id);;

CREATE VIEW cycle_execution_view AS
SELECT test.execution_id,
   test.cycle_user,
   test.os,
   test.computer_username,
   test.hardware_id,
   test.cycle_version,
   cyc_group.name as group_name,
   cyc_group.data_file_path,
   worker.worker_name,
   dtl.node_id,
   dtl.node_type,
   dtl.name,
   dtl.block_type,
   dtl.tags,
   dtl.status,
   dtl.message,
   dtl.error_message,
   dtl.file_uri,
   dtl.start_line,
   dtl.end_line,
   dtl.delay_start_time,
   dtl.start_time,
   dtl.end_time,
   DATEDIFF(millisecond, dtl.start_time, dtl.end_time) as duration,
   DATEDIFF(millisecond, dtl.delay_start_time, dtl.end_time) as duration_with_delay,
   dtl.node_sequence
from cycle_test_execution as test
join cycle_execution_results as dtl
on test.execution_id = dtl.execution_id
and node_type not in ('Group','GroupTest','ConditionalBlock','ConditionalExpression')
left join (select execution_id, node_id, parent_node_id, sending_node_id, worker_name from cycle_execution_results where node_type = 'Feature') as worker
on dtl.execution_id = worker.execution_id
and dtl.sending_node_id = worker.node_id
left join (select execution_id, node_id, name, data_file_path from cycle_execution_results where node_type = 'Group') as cyc_group
on worker.execution_id = cyc_group.execution_id
and worker.parent_node_id = cyc_group.node_id;

SqlServer for Cycle version 2.3.0

CREATE TABLE cycle_image (
  id nvarchar(100) NOT NULL,
  image varbinary(MAX),
  CONSTRAINT PK_CYCLE_IMAGE PRIMARY KEY (id)
 )  ;
CREATE TABLE cycle_image_results (
  id nvarchar(100) NOT NULL,
  execution_id nvarchar(100) NOT NULL,
  node_id nvarchar(255) NOT NULL,
  template_file TEXT,
  template_image_id nvarchar(100) DEFAULT NULL,
  screenshot_image_id nvarchar(100) DEFAULT NULL,
  found_image BIT DEFAULT NULL,
  min_value FLOAT DEFAULT NULL,
  max_value FLOAT DEFAULT NULL,
  min_location_x int DEFAULT NULL,
  min_location_y int DEFAULT NULL,
  max_location_x int DEFAULT NULL,
  max_location_y int DEFAULT NULL,
  source_width int DEFAULT NULL,
  source_height int DEFAULT NULL,
  template_width int DEFAULT NULL,
  template_height int DEFAULT NULL,
  correlation_threshold FLOAT DEFAULT NULL,
  CONSTRAINT PK_CYCLE_IMAGE_RESULTS PRIMARY KEY (id) ,
  CONSTRAINT FK_CYCLE_IMAGE_RESULTS FOREIGN KEY (execution_id, node_id) REFERENCES cycle_execution_results(execution_id,node_id) ,
  CONSTRAINT FK_CYCLE_TERMINAL_T FOREIGN KEY (template_image_id) REFERENCES cycle_image(id) ,
  CONSTRAINT FK_CYCLE_TERMINAL_S FOREIGN KEY (screenshot_image_id) REFERENCES cycle_image(id)
 )  ;


CREATE TABLE cycle_terminal_screens (
  id nvarchar(100) NOT NULL,
  execution_id nvarchar(100) NOT NULL,
  node_id nvarchar(255) NOT NULL,
  screen TEXT,
  CONSTRAINT PK_CYCLE_TERMINAL PRIMARY KEY (id) ,
  CONSTRAINT FK_CYCLE_TERMINAL FOREIGN KEY (execution_id,node_id) REFERENCES cycle_execution_results(execution_id,node_id)
 )  ;


CREATE TABLE cycle_file_diagnostics (
  id nvarchar(100) NOT NULL,
  execution_id nvarchar(100) NOT NULL,
  node_id nvarchar(255) NOT NULL,
  start_line int,
  start_character int,
  end_line int,
  end_character int,
  message TEXT,
  severity nvarchar(100),
  code int,
  source TEXT,
  CONSTRAINT PK_FILE_DIAGNOSTICS PRIMARY KEY (id) ,
  CONSTRAINT FK_FILE_DIAGNOSTICS FOREIGN KEY (execution_id,node_id) REFERENCES cycle_execution_results(execution_id,node_id)
 )  ;

Oracle for Cycle version 2.2.0 (Run first for later versions)

CREATE TABLE cycle_test_execution (
execution_id VARCHAR2(100) NOT NULL,
execution_start_ts timestamp(6) NOT NULL,
cycle_user VARCHAR2(100) NOT NULL,
cycle_version VARCHAR2(100) NOT NULL,
hardware_id VARCHAR2(100) NOT NULL,
computer_username VARCHAR2(100) NOT NULL,
os VARCHAR2(100) NOT NULL,
invoker VARCHAR2(100) NOT NULL,
CONSTRAINT PK_test_execution PRIMARY KEY (execution_id)
) ;

CREATE TABLE cycle_execution_results (
execution_id VARCHAR2(100) NOT NULL,
node_id VARCHAR2(255) NOT NULL,
parent_node_id VARCHAR2(255) DEFAULT NULL,
sending_node_id VARCHAR2(255) NOT NULL,
node_sequence int NOT NULL,
node_type VARCHAR2(100) NOT NULL,
block_type VARCHAR2(100) DEFAULT NULL,
name VARCHAR2(4000) DEFAULT NULL,
status VARCHAR2(100) NOT NULL,
message VARCHAR2(4000) DEFAULT NULL,
error_message VARCHAR2(4000) DEFAULT NULL,
file_uri VARCHAR2(4000) DEFAULT NULL,
start_line int DEFAULT NULL,
end_line int DEFAULT NULL,
data_file_path VARCHAR2(4000) DEFAULT NULL,
worker_name VARCHAR2(4000) DEFAULT NULL,
tags VARCHAR2(4000) DEFAULT NULL,
step_id VARCHAR2(100) DEFAULT NULL,
delay_start_time timestamp(6) DEFAULT NULL,
start_time timestamp(6) NOT NULL,
end_time timestamp(6) DEFAULT NULL,
CONSTRAINT PK_cycle_execution_results PRIMARY KEY (execution_id,node_id),
CONSTRAINT FK_cycle_execution_results FOREIGN KEY (execution_id) REFERENCES cycle_test_execution (execution_id)
) ;
CREATE  INDEX cycle_node_type_IDX ON cycle_execution_results (node_type);;
CREATE  INDEX cycle_parent_node_IDX ON cycle_execution_results (execution_id,parent_node_id);;
CREATE  INDEX cycle_sending_node_IDX ON cycle_execution_results (execution_id,sending_node_id);;

CREATE VIEW cycle_execution_view AS
SELECT test.execution_id,
   test.cycle_user,
   test.os,
   test.computer_username,
   test.hardware_id,
   test.cycle_version,
   cyc_group.name as group_name,
   cyc_group.data_file_path,
   worker.worker_name,
   dtl.node_id,
   dtl.node_type,
   dtl.name,
   dtl.block_type,
   dtl.tags,
   dtl.status,
   dtl.message,
   dtl.error_message,
   dtl.file_uri,
   dtl.start_line,
   dtl.end_line,
   dtl.delay_start_time,
   dtl.start_time,
   dtl.end_time,
   (sysdate + (dtl.end_time - dtl.start_time) * 1000 - sysdate) * 86400 as duration,
   (sysdate + (dtl.end_time - dtl.delay_start_time) * 1000 - sysdate) * 86400 as duration_with_delay,
   dtl.node_sequence
from cycle_test_execution  test
join cycle_execution_results  dtl
on test.execution_id = dtl.execution_id
and node_type not in ('Group','GroupTest','ConditionalBlock','ConditionalExpression')
left join (select execution_id, node_id, parent_node_id, sending_node_id, worker_name from cycle_execution_results where node_type = 'Feature')  worker
on dtl.execution_id = worker.execution_id
and dtl.sending_node_id = worker.node_id
left join (select execution_id, node_id, name, data_file_path from cycle_execution_results where node_type = 'Group')  cyc_group
on worker.execution_id = cyc_group.execution_id
and worker.parent_node_id = cyc_group.node_id;

Oracle for Cycle version 2.3.0

CREATE TABLE cycle_image (
  id VARCHAR2(100) NOT NULL,
  image BLOB,
  CONSTRAINT PK_CYCLE_IMAGE PRIMARY KEY (id)
 )  ;
CREATE TABLE cycle_image_results (
  id VARCHAR2(100) NOT NULL,
  execution_id VARCHAR2(100) NOT NULL,
  node_id VARCHAR2(255) NOT NULL,
  template_file VARCHAR2(4000),
  template_image_id VARCHAR2(100) DEFAULT NULL,
  screenshot_image_id VARCHAR2(100) DEFAULT NULL,
  found_image CHAR(1) DEFAULT NULL,
  min_value BINARY_DOUBLE DEFAULT NULL,
  max_value BINARY_DOUBLE DEFAULT NULL,
  min_location_x int DEFAULT NULL,
  min_location_y int DEFAULT NULL,
  max_location_x int DEFAULT NULL,
  max_location_y int DEFAULT NULL,
  source_width int DEFAULT NULL,
  source_height int DEFAULT NULL,
  template_width int DEFAULT NULL,
  template_height int DEFAULT NULL,
  correlation_threshold BINARY_DOUBLE DEFAULT NULL,
  CONSTRAINT PK_CYCLE_IMAGE_RESULTS PRIMARY KEY (id) ,
  CONSTRAINT FK_CYCLE_IMAGE_RESULTS FOREIGN KEY (execution_id, node_id) REFERENCES cycle_execution_results (execution_id,node_id) ,
  CONSTRAINT FK_CYCLE_TERMINAL_T FOREIGN KEY (template_image_id) REFERENCES cycle_image (id) ,
  CONSTRAINT FK_CYCLE_TERMINAL_S FOREIGN KEY (screenshot_image_id) REFERENCES cycle_image (id)
 )  ;


CREATE TABLE cycle_terminal_screens (
  id VARCHAR2(100) NOT NULL,
  execution_id VARCHAR2(100) NOT NULL,
  node_id VARCHAR2(255) NOT NULL,
  screen VARCHAR2(4000),
  CONSTRAINT PK_CYCLE_TERMINAL PRIMARY KEY (id) ,
  CONSTRAINT FK_CYCLE_TERMINAL FOREIGN KEY (execution_id,node_id) REFERENCES cycle_execution_results (execution_id,node_id)
 )  ;


CREATE TABLE cycle_file_diagnostics (
  id VARCHAR2(100) NOT NULL,
  execution_id VARCHAR2(100) NOT NULL,
  node_id VARCHAR2(255) NOT NULL,
  start_line int,
  start_character int,
  end_line int,
  end_character int,
  message VARCHAR2(4000),
  severity VARCHAR2(100),
  code int,
  source VARCHAR2(4000),
  CONSTRAINT PK_FILE_DIAGNOSTICS PRIMARY KEY (id) ,
  CONSTRAINT FK_FILE_DIAGNOSTICS FOREIGN KEY (execution_id,node_id) REFERENCES cycle_execution_results (execution_id,node_id)
 )  ;

Db2 for Cycle version 2.2.0 (Run first for later versions)

CREATE TABLE cycle_test_execution (
execution_id VARCHAR(100) NOT NULL,
execution_start_ts TIMESTAMP NOT NULL,
cycle_user VARCHAR(100) NOT NULL,
cycle_version VARCHAR(100) NOT NULL,
hardware_id VARCHAR(100) NOT NULL,
computer_username VARCHAR(100) NOT NULL,
os VARCHAR(100) NOT NULL,
invoker VARCHAR(100) NOT NULL,
CONSTRAINT PK_test_execution PRIMARY KEY (execution_id)
) ;

CREATE TABLE cycle_execution_results (
execution_id VARCHAR(100) NOT NULL,
node_id VARCHAR(255) NOT NULL,
parent_node_id VARCHAR(255) DEFAULT NULL,
sending_node_id VARCHAR(255) NOT NULL,
node_sequence INT NOT NULL,
node_type VARCHAR(100) NOT NULL,
block_type VARCHAR(100) DEFAULT NULL,
name VARCHAR(8000) DEFAULT NULL,
status VARCHAR(100) NOT NULL,
message VARCHAR(8000) DEFAULT NULL,
error_message VARCHAR(8000) DEFAULT NULL,
file_uri VARCHAR(8000) DEFAULT NULL,
start_line INT DEFAULT NULL,
end_line INT DEFAULT NULL,
data_file_path VARCHAR(8000) DEFAULT NULL,
worker_name VARCHAR(8000) DEFAULT NULL,
tags VARCHAR(8000) DEFAULT NULL,
step_id VARCHAR(100) DEFAULT NULL,
delay_start_time TIMESTAMP DEFAULT NULL,
start_time TIMESTAMP NOT NULL,
end_time TIMESTAMP DEFAULT NULL,
CONSTRAINT PK_cycle_execution_results PRIMARY KEY (execution_id,node_id),
CONSTRAINT FK_cycle_execution_results FOREIGN KEY (execution_id) REFERENCES cycle_test_execution(execution_id)
) ;
CREATE  INDEX cycle_node_type_IDX ON cycle_execution_results (node_type);;
CREATE  INDEX cycle_parent_node_IDX ON cycle_execution_results (execution_id,parent_node_id);;
CREATE  INDEX cycle_sending_node_IDX ON cycle_execution_results (execution_id,sending_node_id);;

CREATE VIEW cycle_execution_view AS
SELECT test.execution_id,
   test.cycle_user,
   test.os,
   test.computer_username,
   test.hardware_id,
   test.cycle_version,
   cyc_group.name as group_name,
   cyc_group.data_file_path,
   worker.worker_name,
   dtl.node_id,
   dtl.node_type,
   dtl.name,
   dtl.block_type,
   dtl.tags,
   dtl.status,
   dtl.message,
   dtl.error_message,
   dtl.file_uri,
   dtl.start_line,
   dtl.end_line,
   dtl.delay_start_time,
   dtl.start_time,
   dtl.end_time,
   timestampdiff(1, char(dtl.end_time - dtl.start_time)) / 1000 as duration,
   timestampdiff(1, char(dtl.end_time - dtl.delay_start_time)) / 1000 as duration_with_delay,
   dtl.node_sequence
from cycle_test_execution as test
join cycle_execution_results as dtl
on test.execution_id = dtl.execution_id
and node_type not in ('Group','GroupTest','ConditionalBlock','ConditionalExpression')
left join (select execution_id, node_id, parent_node_id, sending_node_id, worker_name from cycle_execution_results where node_type = 'Feature') as worker
on dtl.execution_id = worker.execution_id
and dtl.sending_node_id = worker.node_id
left join (select execution_id, node_id, name, data_file_path from cycle_execution_results where node_type = 'Group') as cyc_group
on worker.execution_id = cyc_group.execution_id
and worker.parent_node_id = cyc_group.node_id;

Db2 for Cycle version: 2.3.0

CREATE TABLE cycle_image (
  id VARCHAR(100) NOT NULL,
  image BLOB,
  CONSTRAINT PK_CYCLE_IMAGE PRIMARY KEY (id)
 )  ;
CREATE TABLE cycle_image_results (
  id VARCHAR(100) NOT NULL,
  execution_id VARCHAR(100) NOT NULL,
  node_id VARCHAR(255) NOT NULL,
  template_file VARCHAR(8000),
  template_image_id VARCHAR(100) DEFAULT NULL,
  screenshot_image_id VARCHAR(100) DEFAULT NULL,
  found_image BOOLEAN DEFAULT NULL,
  min_value DOUBLE DEFAULT NULL,
  max_value DOUBLE DEFAULT NULL,
  min_location_x INT DEFAULT NULL,
  min_location_y INT DEFAULT NULL,
  max_location_x INT DEFAULT NULL,
  max_location_y INT DEFAULT NULL,
  source_width INT DEFAULT NULL,
  source_height INT DEFAULT NULL,
  template_width INT DEFAULT NULL,
  template_height INT DEFAULT NULL,
  correlation_threshold DOUBLE DEFAULT NULL,
  CONSTRAINT PK_CYCLE_IMAGE_RESULTS PRIMARY KEY (id) ,
  CONSTRAINT FK_CYCLE_IMAGE_RESULTS FOREIGN KEY (execution_id, node_id) REFERENCES cycle_execution_results(execution_id,node_id) ,
  CONSTRAINT FK_CYCLE_TERMINAL_T FOREIGN KEY (template_image_id) REFERENCES cycle_image(id) ,
  CONSTRAINT FK_CYCLE_TERMINAL_S FOREIGN KEY (screenshot_image_id) REFERENCES cycle_image(id)
 )  ;


CREATE TABLE cycle_terminal_screens (
  id VARCHAR(100) NOT NULL,
  execution_id VARCHAR(100) NOT NULL,
  node_id VARCHAR(255) NOT NULL,
  screen VARCHAR(8000),
  CONSTRAINT PK_CYCLE_TERMINAL PRIMARY KEY (id) ,
  CONSTRAINT FK_CYCLE_TERMINAL FOREIGN KEY (execution_id,node_id) REFERENCES cycle_execution_results(execution_id,node_id)
 )  ;


CREATE TABLE cycle_file_diagnostics (
  id VARCHAR(100) NOT NULL,
  execution_id VARCHAR(100) NOT NULL,
  node_id VARCHAR(255) NOT NULL,
  start_line INT,
  start_character INT,
  end_line INT,
  end_character INT,
  message VARCHAR(8000),
  severity VARCHAR(100),
  code INT,
  source VARCHAR(8000),
  CONSTRAINT PK_FILE_DIAGNOSTICS PRIMARY KEY (id) ,
  CONSTRAINT FK_FILE_DIAGNOSTICS FOREIGN KEY (execution_id,node_id) REFERENCES cycle_execution_results(execution_id,node_id)
 )  ;

Db2As400 for Cycle version 2.2.0 (Run first for later versions)

CREATE TABLE cycle_test_execution (
  execution_id VARCHAR(100) NOT NULL,
  execution_start_ts TIMESTAMP NOT NULL,
  cycle_user VARCHAR(100) NOT NULL,
  cycle_version VARCHAR(100) NOT NULL,
  hardware_id VARCHAR(100) NOT NULL,
  computer_username VARCHAR(100) NOT NULL,
  os VARCHAR(100) NOT NULL,
  invoker VARCHAR(100) NOT NULL,
  CONSTRAINT PK_test_execution PRIMARY KEY (execution_id)
) ;

CREATE TABLE cycle_execution_results (
  execution_id VARCHAR(100) NOT NULL,
  node_id VARCHAR(255) NOT NULL,
  parent_node_id VARCHAR(255) DEFAULT NULL,
  sending_node_id VARCHAR(255) NOT NULL,
  node_sequence INT NOT NULL,
  node_type VARCHAR(100) NOT NULL,
  block_type VARCHAR(100) DEFAULT NULL,
  name VARCHAR(8000) DEFAULT NULL,
  status VARCHAR(100) NOT NULL,
  message VARCHAR(8000) DEFAULT NULL,
  error_message VARCHAR(8000) DEFAULT NULL,
  file_uri VARCHAR(8000) DEFAULT NULL,
  start_line INT DEFAULT NULL,
  end_line INT DEFAULT NULL,
  data_file_path VARCHAR(8000) DEFAULT NULL,
  worker_name VARCHAR(8000) DEFAULT NULL,
  tags VARCHAR(8000) DEFAULT NULL,
  step_id VARCHAR(100) DEFAULT NULL,
  delay_start_time TIMESTAMP DEFAULT NULL,
  start_time TIMESTAMP NOT NULL,
  end_time TIMESTAMP DEFAULT NULL,
  CONSTRAINT PK_cycle_execution_results PRIMARY KEY (execution_id,node_id),
  CONSTRAINT FK_cycle_execution_results FOREIGN KEY (execution_id) REFERENCES cycle_test_execution(execution_id)
) ;
CREATE  INDEX cycle_node_type_IDX ON cycle_execution_results (node_type);;
CREATE  INDEX cycle_parent_node_IDX ON cycle_execution_results (execution_id,parent_node_id);;
CREATE  INDEX cycle_sending_node_IDX ON cycle_execution_results (execution_id,sending_node_id);;

CREATE VIEW cycle_execution_view AS
SELECT test.execution_id,
       test.cycle_user,
       test.os,
       test.computer_username,
       test.hardware_id,
       test.cycle_version,
       cyc_group.name as group_name,
       cyc_group.data_file_path,
       worker.worker_name,
       dtl.node_id,
       dtl.node_type,
       dtl.name,
       dtl.block_type,
       dtl.tags,
       dtl.status,
       dtl.message,
       dtl.error_message,
       dtl.file_uri,
       dtl.start_line,
       dtl.end_line,
       dtl.delay_start_time,
       dtl.start_time,
       dtl.end_time,
       timestampdiff(1, char(dtl.end_time - dtl.start_time)) / 1000 as duration,
       timestampdiff(1, char(dtl.end_time - dtl.delay_start_time)) / 1000 as duration_with_delay,
       dtl.node_sequence
  from cycle_test_execution as test
  join cycle_execution_results as dtl
    on test.execution_id = dtl.execution_id
   and node_type not in ('Group','GroupTest','ConditionalBlock','ConditionalExpression')
  left join (select execution_id, node_id, parent_node_id, sending_node_id, worker_name from cycle_execution_results where node_type = 'Feature') as worker
    on dtl.execution_id = worker.execution_id
   and dtl.sending_node_id = worker.node_id
  left join (select execution_id, node_id, name, data_file_path from cycle_execution_results where node_type = 'Group') as cyc_group
    on worker.execution_id = cyc_group.execution_id
   and worker.parent_node_id = cyc_group.node_id;

Db2As400 for Cycle version 2.3.0

   CREATE TABLE cycle_image (
     id VARCHAR(100) NOT NULL,
     image BLOB,
     CONSTRAINT PK_CYCLE_IMAGE PRIMARY KEY (id)
    )  ;
   CREATE TABLE cycle_image_results (
     id VARCHAR(100) NOT NULL,
     execution_id VARCHAR(100) NOT NULL,
     node_id VARCHAR(255) NOT NULL,
     template_file VARCHAR(8000),
     template_image_id VARCHAR(100) DEFAULT NULL,
     screenshot_image_id VARCHAR(100) DEFAULT NULL,
     found_image BOOLEAN DEFAULT NULL,
     min_value DOUBLE DEFAULT NULL,
     max_value DOUBLE DEFAULT NULL,
     min_location_x INT DEFAULT NULL,
     min_location_y INT DEFAULT NULL,
     max_location_x INT DEFAULT NULL,
     max_location_y INT DEFAULT NULL,
     source_width INT DEFAULT NULL,
     source_height INT DEFAULT NULL,
     template_width INT DEFAULT NULL,
     template_height INT DEFAULT NULL,
     correlation_threshold DOUBLE DEFAULT NULL,
     CONSTRAINT PK_CYCLE_IMAGE_RESULTS PRIMARY KEY (id) ,
     CONSTRAINT FK_CYCLE_IMAGE_RESULTS FOREIGN KEY (execution_id, node_id) REFERENCES cycle_execution_results(execution_id,node_id) ,
     CONSTRAINT FK_CYCLE_TERMINAL_T FOREIGN KEY (template_image_id) REFERENCES cycle_image(id) ,
     CONSTRAINT FK_CYCLE_TERMINAL_S FOREIGN KEY (screenshot_image_id) REFERENCES cycle_image(id)
    )  ;


   CREATE TABLE cycle_terminal_screens (
     id VARCHAR(100) NOT NULL,
     execution_id VARCHAR(100) NOT NULL,
     node_id VARCHAR(255) NOT NULL,
     screen VARCHAR(8000),
     CONSTRAINT PK_CYCLE_TERMINAL PRIMARY KEY (id) ,
     CONSTRAINT FK_CYCLE_TERMINAL FOREIGN KEY (execution_id,node_id) REFERENCES cycle_execution_results(execution_id,node_id)
    )  ;


   CREATE TABLE cycle_file_diagnostics (
     id VARCHAR(100) NOT NULL,
     execution_id VARCHAR(100) NOT NULL,
     node_id VARCHAR(255) NOT NULL,
     start_line INT,
     start_character INT,
     end_line INT,
     end_character INT,
     message VARCHAR(8000),
     severity VARCHAR(100),
     code INT,
     source VARCHAR(8000),
     CONSTRAINT PK_FILE_DIAGNOSTICS PRIMARY KEY (id) ,
     CONSTRAINT FK_FILE_DIAGNOSTICS FOREIGN KEY (execution_id,node_id) REFERENCES cycle_execution_results(execution_id,node_id)
    )  ;

H2 for Cycle version 2.2.0 (Run first for later versions)

CREATE TABLE cycle_test_execution (
  execution_id VARCHAR(100) NOT NULL,
  execution_start_ts TIMESTAMP NOT NULL,
  cycle_user VARCHAR(100) NOT NULL,
  cycle_version VARCHAR(100) NOT NULL,
  hardware_id VARCHAR(100) NOT NULL,
  computer_username VARCHAR(100) NOT NULL,
  os VARCHAR(100) NOT NULL,
  invoker VARCHAR(100) NOT NULL,
  CONSTRAINT PK_test_execution PRIMARY KEY (execution_id)
) ;

CREATE TABLE cycle_execution_results (
  execution_id VARCHAR(100) NOT NULL,
  node_id VARCHAR(255) NOT NULL,
  parent_node_id VARCHAR(255) DEFAULT NULL,
  sending_node_id VARCHAR(255) NOT NULL,
  node_sequence INT NOT NULL,
  node_type VARCHAR(100) NOT NULL,
  block_type VARCHAR(100) DEFAULT NULL,
  name VARCHAR DEFAULT NULL,
  status VARCHAR(100) NOT NULL,
  message VARCHAR DEFAULT NULL,
  error_message VARCHAR DEFAULT NULL,
  file_uri VARCHAR DEFAULT NULL,
  start_line INT DEFAULT NULL,
  end_line INT DEFAULT NULL,
  data_file_path VARCHAR DEFAULT NULL,
  worker_name VARCHAR DEFAULT NULL,
  tags VARCHAR DEFAULT NULL,
  step_id VARCHAR(100) DEFAULT NULL,
  delay_start_time TIMESTAMP DEFAULT NULL,
  start_time TIMESTAMP NOT NULL,
  end_time TIMESTAMP DEFAULT NULL,
  CONSTRAINT PK_cycle_execution_results PRIMARY KEY (execution_id,node_id),
  CONSTRAINT FK_cycle_execution_results FOREIGN KEY (execution_id) REFERENCES cycle_test_execution(execution_id)
) ;
CREATE  INDEX cycle_node_type_IDX ON cycle_execution_results (node_type);;
CREATE  INDEX cycle_parent_node_IDX ON cycle_execution_results (execution_id,parent_node_id);;
CREATE  INDEX cycle_sending_node_IDX ON cycle_execution_results (execution_id,sending_node_id);;

CREATE VIEW cycle_execution_view AS
SELECT test.execution_id,
       test.cycle_user,
       test.os,
       test.computer_username,
       test.hardware_id,
       test.cycle_version,
       cyc_group.name as group_name,
       cyc_group.data_file_path,
       worker.worker_name,
       dtl.node_id,
       dtl.node_type,
       dtl.name,
       dtl.block_type,
       dtl.tags,
       dtl.status,
       dtl.message,
       dtl.error_message,
       dtl.file_uri,
       dtl.start_line,
       dtl.end_line,
       dtl.delay_start_time,
       dtl.start_time,
       dtl.end_time,
       datediff('ms', dtl.start_time, dtl.end_time) as duration,
       datediff('ms', dtl.delay_start_time, dtl.end_time) as duration_with_delay,
       dtl.node_sequence
  from cycle_test_execution as test
  join cycle_execution_results as dtl
    on test.execution_id = dtl.execution_id
   and node_type not in ('Group','GroupTest','ConditionalBlock','ConditionalExpression')
  left join (select execution_id, node_id, parent_node_id, sending_node_id, worker_name from cycle_execution_results where node_type = 'Feature') as worker
    on dtl.execution_id = worker.execution_id
   and dtl.sending_node_id = worker.node_id
  left join (select execution_id, node_id, name, data_file_path from cycle_execution_results where node_type = 'Group') as cyc_group
    on worker.execution_id = cyc_group.execution_id
   and worker.parent_node_id = cyc_group.node_id;

H2 for Cycle version 2.3.0

   CREATE TABLE cycle_image (
     id VARCHAR(100) NOT NULL,
     image LONGBLOB,
     CONSTRAINT PK_CYCLE_IMAGE PRIMARY KEY (id)
    )  ;
   CREATE TABLE cycle_image_results (
     id VARCHAR(100) NOT NULL,
     execution_id VARCHAR(100) NOT NULL,
     node_id VARCHAR(255) NOT NULL,
     template_file VARCHAR,
     template_image_id VARCHAR(100) DEFAULT NULL,
     screenshot_image_id VARCHAR(100) DEFAULT NULL,
     found_image BOOLEAN DEFAULT NULL,
     min_value DOUBLE DEFAULT NULL,
     max_value DOUBLE DEFAULT NULL,
     min_location_x INT DEFAULT NULL,
     min_location_y INT DEFAULT NULL,
     max_location_x INT DEFAULT NULL,
     max_location_y INT DEFAULT NULL,
     source_width INT DEFAULT NULL,
     source_height INT DEFAULT NULL,
     template_width INT DEFAULT NULL,
     template_height INT DEFAULT NULL,
     correlation_threshold DOUBLE DEFAULT NULL,
     CONSTRAINT PK_CYCLE_IMAGE_RESULTS PRIMARY KEY (id) ,
     CONSTRAINT FK_CYCLE_IMAGE_RESULTS FOREIGN KEY (execution_id, node_id) REFERENCES cycle_execution_results(execution_id,node_id) ,
     CONSTRAINT FK_CYCLE_TERMINAL_T FOREIGN KEY (template_image_id) REFERENCES cycle_image(id) ,
     CONSTRAINT FK_CYCLE_TERMINAL_S FOREIGN KEY (screenshot_image_id) REFERENCES cycle_image(id)
    )  ;


   CREATE TABLE cycle_terminal_screens (
     id VARCHAR(100) NOT NULL,
     execution_id VARCHAR(100) NOT NULL,
     node_id VARCHAR(255) NOT NULL,
     screen VARCHAR,
     CONSTRAINT PK_CYCLE_TERMINAL PRIMARY KEY (id) ,
     CONSTRAINT FK_CYCLE_TERMINAL FOREIGN KEY (execution_id,node_id) REFERENCES cycle_execution_results(execution_id,node_id)
    )  ;


   CREATE TABLE cycle_file_diagnostics (
     id VARCHAR(100) NOT NULL,
     execution_id VARCHAR(100) NOT NULL,
     node_id VARCHAR(255) NOT NULL,
     start_line INT,
     start_character INT,
     end_line INT,
     end_character INT,
     message VARCHAR,
     severity VARCHAR(100),
     code INT,
     source VARCHAR,
     CONSTRAINT PK_FILE_DIAGNOSTICS PRIMARY KEY (id) ,
     CONSTRAINT FK_FILE_DIAGNOSTICS FOREIGN KEY (execution_id,node_id) REFERENCES cycle_execution_results(execution_id,node_id)
    )  ;

MOCA Database DDLs

MOCA SqlServer for Cycle version 2.2.0 (Run first for later versions)

CREATE TABLE uc_cycle_test_execution (
  execution_id nvarchar(100) NOT NULL,
  execution_start_ts datetime2(7) NOT NULL,
  cycle_user nvarchar(100) NOT NULL,
  cycle_version nvarchar(100) NOT NULL,
  hardware_id nvarchar(100) NOT NULL,
  computer_username nvarchar(100) NOT NULL,
  os nvarchar(100) NOT NULL,
  invoker nvarchar(100) NOT NULL,
  CONSTRAINT PK_test_execution PRIMARY KEY (execution_id)
) ;

CREATE TABLE uc_cycle_execution_results (
  execution_id nvarchar(100) NOT NULL,
  node_id nvarchar(255) NOT NULL,
  parent_node_id nvarchar(255) DEFAULT NULL,
  sending_node_id nvarchar(255) NOT NULL,
  node_sequence int NOT NULL,
  node_type nvarchar(100) NOT NULL,
  block_type nvarchar(100) DEFAULT NULL,
  name TEXT DEFAULT NULL,
  status nvarchar(100) NOT NULL,
  message TEXT DEFAULT NULL,
  error_message TEXT DEFAULT NULL,
  file_uri TEXT DEFAULT NULL,
  start_line int DEFAULT NULL,
  end_line int DEFAULT NULL,
  data_file_path TEXT DEFAULT NULL,
  worker_name TEXT DEFAULT NULL,
  tags TEXT DEFAULT NULL,
  step_id nvarchar(100) DEFAULT NULL,
  delay_start_time datetime2(7) DEFAULT NULL,
  start_time datetime2(7) NOT NULL,
  end_time datetime2(7) DEFAULT NULL,
  CONSTRAINT PK_cycle_execution_results PRIMARY KEY (execution_id,node_id),
  CONSTRAINT FK_cycle_execution_results FOREIGN KEY (execution_id) REFERENCES uc_cycle_test_execution(execution_id)
) ;
CREATE  INDEX cycle_node_type_IDX ON uc_cycle_execution_results (node_type);;
CREATE  INDEX cycle_parent_node_IDX ON uc_cycle_execution_results (execution_id,parent_node_id);;
CREATE  INDEX cycle_sending_node_IDX ON uc_cycle_execution_results (execution_id,sending_node_id);;

CREATE VIEW uc_cycle_execution_view AS
SELECT test.execution_id,
       test.cycle_user,
       test.os,
       test.computer_username,
       test.hardware_id,
       test.cycle_version,
       cyc_group.name as group_name,
       cyc_group.data_file_path,
       worker.worker_name,
       dtl.node_id,
       dtl.node_type,
       dtl.name,
       dtl.block_type,
       dtl.tags,
       dtl.status,
       dtl.message,
       dtl.error_message,
       dtl.file_uri,
       dtl.start_line,
       dtl.end_line,
       dtl.delay_start_time,
       dtl.start_time,
       dtl.end_time,
       DATEDIFF(millisecond, dtl.start_time, dtl.end_time) as duration,
       DATEDIFF(millisecond, dtl.delay_start_time, dtl.end_time) as duration_with_delay,
       dtl.node_sequence
  from uc_cycle_test_execution as test
  join uc_cycle_execution_results as dtl
    on test.execution_id = dtl.execution_id
   and node_type not in ('Group','GroupTest','ConditionalBlock','ConditionalExpression')
  left join (select execution_id, node_id, parent_node_id, sending_node_id, worker_name from uc_cycle_execution_results where node_type = 'Feature') as worker
    on dtl.execution_id = worker.execution_id
   and dtl.sending_node_id = worker.node_id
  left join (select execution_id, node_id, name, data_file_path from uc_cycle_execution_results where node_type = 'Group') as cyc_group
    on worker.execution_id = cyc_group.execution_id
   and worker.parent_node_id = cyc_group.node_id;

MOCA SqlServer for Cycle version 2.3.0

   CREATE TABLE uc_cycle_image (
     id nvarchar(100) NOT NULL,
     image varbinary(MAX),
     CONSTRAINT PK_CYCLE_IMAGE PRIMARY KEY (id)
    )  ;
   CREATE TABLE uc_cycle_image_results (
     id nvarchar(100) NOT NULL,
     execution_id nvarchar(100) NOT NULL,
     node_id nvarchar(255) NOT NULL,
     template_file TEXT,
     template_image_id nvarchar(100) DEFAULT NULL,
     screenshot_image_id nvarchar(100) DEFAULT NULL,
     found_image BIT DEFAULT NULL,
     min_value FLOAT DEFAULT NULL,
     max_value FLOAT DEFAULT NULL,
     min_location_x int DEFAULT NULL,
     min_location_y int DEFAULT NULL,
     max_location_x int DEFAULT NULL,
     max_location_y int DEFAULT NULL,
     source_width int DEFAULT NULL,
     source_height int DEFAULT NULL,
     template_width int DEFAULT NULL,
     template_height int DEFAULT NULL,
     correlation_threshold FLOAT DEFAULT NULL,
     CONSTRAINT PK_CYCLE_IMAGE_RESULTS PRIMARY KEY (id) ,
     CONSTRAINT FK_CYCLE_IMAGE_RESULTS FOREIGN KEY (execution_id, node_id) REFERENCES uc_cycle_execution_results(execution_id,node_id) ,
     CONSTRAINT FK_CYCLE_TERMINAL_T FOREIGN KEY (template_image_id) REFERENCES uc_cycle_image(id) ,
     CONSTRAINT FK_CYCLE_TERMINAL_S FOREIGN KEY (screenshot_image_id) REFERENCES uc_cycle_image(id)
    )  ;


   CREATE TABLE uc_cycle_terminal_screens (
     id nvarchar(100) NOT NULL,
     execution_id nvarchar(100) NOT NULL,
     node_id nvarchar(255) NOT NULL,
     screen TEXT,
     CONSTRAINT PK_CYCLE_TERMINAL PRIMARY KEY (id) ,
     CONSTRAINT FK_CYCLE_TERMINAL FOREIGN KEY (execution_id,node_id) REFERENCES uc_cycle_execution_results(execution_id,node_id)
    )  ;


   CREATE TABLE uc_cycle_file_diagnostics (
     id nvarchar(100) NOT NULL,
     execution_id nvarchar(100) NOT NULL,
     node_id nvarchar(255) NOT NULL,
     start_line int,
     start_character int,
     end_line int,
     end_character int,
     message TEXT,
     severity nvarchar(100),
     code int,
     source TEXT,
     CONSTRAINT PK_FILE_DIAGNOSTICS PRIMARY KEY (id) ,
     CONSTRAINT FK_FILE_DIAGNOSTICS FOREIGN KEY (execution_id,node_id) REFERENCES uc_cycle_execution_results(execution_id,node_id)
    )  ;

MOCA Oracle for Cycle version 2.2.0 (Run first for later versions)

CREATE TABLE uc_cycle_test_execution (
  execution_id VARCHAR2(100) NOT NULL,
  execution_start_ts timestamp(6) NOT NULL,
  cycle_user VARCHAR2(100) NOT NULL,
  cycle_version VARCHAR2(100) NOT NULL,
  hardware_id VARCHAR2(100) NOT NULL,
  computer_username VARCHAR2(100) NOT NULL,
  os VARCHAR2(100) NOT NULL,
  invoker VARCHAR2(100) NOT NULL,
  CONSTRAINT PK_test_execution PRIMARY KEY (execution_id)
) ;

CREATE TABLE uc_cycle_execution_results (
  execution_id VARCHAR2(100) NOT NULL,
  node_id VARCHAR2(255) NOT NULL,
  parent_node_id VARCHAR2(255) DEFAULT NULL,
  sending_node_id VARCHAR2(255) NOT NULL,
  node_sequence int NOT NULL,
  node_type VARCHAR2(100) NOT NULL,
  block_type VARCHAR2(100) DEFAULT NULL,
  name VARCHAR2(4000) DEFAULT NULL,
  status VARCHAR2(100) NOT NULL,
  message VARCHAR2(4000) DEFAULT NULL,
  error_message VARCHAR2(4000) DEFAULT NULL,
  file_uri VARCHAR2(4000) DEFAULT NULL,
  start_line int DEFAULT NULL,
  end_line int DEFAULT NULL,
  data_file_path VARCHAR2(4000) DEFAULT NULL,
  worker_name VARCHAR2(4000) DEFAULT NULL,
  tags VARCHAR2(4000) DEFAULT NULL,
  step_id VARCHAR2(100) DEFAULT NULL,
  delay_start_time timestamp(6) DEFAULT NULL,
  start_time timestamp(6) NOT NULL,
  end_time timestamp(6) DEFAULT NULL,
  CONSTRAINT PK_cycle_execution_results PRIMARY KEY (execution_id,node_id),
  CONSTRAINT FK_cycle_execution_results FOREIGN KEY (execution_id) REFERENCES uc_cycle_test_execution (execution_id)
) ;
CREATE  INDEX cycle_node_type_IDX ON uc_cycle_execution_results (node_type);;
CREATE  INDEX cycle_parent_node_IDX ON uc_cycle_execution_results (execution_id,parent_node_id);;
CREATE  INDEX cycle_sending_node_IDX ON uc_cycle_execution_results (execution_id,sending_node_id);;

CREATE VIEW uc_cycle_execution_view AS
SELECT test.execution_id,
       test.cycle_user,
       test.os,
       test.computer_username,
       test.hardware_id,
       test.cycle_version,
       cyc_group.name as group_name,
       cyc_group.data_file_path,
       worker.worker_name,
       dtl.node_id,
       dtl.node_type,
       dtl.name,
       dtl.block_type,
       dtl.tags,
       dtl.status,
       dtl.message,
       dtl.error_message,
       dtl.file_uri,
       dtl.start_line,
       dtl.end_line,
       dtl.delay_start_time,
       dtl.start_time,
       dtl.end_time,
       (sysdate + (dtl.end_time - dtl.start_time) * 1000 - sysdate) * 86400 as duration,
       (sysdate + (dtl.end_time - dtl.delay_start_time) * 1000 - sysdate) * 86400 as duration_with_delay,
       dtl.node_sequence
  from uc_cycle_test_execution  test
  join uc_cycle_execution_results  dtl
    on test.execution_id = dtl.execution_id
   and node_type not in ('Group','GroupTest','ConditionalBlock','ConditionalExpression')
  left join (select execution_id, node_id, parent_node_id, sending_node_id, worker_name from uc_cycle_execution_results where node_type = 'Feature')  worker
    on dtl.execution_id = worker.execution_id
   and dtl.sending_node_id = worker.node_id
  left join (select execution_id, node_id, name, data_file_path from uc_cycle_execution_results where node_type = 'Group')  cyc_group
    on worker.execution_id = cyc_group.execution_id
   and worker.parent_node_id = cyc_group.node_id;

MOCA Oracle for Cycle version 2.3.0

   CREATE TABLE uc_cycle_image (
     id VARCHAR2(100) NOT NULL,
     image BLOB,
     CONSTRAINT PK_CYCLE_IMAGE PRIMARY KEY (id)
    )  ;
   CREATE TABLE uc_cycle_image_results (
     id VARCHAR2(100) NOT NULL,
     execution_id VARCHAR2(100) NOT NULL,
     node_id VARCHAR2(255) NOT NULL,
     template_file VARCHAR2(4000),
     template_image_id VARCHAR2(100) DEFAULT NULL,
     screenshot_image_id VARCHAR2(100) DEFAULT NULL,
     found_image CHAR(1) DEFAULT NULL,
     min_value BINARY_DOUBLE DEFAULT NULL,
     max_value BINARY_DOUBLE DEFAULT NULL,
     min_location_x int DEFAULT NULL,
     min_location_y int DEFAULT NULL,
     max_location_x int DEFAULT NULL,
     max_location_y int DEFAULT NULL,
     source_width int DEFAULT NULL,
     source_height int DEFAULT NULL,
     template_width int DEFAULT NULL,
     template_height int DEFAULT NULL,
     correlation_threshold BINARY_DOUBLE DEFAULT NULL,
     CONSTRAINT PK_CYCLE_IMAGE_RESULTS PRIMARY KEY (id) ,
     CONSTRAINT FK_CYCLE_IMAGE_RESULTS FOREIGN KEY (execution_id, node_id) REFERENCES uc_cycle_execution_results (execution_id,node_id) ,
     CONSTRAINT FK_CYCLE_TERMINAL_T FOREIGN KEY (template_image_id) REFERENCES uc_cycle_image (id) ,
     CONSTRAINT FK_CYCLE_TERMINAL_S FOREIGN KEY (screenshot_image_id) REFERENCES uc_cycle_image (id)
    )  ;


   CREATE TABLE uc_cycle_terminal_screens (
     id VARCHAR2(100) NOT NULL,
     execution_id VARCHAR2(100) NOT NULL,
     node_id VARCHAR2(255) NOT NULL,
     screen VARCHAR2(4000),
     CONSTRAINT PK_CYCLE_TERMINAL PRIMARY KEY (id) ,
     CONSTRAINT FK_CYCLE_TERMINAL FOREIGN KEY (execution_id,node_id) REFERENCES uc_cycle_execution_results (execution_id,node_id)
    )  ;


   CREATE TABLE uc_cycle_file_diagnostics (
     id VARCHAR2(100) NOT NULL,
     execution_id VARCHAR2(100) NOT NULL,
     node_id VARCHAR2(255) NOT NULL,
     start_line int,
     start_character int,
     end_line int,
     end_character int,
     message VARCHAR2(4000),
     severity VARCHAR2(100),
     code int,
     source VARCHAR2(4000),
     CONSTRAINT PK_FILE_DIAGNOSTICS PRIMARY KEY (id) ,
     CONSTRAINT FK_FILE_DIAGNOSTICS FOREIGN KEY (execution_id,node_id) REFERENCES uc_cycle_execution_results (execution_id,node_id)
    )  ;

MOCA Db2 for Cycle version 2.2.0 (Run first for later versions)

CREATE TABLE uc_cycle_test_execution (
  execution_id VARCHAR(100) NOT NULL,
  execution_start_ts TIMESTAMP NOT NULL,
  cycle_user VARCHAR(100) NOT NULL,
  cycle_version VARCHAR(100) NOT NULL,
  hardware_id VARCHAR(100) NOT NULL,
  computer_username VARCHAR(100) NOT NULL,
  os VARCHAR(100) NOT NULL,
  invoker VARCHAR(100) NOT NULL,
  CONSTRAINT PK_test_execution PRIMARY KEY (execution_id)
) ;

CREATE TABLE uc_cycle_execution_results (
  execution_id VARCHAR(100) NOT NULL,
  node_id VARCHAR(255) NOT NULL,
  parent_node_id VARCHAR(255) DEFAULT NULL,
  sending_node_id VARCHAR(255) NOT NULL,
  node_sequence INT NOT NULL,
  node_type VARCHAR(100) NOT NULL,
  block_type VARCHAR(100) DEFAULT NULL,
  name VARCHAR(8000) DEFAULT NULL,
  status VARCHAR(100) NOT NULL,
  message VARCHAR(8000) DEFAULT NULL,
  error_message VARCHAR(8000) DEFAULT NULL,
  file_uri VARCHAR(8000) DEFAULT NULL,
  start_line INT DEFAULT NULL,
  end_line INT DEFAULT NULL,
  data_file_path VARCHAR(8000) DEFAULT NULL,
  worker_name VARCHAR(8000) DEFAULT NULL,
  tags VARCHAR(8000) DEFAULT NULL,
  step_id VARCHAR(100) DEFAULT NULL,
  delay_start_time TIMESTAMP DEFAULT NULL,
  start_time TIMESTAMP NOT NULL,
  end_time TIMESTAMP DEFAULT NULL,
  CONSTRAINT PK_cycle_execution_results PRIMARY KEY (execution_id,node_id),
  CONSTRAINT FK_cycle_execution_results FOREIGN KEY (execution_id) REFERENCES uc_cycle_test_execution(execution_id)
) ;
CREATE  INDEX cycle_node_type_IDX ON uc_cycle_execution_results (node_type);;
CREATE  INDEX cycle_parent_node_IDX ON uc_cycle_execution_results (execution_id,parent_node_id);;
CREATE  INDEX cycle_sending_node_IDX ON uc_cycle_execution_results (execution_id,sending_node_id);;

CREATE VIEW uc_cycle_execution_view AS
SELECT test.execution_id,
       test.cycle_user,
       test.os,
       test.computer_username,
       test.hardware_id,
       test.cycle_version,
       cyc_group.name as group_name,
       cyc_group.data_file_path,
       worker.worker_name,
       dtl.node_id,
       dtl.node_type,
       dtl.name,
       dtl.block_type,
       dtl.tags,
       dtl.status,
       dtl.message,
       dtl.error_message,
       dtl.file_uri,
       dtl.start_line,
       dtl.end_line,
       dtl.delay_start_time,
       dtl.start_time,
       dtl.end_time,
       timestampdiff(1, char(dtl.end_time - dtl.start_time)) / 1000 as duration,
       timestampdiff(1, char(dtl.end_time - dtl.delay_start_time)) / 1000 as duration_with_delay,
       dtl.node_sequence
  from uc_cycle_test_execution as test
  join uc_cycle_execution_results as dtl
    on test.execution_id = dtl.execution_id
   and node_type not in ('Group','GroupTest','ConditionalBlock','ConditionalExpression')
  left join (select execution_id, node_id, parent_node_id, sending_node_id, worker_name from uc_cycle_execution_results where node_type = 'Feature') as worker
    on dtl.execution_id = worker.execution_id
   and dtl.sending_node_id = worker.node_id
  left join (select execution_id, node_id, name, data_file_path from uc_cycle_execution_results where node_type = 'Group') as cyc_group
    on worker.execution_id = cyc_group.execution_id
   and worker.parent_node_id = cyc_group.node_id;

MOCA Db2 Version: 2.3.0

   CREATE TABLE uc_cycle_image (
     id VARCHAR(100) NOT NULL,
     image BLOB,
     CONSTRAINT PK_CYCLE_IMAGE PRIMARY KEY (id)
    )  ;
   CREATE TABLE uc_cycle_image_results (
     id VARCHAR(100) NOT NULL,
     execution_id VARCHAR(100) NOT NULL,
     node_id VARCHAR(255) NOT NULL,
     template_file VARCHAR(8000),
     template_image_id VARCHAR(100) DEFAULT NULL,
     screenshot_image_id VARCHAR(100) DEFAULT NULL,
     found_image BOOLEAN DEFAULT NULL,
     min_value DOUBLE DEFAULT NULL,
     max_value DOUBLE DEFAULT NULL,
     min_location_x INT DEFAULT NULL,
     min_location_y INT DEFAULT NULL,
     max_location_x INT DEFAULT NULL,
     max_location_y INT DEFAULT NULL,
     source_width INT DEFAULT NULL,
     source_height INT DEFAULT NULL,
     template_width INT DEFAULT NULL,
     template_height INT DEFAULT NULL,
     correlation_threshold DOUBLE DEFAULT NULL,
     CONSTRAINT PK_CYCLE_IMAGE_RESULTS PRIMARY KEY (id) ,
     CONSTRAINT FK_CYCLE_IMAGE_RESULTS FOREIGN KEY (execution_id, node_id) REFERENCES uc_cycle_execution_results(execution_id,node_id) ,
     CONSTRAINT FK_CYCLE_TERMINAL_T FOREIGN KEY (template_image_id) REFERENCES uc_cycle_image(id) ,
     CONSTRAINT FK_CYCLE_TERMINAL_S FOREIGN KEY (screenshot_image_id) REFERENCES uc_cycle_image(id)
    )  ;


   CREATE TABLE uc_cycle_terminal_screens (
     id VARCHAR(100) NOT NULL,
     execution_id VARCHAR(100) NOT NULL,
     node_id VARCHAR(255) NOT NULL,
     screen VARCHAR(8000),
     CONSTRAINT PK_CYCLE_TERMINAL PRIMARY KEY (id) ,
     CONSTRAINT FK_CYCLE_TERMINAL FOREIGN KEY (execution_id,node_id) REFERENCES uc_cycle_execution_results(execution_id,node_id)
    )  ;


   CREATE TABLE uc_cycle_file_diagnostics (
     id VARCHAR(100) NOT NULL,
     execution_id VARCHAR(100) NOT NULL,
     node_id VARCHAR(255) NOT NULL,
     start_line INT,
     start_character INT,
     end_line INT,
     end_character INT,
     message VARCHAR(8000),
     severity VARCHAR(100),
     code INT,
     source VARCHAR(8000),
     CONSTRAINT PK_FILE_DIAGNOSTICS PRIMARY KEY (id) ,
     CONSTRAINT FK_FILE_DIAGNOSTICS FOREIGN KEY (execution_id,node_id) REFERENCES uc_cycle_execution_results(execution_id,node_id)
    )  ;

results matching ""

    No results matching ""