Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cary/service url rotation unit tests 184441012 #231

Merged
merged 5 commits into from
Feb 22, 2023

Conversation

carybakker
Copy link
Contributor

Soundtrack of this PR: Converting Units

Motivation

A number of tests that are implemented as Integration Tests should really be handled via Unit Tests. Integration Tests will still handle the holistic testing of functionality, but granular tests for code coverage or specific cases can be more efficiently handled with Unit Tests.

This has become much more important as the amount of time required to execute Integration Tests has increased with the number of Integration Tests implemented, to the point where it impacts out ability to release in a timely manner.

In this PR

  • This PR moves a few of the test candidates for this change, around URL Load balancing, to Unit Tests to improve Integration Test execution time.

Future Work

  • additional integration tests for subsets of full flows or specific cases for code coverage may also be moved to unit tests in the future

Copy link
Collaborator

@the-real-adammork the-real-adammork left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove/collapse this file Tests/Fixtures/UrlLoadBalancerFixtures.swift in-line where the tests are called, plus some other small changes

Cary A. Bakker added 2 commits February 20, 2023 17:19
 * de-abstracted the tests - moved some logic from fixture into tests
 * updated config of MockHttpRequester so it's dependency injected by the tests for clarity
 * renamed MockHttpRequester to MockFailingHttpRequester to clearly communicate its purpose
@carybakker
Copy link
Contributor Author

remove/collapse this file Tests/Fixtures/UrlLoadBalancerFixtures.swift in-line where the tests are called, plus some other small changes

I didn’t fully collapse the test fixture file (just noticed that comment at the end), but I did put the config code relevant to the tests inline…

I think it does what you were looking for in terms of ‘demonstrating’ the intent of the test without bloating the test file with all the config of the individual service connections

Copy link
Collaborator

@the-real-adammork the-real-adammork left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If those extra strings in the fixture file can be removed, that would be ideal, if not, ok to merge

@carybakker carybakker merged commit f5945ca into master Feb 22, 2023
@carybakker carybakker deleted the cary/service-url-rotation-unit-tests-184441012 branch February 22, 2023 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants