Why files are sand and saved in format .bin ?
See original GitHub issueGood day! Rewrote the script from Python to Groovy, send reports to the server, but attachments do not appear, if you upload them they are in .bin format. Tell me the pictures do not need to be encrypted when sending?
task sendReports {
group "Work Allure Server api"
description "send results test in remote server"
doLast {
File f = new File("${project.buildDir}/allure-results");
if (f.exists() && f.isDirectory()) {
def request = new Request()
f.eachFile {
Reports files = new Reports(
file_name: it.name,
content_base64: it.text.bytes.encodeBase64()
)
request.results.add(files)
}
def req = new URL(gradle.allureServer+"/send-results").openConnection()
req.setRequestMethod("POST")
req.setRequestProperty("Content-Type", "application/json; charset=UTF-8")
req.setDoOutput(true)
req.getOutputStream().write(JsonOutput.toJson(request).getBytes("UTF-8"))
logger.quiet "Status code: ${req.getResponseCode()}"
def resp = new JsonSlurper().parseText(req.getInputStream().getText())
logger.quiet "Response: ${resp}"
} else {
logger.quiet "Not folder: ${project.buildDir}/allure-results"
}
}
}
class Request {
List<Reports> results = new LinkedList<>()
}
class Reports {
String file_name
String content_base64
}
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:6 (3 by maintainers)
Top Results From Across the Web
How To Open BIN Files | .BIN File Opener Tools
BIN files that are saved in the basic binary format. But for others, you can't open them directly on your computer. You can...
Read more >Attachments coming through as bin files - TechNet - Microsoft
The file shows as bin even when accessed through OWA, directly on Exchange. Any idea what's going on?
Read more >How to Open a Bin File on Android
The .BIN file format is actually designed to store information in a binary format. The binary formatting is compatible with disk storage and...
Read more >Decoding Binary File Formats - YouTube
A basic introduction to processing binary files in Ruby, using PNG as an example. Code is at: https://github.com/sandal/binary_examples.
Read more >How to view a binary file? - Unix & Linux Stack Exchange
Compiled binary files are no different, they are stored as 1's and 0's. arzyfex's answer gives you the tools to view those files...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@FullZero5 I’ve added it a new example in case you use pipelines in Jenkins https://github.com/fescobar/allure-docker-service/blob/master/allure-docker-api-usage/send_results_jenkins_pipeline.groovy
I’ll add the code, it might come in handy for someone (it works somehow)