trafficcontrol icon indicating copy to clipboard operation
trafficcontrol copied to clipboard

Refactor Origins Tests

Open ericholguin opened this issue 2 years ago • 0 comments

This PR refactors v4/origins_test.go, v3/origins_test.go, in order to make tests more granular, providing transparency on what is being tested and reducing the need to dig through test code to confirm what was tested. In addition this new test structure should also make it easier for new tests to be added as well as reduce redundant code.

  • Adds data driven testing
    • Descriptive test names
  • Sub tests for organization
    • Use GoLangs test runner
  • Use assert functionality
    • Provides fundamental assertions
    • Streamlines code
    • Reduces nested conditionals
  • Adds expectation functions
    • Test specific expectations in a clear concise way
    • Reusable expectations

Which Traffic Control components are affected by this PR?

  • Traffic Ops Tests

What is the best way to verify this PR?

Run TO Integration Tests

PR submission checklist

ericholguin avatar Aug 10 '22 22:08 ericholguin