Skip to content

Commit 9a0f7f2

Browse files
committed
chore: fix default failure action
1 parent e7e8c8d commit 9a0f7f2

File tree

9 files changed

+50
-222
lines changed

9 files changed

+50
-222
lines changed

__tests__/respect/local-json-server/__snapshots__/local-json-server.test.ts.snap

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,6 @@ exports[`local-json-server local-json-server test case 1`] = `
2626
    ✓ content-type check
2727
    ✓ schema check
2828
29-
✓ GET /items/{id} - step get-item-by-id
30-
    ✓ success criteria check - $statusCode == 200
31-
    ✓ success criteria check - $response.body#/id == $steps.add-item.outputs.crea...
32-
    ✓ success criteria check - $response.body#/value == $steps.add-item.outputs.c...
33-
    ✓ status code check - $statusCode in [200, 404]
34-
    ✓ content-type check
35-
    ✓ schema check
36-
37-
✓ DELETE /items/{id} - step drop-item
38-
    ✓ success criteria check - $statusCode == 200
39-
    ✓ status code check - $statusCode in [200]
40-
41-
✓ GET /items/{id} - step get-after-deleting
42-
    ✓ success criteria check - $statusCode == 404
43-
    ✓ status code check - $statusCode in [200, 404]
44-
    ✓ content-type check
45-
4629
────────────────────────────────────────────────────────────────────────────────
4730
4831
Running workflow local-json-server.yaml / auto-inherit
@@ -77,8 +60,8 @@ exports[`local-json-server local-json-server test case 1`] = `
7760
  Summary for local-json-server.yaml
7861
  
7962
  Workflows: 2 passed, 1 failed, 3 total
80-
  Steps: 9 passed, 1 failed, 10 total
81-
  Checks: 31 passed, 1 failed, 32 total
63+
  Steps: 6 passed, 1 failed, 7 total
64+
  Checks: 20 passed, 1 failed, 21 total
8265
  Time: <test>ms
8366
8467
Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
11
{
2-
"items": []
2+
"items": [
3+
{
4+
"id": "a959",
5+
"value": 9
6+
},
7+
{
8+
"id": "1768",
9+
"value": 6
10+
},
11+
{
12+
"id": "6e43",
13+
"value": 10
14+
},
15+
{
16+
"id": "8cf3",
17+
"value": 7
18+
}
19+
]
320
}

__tests__/respect/server-override-with-console-parameters/__snapshots__/server-override-with-console-parameters.test.ts.snap

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ exports[`should use server override from CLI and env 1`] = `
1414
1515
    ✗ failed network request
1616
17+
Running failure action continue for the step get-museum-hours
18+
1719
Running child workflow for the step buy-ticket
1820
Running workflow museum-tickets.yaml / get-museum-tickets
1921
@@ -33,6 +35,7 @@ exports[`should use server override from CLI and env 1`] = `
3335
3436
    ✗ failed network request
3537
38+
3639
────────────────────────────────────────────────────────────────────────────────
3740
3841
Running workflow server-override-with-console-parameters.yaml / events-crud
@@ -61,27 +64,11 @@ exports[`should use server override from CLI and env 1`] = `
6164
    ✗ failed network request
6265
      fetch failed
6366
      
64-
    stepId - create-event
65-
    ✗ unexpected error
66-
    Reason: Error in resolving runtime expression '$steps.list-events.outputs.events.0.dates.0'.
67-
    This could be because the expression references a value from a previous failed step, or is trying to reference a variable that hasn't been set.
68-
    stepId - get-event-by-id
69-
    ✗ unexpected error
70-
    Reason: Error in resolving runtime expression '$steps.create-event.outputs.createdEventId'.
71-
    This could be because the expression references a value from a previous failed step, or is trying to reference a variable that hasn't been set.
72-
    stepId - update-event
73-
    ✗ unexpected error
74-
    Reason: Error in resolving runtime expression '$steps.create-event.outputs.createdEventId'.
75-
    This could be because the expression references a value from a previous failed step, or is trying to reference a variable that hasn't been set.
76-
    stepId - delete-event
77-
    ✗ unexpected error
78-
    Reason: Error in resolving runtime expression '$steps.update-event.outputs.updatedEventId'.
79-
    This could be because the expression references a value from a previous failed step, or is trying to reference a variable that hasn't been set.
8067
  Summary for server-override-with-console-parameters.yaml
8168
  
8269
  Workflows: 2 failed, 2 total
83-
  Steps: 6 failed, 6 total
84-
  Checks: 6 failed, 6 total
70+
  Steps: 2 failed, 2 total
71+
  Checks: 2 failed, 2 total
8572
  Time: <test>ms
8673
8774

__tests__/respect/server-override-with-console-parameters/server-override-with-console-parameters.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ workflows:
2929
operationId: museum-api.getMuseumHours
3030
successCriteria:
3131
- condition: $statusCode == 200
32+
onFailure:
33+
- name: continue
34+
type: goto
35+
stepId: buy-ticket
3236
outputs:
3337
schedule: $response.body
3438
- stepId: buy-ticket

__tests__/respect/severity-error-level/__snapshots__/severity-error-level.test.ts.snap

Lines changed: 2 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -73,41 +73,6 @@ exports[`should use error severity level 1`] = `
7373
    ✓ success criteria check - $statusCode == 200
7474
    ✗ status code check
7575
76-
Running child workflow for the step buy-ticket
77-
Running workflow museum-tickets.yaml / get-museum-tickets
78-
79-
✓ POST /tickets - step buy-tickets
80-
81-
    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/tickets
82-
    Request Headers:
83-
      content-type: application/json
84-
      accept: application/json, application/problem+json
85-
      authorization: Basic Og==
86-
    Request Body:
87-
      {
88-
       "ticketType": "general",
89-
       "ticketDate": "2023-09-07",
90-
       "email": "[email protected]"
91-
      }
92-
93-
94-
    Response status code: 201
95-
    Response time: <test> ms
96-
    Response Body:
97-
      {
98-
       "message": "Museum general entry ticket purchased",
99-
       "ticketId": "382c0820-0530-4f4b-99af-13811ad0f17a",
100-
       "ticketType": "general",
101-
       "ticketDate": "2023-09-07",
102-
       "confirmationCode": "ticket-general-e5e5c6-dce78"
103-
      }
104-
105-
    ✓ success criteria check - $statusCode == 201
106-
    ✓ status code check - $statusCode in [201, 400, 404]
107-
    ✓ content-type check
108-
    ✓ schema check
109-
110-
11176
────────────────────────────────────────────────────────────────────────────────
11277
11378
Running workflow severity-level.yaml / events-crud
@@ -354,22 +319,6 @@ exports[`should use error severity level 1`] = `
354319
    ✓ status code check - $statusCode in [200, 400, 404]
355320
    ✗ content-type check
356321
357-
✗ DELETE /special-events/{eventId} - step delete-event
358-
359-
    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/special-events/dad4bce8-f5cb-4078-a211-995864315e39
360-
    Request Headers:
361-
      accept: application/problem+json
362-
      authorization: Basic Og==
363-
364-
365-
    Response status code: 204
366-
    Response time: <test> ms
367-
    Response Body:
368-
      {}
369-
370-
    ✗ success criteria check - $statusCode == 200
371-
    ✗ status code check
372-
373322
374323
  Failed tests info:
375324
@@ -386,18 +335,11 @@ exports[`should use error severity level 1`] = `
386335
      Content type application/json for 200 response is not described in the schema.
387336
      Expected content types: json.
388337
      
389-
    stepId - delete-event
390-
    ✗ success criteria check
391-
      Checking simple criteria: {"condition":"$statusCode == 200"}
392-
      
393-
    ✗ status code check
394-
      
395-
      
396338
  Summary for severity-level.yaml
397339
  
398340
  Workflows: 2 failed, 2 total
399-
  Steps: 4 passed, 3 failed, 7 total
400-
  Checks: 20 passed, 4 failed, 24 total
341+
  Steps: 3 passed, 2 failed, 5 total
342+
  Checks: 16 passed, 2 failed, 18 total
401343
  Time: <test>ms
402344
403345

__tests__/respect/severity-off-level/__snapshots__/severity-off-level.test.ts.snap

Lines changed: 2 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -73,41 +73,6 @@ exports[`should use off severity level 1`] = `
7373
    ✓ success criteria check - $statusCode == 200
7474
    ✗ status code check
7575
76-
Running child workflow for the step buy-ticket
77-
Running workflow museum-tickets.yaml / get-museum-tickets
78-
79-
✓ POST /tickets - step buy-tickets
80-
81-
    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/tickets
82-
    Request Headers:
83-
      content-type: application/json
84-
      accept: application/json, application/problem+json
85-
      authorization: Basic Og==
86-
    Request Body:
87-
      {
88-
       "ticketType": "general",
89-
       "ticketDate": "2023-09-07",
90-
       "email": "[email protected]"
91-
      }
92-
93-
94-
    Response status code: 201
95-
    Response time: <test> ms
96-
    Response Body:
97-
      {
98-
       "message": "Museum general entry ticket purchased",
99-
       "ticketId": "382c0820-0530-4f4b-99af-13811ad0f17a",
100-
       "ticketType": "general",
101-
       "ticketDate": "2023-09-07",
102-
       "confirmationCode": "ticket-general-e5e5c6-dce78"
103-
      }
104-
105-
    ✓ success criteria check - $statusCode == 201
106-
    ✓ status code check - $statusCode in [201, 400, 404]
107-
    ✓ content-type check
108-
    ✓ schema check
109-
110-
11176
────────────────────────────────────────────────────────────────────────────────
11277
11378
Running workflow severity-level.yaml / events-crud
@@ -354,22 +319,6 @@ exports[`should use off severity level 1`] = `
354319
    ✓ status code check - $statusCode in [200, 400, 404]
355320
    ✗ content-type check
356321
357-
✗ DELETE /special-events/{eventId} - step delete-event
358-
359-
    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/special-events/dad4bce8-f5cb-4078-a211-995864315e39
360-
    Request Headers:
361-
      accept: application/problem+json
362-
      authorization: Basic Og==
363-
364-
365-
    Response status code: 204
366-
    Response time: <test> ms
367-
    Response Body:
368-
      {}
369-
370-
    ✗ success criteria check - $statusCode == 200
371-
    ✗ status code check
372-
373322
374323
  Failed tests info:
375324
@@ -386,18 +335,11 @@ exports[`should use off severity level 1`] = `
386335
      Content type application/json for 200 response is not described in the schema.
387336
      Expected content types: json.
388337
      
389-
    stepId - delete-event
390-
    ○ success criteria check (skipped)
391-
      Checking simple criteria: {"condition":"$statusCode == 200"}
392-
      
393-
    ○ status code check (skipped)
394-
      
395-
      
396338
  Summary for severity-level.yaml
397339
  
398340
  Workflows: 2 passed, 2 total
399-
  Steps: 7 passed, 3 ignored, 7 total
400-
  Checks: 24 passed, 4 ignored, 24 total
341+
  Steps: 5 passed, 2 ignored, 5 total
342+
  Checks: 18 passed, 2 ignored, 18 total
401343
  Time: <test>ms
402344
403345

__tests__/respect/severity-warn-level/__snapshots__/severity-warn-level.test.ts.snap

Lines changed: 2 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -73,41 +73,6 @@ exports[`should use warn severity level 1`] = `
7373
    ✓ success criteria check - $statusCode == 200
7474
    ⚠ status code check
7575
76-
Running child workflow for the step buy-ticket
77-
Running workflow museum-tickets.yaml / get-museum-tickets
78-
79-
✓ POST /tickets - step buy-tickets
80-
81-
    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/tickets
82-
    Request Headers:
83-
      content-type: application/json
84-
      accept: application/json, application/problem+json
85-
      authorization: Basic Og==
86-
    Request Body:
87-
      {
88-
       "ticketType": "general",
89-
       "ticketDate": "2023-09-07",
90-
       "email": "[email protected]"
91-
      }
92-
93-
94-
    Response status code: 201
95-
    Response time: <test> ms
96-
    Response Body:
97-
      {
98-
       "message": "Museum general entry ticket purchased",
99-
       "ticketId": "382c0820-0530-4f4b-99af-13811ad0f17a",
100-
       "ticketType": "general",
101-
       "ticketDate": "2023-09-07",
102-
       "confirmationCode": "ticket-general-e5e5c6-dce78"
103-
      }
104-
105-
    ✓ success criteria check - $statusCode == 201
106-
    ✓ status code check - $statusCode in [201, 400, 404]
107-
    ✓ content-type check
108-
    ✓ schema check
109-
110-
11176
────────────────────────────────────────────────────────────────────────────────
11277
11378
Running workflow severity-level.yaml / events-crud
@@ -354,22 +319,6 @@ exports[`should use warn severity level 1`] = `
354319
    ✓ status code check - $statusCode in [200, 400, 404]
355320
    ⚠ content-type check
356321
357-
✗ DELETE /special-events/{eventId} - step delete-event
358-
359-
    Request URL: https://redocly.com/_mock/demo/openapi/museum-api/special-events/dad4bce8-f5cb-4078-a211-995864315e39
360-
    Request Headers:
361-
      accept: application/problem+json
362-
      authorization: Basic Og==
363-
364-
365-
    Response status code: 204
366-
    Response time: <test> ms
367-
    Response Body:
368-
      {}
369-
370-
    ⚠ success criteria check - $statusCode == 200
371-
    ⚠ status code check
372-
373322
374323
  Failed tests info:
375324
@@ -386,18 +335,11 @@ exports[`should use warn severity level 1`] = `
386335
      Content type application/json for 200 response is not described in the schema.
387336
      Expected content types: json.
388337
      
389-
    stepId - delete-event
390-
    ⚠ success criteria check
391-
      Checking simple criteria: {"condition":"$statusCode == 200"}
392-
      
393-
    ⚠ status code check
394-
      
395-
      
396338
  Summary for severity-level.yaml
397339
  
398340
  Workflows: 2 passed, 2 total
399-
  Steps: 7 passed, 3 warnings, 7 total
400-
  Checks: 24 passed, 4 warnings, 24 total
341+
  Steps: 5 passed, 2 warnings, 5 total
342+
  Checks: 18 passed, 2 warnings, 18 total
401343
  Time: <test>ms
402344
403345

0 commit comments

Comments
 (0)