fitting 4.0.0 → 4.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/README.md +59 -3
- data/lib/fitting/doc/json_schema.rb +0 -4
- data/lib/fitting/doc.rb +7 -7
- data/lib/fitting/nocov.rb +4 -0
- data/lib/fitting/version.rb +1 -1
- data/lib/fitting.rb +10 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e88ddb2b0aba7b858d42c2deb0b0f99534efe8b6fa182585c6a77bd5a3de4e31
|
4
|
+
data.tar.gz: 27e3d3f54a808a0818fcd0cd991aea1e1f7c8084983f134716d4d26829c5d76a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73da9d87c292f0a996311722b80b5d3cf488250980ede0aff735669fe256db057d555b5b7f90da1f0be226e9de9d68f4d139c5fea5eeb6868491f7fc81fe4484
|
7
|
+
data.tar.gz: 30af36305effe12e47c63491bd2be33c3e810e302a982388d2aa4ca1802734514d5492cc4f7043f9a867e954a83aa39d6addd404b30e1f777b46e9c42b487263
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# Change log
|
2
2
|
|
3
|
+
### 4.0.2 - 2023-02-17
|
4
|
+
|
5
|
+
* patch
|
6
|
+
* skip error if not request in request test
|
7
|
+
|
8
|
+
### 4.0.1 - 2023-02-16
|
9
|
+
|
10
|
+
* patch
|
11
|
+
* fix more info error if not found nocov
|
12
|
+
* fix deep nocov
|
13
|
+
* fix deep check result coverage for console
|
14
|
+
|
3
15
|
### 4.0.0 - 2023-02-03
|
4
16
|
|
5
17
|
* features
|
data/README.md
CHANGED
@@ -312,7 +312,7 @@ APIs:
|
|
312
312
|
It is not necessary to immediately describe each host in detail, you can only specify its name and skip it until you are ready to documented it
|
313
313
|
|
314
314
|
```yaml
|
315
|
-
|
315
|
+
SkipValidation:
|
316
316
|
- host: api.cluster.dyte.in
|
317
317
|
```
|
318
318
|
|
@@ -321,7 +321,7 @@ SkipAPIs:
|
|
321
321
|
If you want to skip a specific prefix in the host
|
322
322
|
|
323
323
|
```yaml
|
324
|
-
|
324
|
+
SkipValidation:
|
325
325
|
- host: api.cluster.dyte.in
|
326
326
|
prefix: /admin/api
|
327
327
|
```
|
@@ -331,7 +331,7 @@ SkipAPIs:
|
|
331
331
|
If you want to skip a specific request in the host
|
332
332
|
|
333
333
|
```yaml
|
334
|
-
|
334
|
+
SkipValidation:
|
335
335
|
- host: api.cluster.dyte.in
|
336
336
|
method: GET
|
337
337
|
path: /api/v1/cars
|
@@ -341,6 +341,20 @@ SkipAPIs:
|
|
341
341
|
|
342
342
|
It is not necessary to immediately test each doc in detail, you can only specify its name and skip it until you are ready to test it
|
343
343
|
|
344
|
+
#### host
|
345
|
+
```yaml
|
346
|
+
NoCov:
|
347
|
+
- host: sso.test
|
348
|
+
```
|
349
|
+
|
350
|
+
#### method
|
351
|
+
```yaml
|
352
|
+
NoCov:
|
353
|
+
- host: sso.test
|
354
|
+
method: GET
|
355
|
+
```
|
356
|
+
|
357
|
+
#### path
|
344
358
|
```yaml
|
345
359
|
NoCov:
|
346
360
|
- host: sso.test
|
@@ -348,6 +362,48 @@ NoCov:
|
|
348
362
|
path: /users/{userId}
|
349
363
|
```
|
350
364
|
|
365
|
+
#### code
|
366
|
+
```yaml
|
367
|
+
NoCov:
|
368
|
+
- host: sso.test
|
369
|
+
method: GET
|
370
|
+
path: /users/{userId}
|
371
|
+
code: 200
|
372
|
+
```
|
373
|
+
|
374
|
+
#### content-type
|
375
|
+
```yaml
|
376
|
+
NoCov:
|
377
|
+
- host: sso.test
|
378
|
+
method: GET
|
379
|
+
path: /users/{userId}
|
380
|
+
code: 200
|
381
|
+
content-type: application/json
|
382
|
+
```
|
383
|
+
|
384
|
+
#### combination
|
385
|
+
```yaml
|
386
|
+
NoCov:
|
387
|
+
- host: sso.test
|
388
|
+
method: GET
|
389
|
+
path: /users/{userId}
|
390
|
+
code: 200
|
391
|
+
content-type: application/json
|
392
|
+
combination: oneOf.0
|
393
|
+
```
|
394
|
+
|
395
|
+
#### combination_next
|
396
|
+
```yaml
|
397
|
+
NoCov:
|
398
|
+
- host: sso.test
|
399
|
+
method: GET
|
400
|
+
path: /users/{userId}
|
401
|
+
code: 200
|
402
|
+
content-type: application/json
|
403
|
+
combination: oneOf.0
|
404
|
+
combination_next: oneOf.0.required.users
|
405
|
+
```
|
406
|
+
|
351
407
|
### Debug
|
352
408
|
|
353
409
|
If you find bug, you can debug it or create task in this github project with new file `coverage/fitting.debug.yml`
|
data/lib/fitting/doc.rb
CHANGED
@@ -80,16 +80,16 @@ module Fitting
|
|
80
80
|
raise NotFound
|
81
81
|
end
|
82
82
|
|
83
|
-
def self.report(
|
83
|
+
def self.report(actions)
|
84
84
|
all = 0
|
85
85
|
cov = 0
|
86
|
-
|
87
|
-
|
88
|
-
if
|
89
|
-
|
90
|
-
elsif
|
86
|
+
actions.each do |action|
|
87
|
+
action.to_hash.values.first.each do |cover_line|
|
88
|
+
if cover_line == nil
|
89
|
+
next
|
90
|
+
elsif cover_line == 0
|
91
91
|
all += 1
|
92
|
-
elsif
|
92
|
+
elsif cover_line > 0
|
93
93
|
all += 1
|
94
94
|
cov += 1
|
95
95
|
end
|
data/lib/fitting/nocov.rb
CHANGED
@@ -29,6 +29,10 @@ module Fitting
|
|
29
29
|
raise NotFound.new("host: #{@host}, method: #{@method}, path: #{@path}")
|
30
30
|
end
|
31
31
|
|
32
|
+
if res == nil
|
33
|
+
raise NotFound.new("host: #{@host}, method: #{@method}, path: #{@path}")
|
34
|
+
end
|
35
|
+
|
32
36
|
res_code = res.responses.find { |response| response.step_key == @code.to_s }
|
33
37
|
|
34
38
|
if @content_type == nil
|
data/lib/fitting/version.rb
CHANGED
data/lib/fitting.rb
CHANGED
@@ -29,13 +29,19 @@ module Fitting
|
|
29
29
|
end
|
30
30
|
|
31
31
|
config.after(:each, type: :request) do |example|
|
32
|
-
|
33
|
-
|
32
|
+
begin
|
33
|
+
request = Fitting::Records::Tested::Request.new(response, example)
|
34
|
+
responses += "FITTING incoming request #{request.to_spherical.to_json}\n"
|
35
|
+
rescue NoMethodError
|
36
|
+
end
|
34
37
|
end
|
35
38
|
|
36
39
|
config.after(:each, type: :controller) do |example|
|
37
|
-
|
38
|
-
|
40
|
+
begin
|
41
|
+
request = Fitting::Records::Tested::Request.new(response, example)
|
42
|
+
responses += "FITTING incoming request #{request.to_spherical.to_json}\n"
|
43
|
+
rescue NoMethodError
|
44
|
+
end
|
39
45
|
end
|
40
46
|
|
41
47
|
config.after(:each) do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fitting
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- d.efimov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-02-
|
11
|
+
date: 2023-02-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json-schema
|