Is it possible to concatenate a bunch of file dige...
# plugins
r
Is it possible to concatenate a bunch of file digests together, or is there a built in method/rule to convert bytes into
FileDigest
objects?
Context is these custom acceptance tests I'm writing run a couple of different processes and I just want to concatenate the stdout and stderrs together for the test result.
r
oh I didn't realize merge digests would work for
FileDigest
objects
b
I don't think that'd work, the types don't match.
A
FileDigest
is missing the name
r
Can I just create a
FileDigest
from bytes somehow?
b
I think you'd have to do: • CreateDigest([FileContent(,,,)) -> Digest • Digest -> DigestEntries • digest_entries[0].file_digest But that seems like maybe we're coming at the problem wrong? Why do you just want the file digest?
r
To pass to test result, since I want to concatenate different the stdouts and stderrs of the various processes that are running together https://github.com/pantsbuild/pants/blob/78775b9716f93609a599d9efd17e169e574f17f2/src/python/pants/core/goals/test.py#L79-L82
b
Ah I see
Yeah, I think IIUC that'd be the only way. You can one-shot this for both stderr and stdout by
CreateDigest
with two
FileContent
in the iterable)
r
Cool, will do that then. Thanks!
b
I wonder why that field is there though. Seems out of place to me 😅