EvalAI icon indicating copy to clipboard operation
EvalAI copied to clipboard

Add tests for jobs/aws_utils.py

Open Zahed-Riyaz opened this issue 8 months ago • 0 comments

This issue is a sub-issue of #4476. It aims to add tests for jobs/aws_utils.py, and ensure 100% coverage.

The generate_aws_eks_bearer_token function currently uses get_aws_credentials_for_challenge to generate aws_keys.

  • [ ] To isolate the tests for this function, I will use unittests.mock module to simulate external method behaviour such as simulating boto3 sessions or aws credential generation, etc.
  • [ ] To verify if Signer object returns the correct URL with the accurate parameters, we patch the RequestSigned method, and then code expected parameters as defined in function to assert they are equal.
  • [ ] And finally ensure that the URL returns the token when decoded at the end.

I will raise a PR implementing the above.

Zahed-Riyaz avatar Mar 29 '25 16:03 Zahed-Riyaz