generated from pagopa/pagopa-functions-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SELC-5980] Postman collection for integration test (#604)
- Loading branch information
1 parent
3000bf0
commit 68c4f0f
Showing
6 changed files
with
283 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,3 +48,5 @@ override.tf | |
override.tf.json | ||
*_override.tf | ||
*_override.tf.json | ||
|
||
**/node_modules/* |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"dependencies": { | ||
"axios": "^1.7.7" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
var fs = require('fs'); | ||
|
||
fs.readFile('test/test-result.json', 'utf8', function (err, data) { | ||
if (err) throw err; // we'll not consider error handling for now | ||
var obj = JSON.parse(data); | ||
|
||
let json = JSON.stringify(convert(obj["run"]["stats"], process.argv[2])); | ||
fs.writeFile("test/stats.json", json, 'utf8', (err) => { | ||
if (err) { | ||
console.error('Error writing to file', err); | ||
} else { | ||
console.log('Data written to file'); | ||
} | ||
}); | ||
}); | ||
|
||
|
||
function convert(payload) { | ||
var block = | ||
{ | ||
"blocks": [ | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "*:white_check_mark: GitHub Actions*" | ||
} | ||
}, | ||
{ | ||
"type": "section", | ||
"fields": [ | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*Iterations*:\ntotal: "+payload["iterations"]["total"]+" pending: "+payload["iterations"]["pending"]+" failed: "+payload["iterations"]["failed"] | ||
}, | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*Items*:\ntotal: "+payload["items"]["total"]+" pending: "+payload["items"]["pending"]+" failed: "+payload["items"]["failed"] | ||
}, | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*Scripts*:\ntotal: "+payload["scripts"]["total"]+" pending: "+payload["scripts"]["pending"]+" failed: "+payload["scripts"]["failed"] | ||
}, | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*Prerequests*:\ntotal: "+payload["prerequests"]["total"]+" pending: "+payload["prerequests"]["pending"]+" failed: "+payload["prerequests"]["failed"] | ||
}, | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*Requests*:\ntotal: "+payload["requests"]["total"]+" pending: "+payload["requests"]["pending"]+" failed: "+payload["requests"]["failed"] | ||
}, | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*Tests*:\ntotal: "+payload["tests"]["total"]+" pending: "+payload["tests"]["pending"]+" failed: "+payload["tests"]["failed"] | ||
}, | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*Assertions*:\ntotal: "+payload["assertions"]["total"]+" pending: "+payload["assertions"]["pending"]+" failed: "+payload["assertions"]["failed"] | ||
}, | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*TestScripts*:\ntotal: "+payload["testScripts"]["total"]+" pending: "+payload["testScripts"]["pending"]+" failed: "+payload["testScripts"]["failed"] | ||
}, | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*PrerequestScripts*:\ntotal: "+payload["prerequestScripts"]["total"]+" pending: "+payload["prerequestScripts"]["pending"]+" failed: "+payload["prerequestScripts"]["failed"] | ||
}, | ||
] | ||
} | ||
] | ||
} | ||
|
||
return block | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters