Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(recordings): Verify file contents from RecordingWorkflowIT #619

Merged
merged 3 commits into from
Aug 4, 2021

Conversation

jan-law
Copy link
Contributor

@jan-law jan-law commented Aug 4, 2021

Related #474

Addresses the TODOs in RecordingWorkflowIT:

// verify that reports can be downloaded successfully and yield non-empty HTML documents
// (TODO: verify response body is a valid HTML document)
// verify in-memory and saved recordings can be downloaded successfully and yield
// non-empty recording binaries (TODO: better verification of file content), and that
// the fully completed in-memory recording is larger than the saved partial copy

@jan-law jan-law added the test label Aug 4, 2021
@jan-law jan-law changed the title test(recordings): Verify report contents test(recordings): Verify file contents from RecordingWorkflow Aug 4, 2021
@jan-law jan-law changed the title test(recordings): Verify file contents from RecordingWorkflow test(recordings): Verify file contents from RecordingWorkflowIT Aug 4, 2021
@jan-law
Copy link
Contributor Author

jan-law commented Aug 4, 2021

What kinds of verification would be useful for the jfr files?

@andrewazores
Copy link
Member

andrewazores commented Aug 4, 2021

What kinds of verification would be useful for the jfr files?

JMC has a JFR file parser that we can probably use here - should be able to grab that through the -core dependency. I think checking that the JFR binary is parseable and that the resulting list of events is non-empty is probably enough. Also checking the byte-length of the binaries to do the "fully completed recording is larger than the saved partial copy" could be sufficient, although if there's already a JFR parser available then may as well use that to parse both and check that the parsed list of events is longer.

If you target Cryostat itself and use the Cryostat event template then I think you can guarantee that the recording should contain some events.

@jan-law
Copy link
Contributor Author

jan-law commented Aug 4, 2021

if there's already a JFR parser available then may as well use that to parse both and check that the parsed list of events is longer

I found a JFR parser from jdk.jfr.consumer.RecordingFile that returns a list of events as I couldn't find the parser in -core.

@jan-law jan-law marked this pull request as ready for review August 4, 2021 16:08
@andrewazores
Copy link
Member

if there's already a JFR parser available then may as well use that to parse both and check that the parsed list of events is longer

I found a JFR parser from jdk.jfr.consumer.RecordingFile that returns a list of events as I couldn't find the parser in -core.

Nice, that's even better.

@andrewazores andrewazores merged commit 8b4547a into cryostatio:main Aug 4, 2021
@jan-law jan-law deleted the itest-workflow-report branch August 4, 2021 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants