Skip to content

Commit 9b5d734

Browse files
authored
Merge pull request #81 from Visual-Regression-Tracker/145-ignore-area-marker
145 ignore area marker
2 parents 5b19b25 + 18b5535 commit 9b5d734

File tree

10 files changed

+226
-2
lines changed

10 files changed

+226
-2
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Migration `20201201211711-test-run--temp-ignore-areas-added`
2+
3+
This migration has been generated by Pavel Strunkin at 12/1/2020, 11:17:11 PM.
4+
You can check out the [state of the schema](./schema.prisma) after the migration.
5+
6+
## Database Steps
7+
8+
```sql
9+
ALTER TABLE "public"."TestRun" ADD COLUMN "tempIgnoreAreas" text NOT NULL DEFAULT E'[]'
10+
```
11+
12+
## Changes
13+
14+
```diff
15+
diff --git schema.prisma schema.prisma
16+
migration 20201115155739-ci-build-id-added..20201201211711-test-run--temp-ignore-areas-added
17+
--- datamodel.dml
18+
+++ datamodel.dml
19+
@@ -4,9 +4,9 @@
20+
}
21+
datasource db {
22+
provider = "postgresql"
23+
- url = "***"
24+
+ url = "***"
25+
}
26+
model Build {
27+
id String @id @default(uuid())
28+
@@ -58,13 +58,14 @@
29+
device String?
30+
os String?
31+
viewport String?
32+
baselineName String?
33+
- ignoreAreas String @default("[]")
34+
comment String?
35+
baseline Baseline?
36+
branchName String @default("master")
37+
baselineBranchName String?
38+
+ ignoreAreas String @default("[]")
39+
+ tempIgnoreAreas String @default("[]")
40+
}
41+
model TestVariation {
42+
id String @id @default(uuid())
43+
```
44+
45+
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
generator client {
2+
provider = "prisma-client-js"
3+
previewFeatures = ["atomicNumberOperations"]
4+
}
5+
6+
datasource db {
7+
provider = "postgresql"
8+
url = "***"
9+
}
10+
11+
model Build {
12+
id String @id @default(uuid())
13+
ciBuildId String? @unique
14+
number Int?
15+
branchName String?
16+
status String?
17+
testRuns TestRun[]
18+
projectId String
19+
project Project @relation(fields: [projectId], references: [id])
20+
updatedAt DateTime @updatedAt
21+
createdAt DateTime @default(now())
22+
user User? @relation(fields: [userId], references: [id])
23+
userId String?
24+
isRunning Boolean?
25+
}
26+
27+
model Project {
28+
id String @id @default(uuid())
29+
name String
30+
mainBranchName String @default("master")
31+
builds Build[]
32+
buildsCounter Int @default(0)
33+
testVariations TestVariation[]
34+
updatedAt DateTime @updatedAt
35+
createdAt DateTime @default(now())
36+
37+
@@unique([name])
38+
}
39+
40+
model TestRun {
41+
id String @id @default(uuid())
42+
imageName String
43+
diffName String?
44+
diffPercent Float?
45+
diffTollerancePercent Float @default(0)
46+
pixelMisMatchCount Int?
47+
status TestStatus
48+
buildId String
49+
build Build @relation(fields: [buildId], references: [id])
50+
testVariationId String
51+
testVariation TestVariation @relation(fields: [testVariationId], references: [id])
52+
merge Boolean @default(false)
53+
updatedAt DateTime @updatedAt
54+
createdAt DateTime @default(now())
55+
// Test variation data
56+
name String @default("")
57+
browser String?
58+
device String?
59+
os String?
60+
viewport String?
61+
baselineName String?
62+
comment String?
63+
baseline Baseline?
64+
branchName String @default("master")
65+
baselineBranchName String?
66+
ignoreAreas String @default("[]")
67+
tempIgnoreAreas String @default("[]")
68+
}
69+
70+
model TestVariation {
71+
id String @id @default(uuid())
72+
name String
73+
branchName String @default("master")
74+
browser String?
75+
device String?
76+
os String?
77+
viewport String?
78+
baselineName String?
79+
ignoreAreas String @default("[]")
80+
projectId String
81+
project Project @relation(fields: [projectId], references: [id])
82+
testRuns TestRun[]
83+
baselines Baseline[]
84+
comment String?
85+
updatedAt DateTime @updatedAt
86+
createdAt DateTime @default(now())
87+
88+
@@unique([projectId, name, browser, device, os, viewport, branchName])
89+
}
90+
91+
model Baseline {
92+
id String @id @default(uuid())
93+
baselineName String
94+
testVariationId String
95+
testVariation TestVariation @relation(fields: [testVariationId], references: [id])
96+
testRunId String?
97+
testRun TestRun? @relation(fields: [testRunId], references: [id])
98+
updatedAt DateTime @updatedAt
99+
createdAt DateTime @default(now())
100+
}
101+
102+
model User {
103+
id String @id @default(uuid())
104+
email String @unique
105+
password String
106+
firstName String?
107+
lastName String?
108+
apiKey String @unique
109+
isActive Boolean @default(true)
110+
builds Build[]
111+
updatedAt DateTime @updatedAt
112+
createdAt DateTime @default(now())
113+
}
114+
115+
enum TestStatus {
116+
failed
117+
new
118+
ok
119+
unresolved
120+
approved
121+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"version": "0.3.14-fixed",
3+
"steps": [
4+
{
5+
"tag": "CreateField",
6+
"model": "TestRun",
7+
"field": "tempIgnoreAreas",
8+
"type": "String",
9+
"arity": "Required"
10+
},
11+
{
12+
"tag": "CreateDirective",
13+
"location": {
14+
"path": {
15+
"tag": "Field",
16+
"model": "TestRun",
17+
"field": "tempIgnoreAreas"
18+
},
19+
"directive": "default"
20+
}
21+
},
22+
{
23+
"tag": "CreateArgument",
24+
"location": {
25+
"tag": "Directive",
26+
"path": {
27+
"tag": "Field",
28+
"model": "TestRun",
29+
"field": "tempIgnoreAreas"
30+
},
31+
"directive": "default"
32+
},
33+
"argument": "",
34+
"value": "\"[]\""
35+
}
36+
]
37+
}

prisma/migrations/migrate.lock

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@
1010
20200812213545-build-run-status
1111
20200909223305-test-variation-project-id-added-into-unique-constraint
1212
20201007145002-builds-counter
13-
20201115155739-ci-build-id-added
13+
20201115155739-ci-build-id-added
14+
20201201211711-test-run--temp-ignore-areas-added

prisma/schema.prisma

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,12 @@ model TestRun {
5959
os String?
6060
viewport String?
6161
baselineName String?
62-
ignoreAreas String @default("[]")
6362
comment String?
6463
baseline Baseline?
6564
branchName String @default("master")
6665
baselineBranchName String?
66+
ignoreAreas String @default("[]")
67+
tempIgnoreAreas String @default("[]")
6768
}
6869

6970
model TestVariation {

src/builds/builds.service.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ describe('BuildsService', () => {
104104
viewport: '1800x1600',
105105
baselineName: null,
106106
ignoreAreas: '[]',
107+
tempIgnoreAreas: '[]',
107108
comment: 'some comment',
108109
branchName: 'develop',
109110
baselineBranchName: 'master',

src/builds/dto/build.dto.spec.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ describe('BuildDto', () => {
9191
viewport: '1800x1600',
9292
baselineName: null,
9393
ignoreAreas: '[]',
94+
tempIgnoreAreas: '[]',
9495
comment: 'some comment1',
9596
branchName: 'develop',
9697
baselineBranchName: 'master',
@@ -115,6 +116,7 @@ describe('BuildDto', () => {
115116
viewport: '1800x1600',
116117
baselineName: null,
117118
ignoreAreas: '[]',
119+
tempIgnoreAreas: '[]',
118120
comment: 'some comment2',
119121
branchName: 'develop',
120122
baselineBranchName: 'master',
@@ -175,6 +177,7 @@ describe('BuildDto', () => {
175177
viewport: '1800x1600',
176178
baselineName: null,
177179
ignoreAreas: '[]',
180+
tempIgnoreAreas: '[]',
178181
comment: 'some comment',
179182
branchName: 'develop',
180183
baselineBranchName: 'master',
@@ -199,6 +202,7 @@ describe('BuildDto', () => {
199202
viewport: '1800x1600',
200203
baselineName: null,
201204
ignoreAreas: '[]',
205+
tempIgnoreAreas: '[]',
202206
comment: 'some comment1',
203207
branchName: 'develop',
204208
baselineBranchName: 'master',
@@ -223,6 +227,7 @@ describe('BuildDto', () => {
223227
viewport: '1800x1600',
224228
baselineName: null,
225229
ignoreAreas: '[]',
230+
tempIgnoreAreas: '[]',
226231
comment: 'some comment2',
227232
branchName: 'develop',
228233
baselineBranchName: 'master',
@@ -283,6 +288,7 @@ describe('BuildDto', () => {
283288
viewport: '1800x1600',
284289
baselineName: null,
285290
ignoreAreas: '[]',
291+
tempIgnoreAreas: '[]',
286292
comment: 'some comment1',
287293
branchName: 'develop',
288294
baselineBranchName: 'master',
@@ -307,6 +313,7 @@ describe('BuildDto', () => {
307313
viewport: '1800x1600',
308314
baselineName: null,
309315
ignoreAreas: '[]',
316+
tempIgnoreAreas: '[]',
310317
comment: 'some comment2',
311318
branchName: 'develop',
312319
baselineBranchName: 'master',
@@ -331,6 +338,7 @@ describe('BuildDto', () => {
331338
viewport: '1800x1600',
332339
baselineName: null,
333340
ignoreAreas: '[]',
341+
tempIgnoreAreas: '[]',
334342
comment: null,
335343
branchName: 'develop',
336344
baselineBranchName: 'master',
@@ -355,6 +363,7 @@ describe('BuildDto', () => {
355363
viewport: '1800x1600',
356364
baselineName: null,
357365
ignoreAreas: '[]',
366+
tempIgnoreAreas: '[]',
358367
comment: 'some comment',
359368
branchName: 'develop',
360369
baselineBranchName: 'master',
@@ -379,6 +388,7 @@ describe('BuildDto', () => {
379388
viewport: '1800x1600',
380389
baselineName: null,
381390
ignoreAreas: '[]',
391+
tempIgnoreAreas: '[]',
382392
comment: 'some comment',
383393
branchName: 'develop',
384394
baselineBranchName: 'master',

src/test-runs/test-runs.service.spec.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ describe('TestRunsService', () => {
164164
createdAt: new Date(),
165165
name: 'test run name',
166166
ignoreAreas: '[]',
167+
tempIgnoreAreas: '[]',
167168
browser: 'browser',
168169
device: 'device',
169170
os: 'os',
@@ -236,6 +237,7 @@ describe('TestRunsService', () => {
236237
createdAt: new Date(),
237238
name: 'test run name',
238239
ignoreAreas: '[]',
240+
tempIgnoreAreas: '[]',
239241
browser: 'browser',
240242
device: 'device',
241243
os: 'os',
@@ -310,6 +312,7 @@ describe('TestRunsService', () => {
310312
createdAt: new Date(),
311313
name: 'test run name',
312314
ignoreAreas: '[]',
315+
tempIgnoreAreas: '[]',
313316
browser: 'browser',
314317
device: 'device',
315318
os: 'os',
@@ -517,6 +520,7 @@ describe('TestRunsService', () => {
517520
viewport: testVariation.viewport,
518521
baselineName: testVariation.baselineName,
519522
ignoreAreas: testVariation.ignoreAreas,
523+
tempIgnoreAreas: JSON.stringify(createTestRequestDto.ignoreAreas),
520524
comment: testVariation.comment,
521525
baselineBranchName: testVariation.branchName,
522526
branchName: createTestRequestDto.branchName,
@@ -872,6 +876,7 @@ describe('TestRunsService', () => {
872876
viewport: '1800x1600',
873877
baselineName: null,
874878
ignoreAreas: '[]',
879+
tempIgnoreAreas: '[]',
875880
comment: 'some comment',
876881
baselineBranchName: 'master',
877882
branchName: 'develop',
@@ -945,6 +950,7 @@ describe('TestRunsService', () => {
945950
viewport: '1800x1600',
946951
baselineName: null,
947952
ignoreAreas: '[]',
953+
tempIgnoreAreas: '[]',
948954
comment: 'some comment',
949955
baselineBranchName: 'master',
950956
branchName: 'develop',

src/test-runs/test-runs.service.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ export class TestRunsService {
217217
baselineName: testVariation.baselineName,
218218
baselineBranchName: testVariation.branchName,
219219
ignoreAreas: testVariation.ignoreAreas,
220+
tempIgnoreAreas: JSON.stringify(createTestRequestDto.ignoreAreas),
220221
comment: testVariation.comment,
221222
diffTollerancePercent: createTestRequestDto.diffTollerancePercent,
222223
branchName: createTestRequestDto.branchName,

src/test-variations/test-variations.service.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,7 @@ describe('TestVariationsService', () => {
491491
viewport: '1800x1600',
492492
baselineName: null,
493493
ignoreAreas: '[]',
494+
tempIgnoreAreas: '[]',
494495
comment: 'some comment',
495496
baselineBranchName: 'master',
496497
branchName: 'develop',

0 commit comments

Comments
 (0)