question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Clean up dependencies for live / mock testing for client libraries

See original GitHub issue

At present, to enable our live / mock tests, we are using two specific versions of azure-mgmt-resources, as this particular management library provided utility classes for live/mock testing that are helpful. Depending on management libraries within the client libraries for testing feels weird, but even worse is the fact that we depend on two different versions, with one being a snapshot.

What I propose is that we isolate the set of classes we use out of azure-mgmt-resources, and add these as classes in either an azure-common-test module, or else as part of azure-common in src/test.

  1. We need an InterceptorManager. There are two candidates (and we may bring them both in, for track two and track one, respectively): 1.1 The ‘V3’ InterceptorManager 1.2 The ‘original’ InterceptorManager

  2. We also require com.microsoft.azure.management.resources.core.TestBase, or an equivalent.

  3. As well as com.microsoft.azure.management.resources.fluentcore.utils.ResourceManagerThrottlingInterceptor

  4. We should transfer relevant test classes out of the azconfig directory into this new location.

The ideal outcome out of this would be to entirely drop out dependency on azure-mgmt-resources, and to resolve the dependency version divergence that we create.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
JonathanGilescommented, Apr 15, 2019

The main goal here is to no longer depend on azure-mgmt-resources in any of our client libraries.

0reactions
sima-zhucommented, May 8, 2019

Finished #1, #2, #4 For #3, currently the use case can basically be covered by reactor API(https://www.javacodegeeks.com/2017/09/testing-time-based-reactor-core-streams-virtual-time.html)

We will implement the interceptor if there is use case we need to build up more stuff on the top of the API.

Same as the ResourceManagerThrottlingInterceptor, we will add more functionalities when they are necessary in track two.

I will close the issue for now. Please feel free to reopen if any other issue to address.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using Mocks to Test External Dependencies or Reduce ...
So far we've used mocks to test external dependencies, like Django's mail-sending function. The main reason to use a mock was to isolate ......
Read more >
Clean mocking for unit tests using NSubstitute in .NET (Core ...
Become a Patreon and get source code access: https://www.patreon.com/nickchapsasCheck out my courses: https://nickchapsas.
Read more >
5 Mocking Techniques for Go | Golang Mocking for Unit Testing
When dealing with a downstream dependency, use these 5 mocking techniques for Go to keep your unit test fast, self-contained, and reliable.
Read more >
Software Testing - Mock Testing - GeeksforGeeks
Avoid using dependencies on infrastructure while writing unit testing so that it can be reserved for integration tests. · Keep unit tests in...
Read more >
Testing with Mocks & Spies • Angular - codecraft.tv
Testing with real instances of dependencies causes our test code to know about the inner workings of other classes resulting in tight coupling...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found