Skip to content

Commit

Permalink
fix(action): make sure curl fails if HTTP server fails
Browse files Browse the repository at this point in the history
This avoids curl storing the error in the result.json file.

Fixes MRGFY-4028

Change-Id: I1a5ac6866cd3c8cc10df011cdd10abdf098b7b0c
  • Loading branch information
jd committed Sep 4, 2024
1 parent 987e793 commit 8bdcb1d
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ jobs:
set -e
test "$CI_ISSUE_GIGID" = "1234azertyuiop"
- name: Run action with error scenario 🔍
uses: ./
with:
token: fake-valid-token
report_paths: zfixtures/junit_example.xml
mergify_api_server: http://localhost:1085

- name: Dump mockserver logs
if: always()
run: |
Expand Down
11 changes: 11 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,14 @@ services:
- type: bind
source: zfixtures
target: /config
mockServerError:
image: mockserver/mockserver:5.15.0
command: -logLevel DEBUG
ports:
- 1085:1080
environment:
MOCKSERVER_INITIALIZATION_JSON_PATH: /config/fake-ci-issue-api-500.json
volumes:
- type: bind
source: zfixtures
target: /config
11 changes: 11 additions & 0 deletions zfixtures/fake-ci-issue-api-500.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[
{
"httpRequest": {
"path": ".*"
},
"httpResponse": {
"statusCode": 500,
"body": "Internal Server Error"
}
}
]

0 comments on commit 8bdcb1d

Please sign in to comment.