Conversation
3995548 to
76e1687
Compare
|
Without understanding all the minutia of the unit tests, think I get the gist and they look good to me. Essentially, asserts of various kinds to ensure the API still behaves as we expect it should. How frequently would you run these? No nits. LGTM on my end. |
Tests will run as a check for each commit in PRs, I added them in the preflight-push.yaml but we can also have them running daily in a cron, do you want me to add that? |
|
Right now we're not being rate limited for our usage on GitHub enterprise but we could be. I guess the question would be what it makes sense to have them run on a CRON and then if a job ever breaks, we could always run the unit tests to see if that indeed is the problem. That way we're not running them every time?? |
Well, the idea of the unit tests is to make sure a PR does not break the queries.. that is why I think they should run as a pre check |
| query = "search/jql?jql=project=MTE" | ||
| self.client.get_search(query, "issues") | ||
| params_used = mock_get.call_args.kwargs["params"] | ||
| self.assertEqual(params_used["fields"], "key,summary") |
There was a problem hiding this comment.
I would also check the full URL as we're checking params but not verifying the full URL passed to requests.get.
called_url = mock_get.call_args.args[0]
self.assertEqual(called_url, f"{JIRA_HOST}search/jql")3044eb7 to
5194bce
Compare
5194bce to
b1b7b17
Compare

We would like to add unit tests to our APIs so that we know when something may be broken by changes in PRs.
We may need to also run this periodically to check possible breakages in APIs upgrades.