cryostat-legacy icon indicating copy to clipboard operation
cryostat-legacy copied to clipboard

test(recordings): Upload recording to Grafana itest

Open jan-law opened this issue 3 years ago • 4 comments

Related #474

Addresses the TODO in UploadRecordingIT:

TODO, this test needs to be updated to actually trigger a file to be uploaded to
jfr-datasource/grafana-dashboard now that the integration tests have these additional
containers configured

jan-law avatar Aug 04 '21 19:08 jan-law

Am I missing any additional cleanup or validations after the recording gets uploaded to Grafana?

jan-law avatar Aug 04 '21 19:08 jan-law

There is no additional cleanup to do. You could add some tests querying the datasource directly: https://github.com/cryostatio/jfr-datasource/#readme

ex. a GET /list to verify that the uploaded file is available for selection, and a POST /query to get some converted JSON data.

andrewazores avatar Aug 04 '21 19:08 andrewazores

@hareetd , do you remember what the status of this PR was? I think the issue was that the local integration tests ran too fast to pick up any data points, while the Github CI occasionally found data points when uploading the recording. After that, I'm not sure if you discovered anything else

jan-law avatar May 12 '22 21:05 jan-law

I think the issue was that the local integration tests ran too fast to pick up any data points, while the Github CI occasionally found data points when uploading the recording.

Yes, that's it.

After that, I'm not sure if you discovered anything else

I can't remember what exactly, but I tried a few different things to ensure the data points were retrieved, but no luck. I was stuck for a few days but ended up working on something else and forgot about this PR.

hareetd avatar May 12 '22 21:05 hareetd

Accidentally commit an old sub-module :D Removed it now and rebased on main.

tthvo avatar Oct 20 '22 21:10 tthvo

See #1139 for why mergify just leaves that comment and review there. Maintainers can force-merge it anyway or just dismiss mergify's review so it isn't a big deal, just an annoyance.

andrewazores avatar Oct 20 '22 21:10 andrewazores

@Mergifyio refresh

andrewazores avatar Oct 20 '22 21:10 andrewazores

refresh

✅ Pull request refreshed

mergify[bot] avatar Oct 20 '22 21:10 mergify[bot]

@Mergifyio refresh

andrewazores avatar Oct 20 '22 21:10 andrewazores

refresh

✅ Pull request refreshed

mergify[bot] avatar Oct 20 '22 21:10 mergify[bot]

I am not sure we can have a fixed expected datapoints as each new recording is different. To tackle this, I switched test to check:

  • datapoints array must be non-null.
  • If datapoints is not empty, check if each child array has 2 non-null elements. And 2nd element (timestamp) must be >= 0.

~Not yet ready for PR tho :(( waiting on this old tricky problem https://github.com/cryostatio/cryostat/pull/624#discussion_r1001548978.~

tthvo avatar Oct 21 '22 08:10 tthvo

Ready for review :D The old issue where datapoints are not picked up was due to timezone mismatch, so adjusting back time frame using UTC-0 worked as expected.

tthvo avatar Oct 21 '22 18:10 tthvo