Updated Tables
This commit is contained in:
parent
1b650070d7
commit
7db1a3456b
13 changed files with 192 additions and 9 deletions
42
lib/database/TABLES.md
Normal file
42
lib/database/TABLES.md
Normal file
|
@ -0,0 +1,42 @@
|
|||
CREATE SEQUENCE test_results_id_seq;
|
||||
CREATE TABLE test_results (
|
||||
id bigint NOT NULL DEFAULT nextval('test_results_seq') PRIMARY KEY,
|
||||
test_name varchar(255) DEFAULT NULL,
|
||||
test_class varchar(255) DEFAULT NULL,
|
||||
test_method varchar(255) DEFAULT NULL,
|
||||
test_path varchar(255) DEFAULT NULL,
|
||||
test_type varchar(32) DEFAULT NULL,
|
||||
test_timestamp timestamptz NOT NULL DEFAULT now(),
|
||||
test_retry BOOLEAN DEFAULT FALSE,
|
||||
origin varchar(255) DEFAULT NULL,
|
||||
failed BOOLEAN DEFAULT FALSE,
|
||||
failed_message varchar(2047) DEFAULT NULL,
|
||||
screenshot_url varchar(255) DEFAULT NULL,
|
||||
weblog_url varchar(255) DEFAULT NULL,
|
||||
);
|
||||
ALTER SEQUENCE test_results_id_seq OWNED BY test_results.id;
|
||||
|
||||
# Tables
|
||||
PG Database Tables Mapped Out
|
||||
|
||||
## ```test_results```
|
||||
| id | test_name | test_class | test_method | test_path | test_type | test_timestamp | test_retry | origin | failed | failed_message | screenshot_url | weblog_url |
|
||||
| int | string | string | string | string | string | timestamp | boolean | string | boolean | string | string | string |
|
||||
| 1 | My Test | My Test Class | My Failing Test Method | My Test Class Path | API | Date.now() | false | Test Suite A | true | Some Failure Messsage | screenshotUrl | weblogUrl |
|
||||
|
||||
- id Automatically Generated
|
||||
- test_name\* Name of test
|
||||
- test_class\* Name of class
|
||||
- test_method Name of failed method if failed else null
|
||||
- test_path Path to test class
|
||||
- test_type API/UI/Mobile
|
||||
- test_timestamp UTC Timestamp
|
||||
- test_retry Should test remedy failed tests
|
||||
- origin Test Suite test belongs to
|
||||
- failed Indicates if the test failed or not
|
||||
- failed_message Failure Message of test or null
|
||||
- screenshot_url Screenshot of failure
|
||||
- weblog_url Log from the web console
|
||||
|
||||
|
||||
|
15
lib/database/queries/silenced_tests.js
Normal file
15
lib/database/queries/silenced_tests.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
import pg from "../postgres.js";
|
||||
// Imports
|
||||
import {
|
||||
insertQuery,
|
||||
selectWhereAnyQuery,
|
||||
updateWhereAnyQuery,
|
||||
} from "../pg-query.js";
|
||||
// Constants
|
||||
const table = "silenced_tests";
|
||||
// Queries
|
||||
export const getSilencedTests = () => {
|
||||
const query = `SELECT * from ${table}`;
|
||||
return pg.query(query);
|
||||
};
|
||||
|
15
lib/database/queries/tests.js
Normal file
15
lib/database/queries/tests.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
import pg from "../postgres.js";
|
||||
// Imports
|
||||
import {
|
||||
insertQuery,
|
||||
selectWhereAnyQuery,
|
||||
updateWhereAnyQuery,
|
||||
} from "../pg-query.js";
|
||||
// Constants
|
||||
const table = "tests";
|
||||
// Queries
|
||||
export const getTests = () => {
|
||||
const query = `SELECT * from ${table}`;
|
||||
return pg.query(query);
|
||||
};
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue