Skip to content

Refactor gitlab client request job tests to table tests

What does this MR do?

Tests are a great way to understand the behaviour of a piece of code. While going Through the tests to understand client behaviour found that the tests were scattered and difficult to understand what they were testing against.

Refactor gitlab client request job tests to table tests

  • Makes it easier to understand the client method behaviour and combines multiple tests into one table test.
  • Converted the JSON response from a map to a raw JSON string, meaning marshalling is no longer required, making the response easier to read.

Why was this MR needed?

Refactor the unit to be more idiomatic.

What's the best way to test this MR?

go test -timeout 30s gitlab.com/gitlab-org/gitlab-runner/network

What are the relevant issue numbers?

NA

Note for reviewer

Follow-up PRs will be created to refactor other tests in the file. This is one of many.

Edited by Love Bhardwaj

Merge request reports

Loading