Skip to content

[Bug] Scorecard tests do not exercise long-running/async job API #986

@andrewazores

Description

@andrewazores

Current Behavior

Scorecard tests do not have a websocket server connection, so the report generation request (currently the only long-running job request) was adjusted from expecting a full report JSON response to simply expecting an OK status code and a string ID response body.

Expected Behavior

The scorecard tests should maintain a websocket server connection that can be used to listen for notifications from the server. When testing long-running jobs, like report generation, the scorecards should:

  1. Fire the initial request
  2. Check the response status code and/or Content-Type header. This will indicate whether the response body should be interpreted as a string job ID, or as a JSON response body, or nothing at all (for jobs which do not produce a response body).
  3. If the response was a job ID, the test client should wait for a websocket notification to be emitted which has the expected notification category (ex. report generation) and indicates that the job with the same ID has been completed. Once that notification has been emitted, the client should re-fire the original request.
  4. If the response was a JSON response body, the client should check that the body passes whatever assertions the test wants to make.

Steps To Reproduce

No response

Environment

No response

Anything else?

#985
cryostatio/cryostat#698
cryostatio/cryostat#286

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions