Coder Social home page Coder Social logo

Comments (25)

pemari-msft avatar pemari-msft commented on May 20, 2024 2

Hi all -- as you requested, we have unsealed all classes and virtualized all methods making service calls. We've verified that this enables mocking scenarios. Thanks for the request!

from azure-storage-net.

moswald avatar moswald commented on May 20, 2024 1

I can't believe we're still waiting on this one.

I'm tired of writing my own wrapper IBlobClient and IBlobContainer objects.

from azure-storage-net.

mxa0079 avatar mxa0079 commented on May 20, 2024

Started to address this with the following pull request: #90

from azure-storage-net.

PureKrome avatar PureKrome commented on May 20, 2024

Woot!

from azure-storage-net.

PureKrome avatar PureKrome commented on May 20, 2024

@moswald and there is even a PR sent, for this....

from azure-storage-net.

Cheesebaron avatar Cheesebaron commented on May 20, 2024

It is amazing that they don't even answer either the PR or this issue...

from azure-storage-net.

mirobers avatar mirobers commented on May 20, 2024

First, sorry for the late reply. We have been considering some kind of support for mocking for quite some time, but we want it to be a complete solution that doesn't increase the size and complexity of the codebase. Adding interfaces for our public classes doesn’t meet this requirement; it adds a bunch of files to the codebase that don’t need to be there.

However, we would like to consider an alternative instead: making methods virtual. This will allow easy use of tools such as Moq. We could make all public methods that make service calls virtual, and therefore you will be able to conveniently mock any service call your code makes. Please share your feedback and let us know what you think!

from azure-storage-net.

Cheesebaron avatar Cheesebaron commented on May 20, 2024

I think the problem is that you have already overcomplicated the code as is. You have dug yourself very deep into a hole you cannot get out of now, without collapsing the wall on the way out.

from azure-storage-net.

PureKrome avatar PureKrome commented on May 20, 2024

whoa @Cheesebaron - that escalated quickly!

@mirobers personally, I'm happy with making the method(s) virtual as that fits our mocking requirements.

from azure-storage-net.

moswald avatar moswald commented on May 20, 2024

Making the methods virtual works for me. I understand not wanting to bloat the codebase with interface files that simply mirror the only concrete implementation.

@Cheesebaron, do you have some specific examples on how this library is too complex?

from azure-storage-net.

TimLovellSmith avatar TimLovellSmith commented on May 20, 2024

@mirobers Virtual methods would be better than nothing - a big step in the right direction - so hooray if you do it! But it can be inconvenient faking out non-interface classes that don't have a default constructor.

from azure-storage-net.

mirobers avatar mirobers commented on May 20, 2024

Thanks for the feedback everyone! We will add this to our backlog for a future major version release.

from azure-storage-net.

moswald avatar moswald commented on May 20, 2024

@mirobers If you want to understand exactly what we're looking for, try writing a simple little app that consumes the Azure Storage lib, and then write tests that need to exercise the calls without making any network calls. We use NSubstitute as our mocking framework within xUnit.net tests.

from azure-storage-net.

PureKrome avatar PureKrome commented on May 20, 2024

@mirobers If I start a PR for this, would that help?

from azure-storage-net.

mirobers avatar mirobers commented on May 20, 2024

@moswald The docs for NSubstitute indicate that it supports substituting virtual methods of classes, so you should be good with the planned approach.

@PureKrome Thanks for the offer, but seeing as this change affects many different files across the library we would prefer to do this ourselves to minimize the potential for merge issues.

from azure-storage-net.

TimLovellSmith avatar TimLovellSmith commented on May 20, 2024

@mirobers I feel concerned at your statement that you don't want substantial contributions because they are hard to merge. Because they are only hard to merge if there are conflicts - and since you can require the pull request to be based on whatever commit you like, you can certainly require the pull requestor to give you a pull request that has no merge conflicts with whatever branch you care about. Is the real reason you can't accept such a pull request actually something else, like your lack of capacity to effectively review/vet large contributions?

from azure-storage-net.

pemari-msft avatar pemari-msft commented on May 20, 2024

@TimLovellSmith
I appreciate your concern. We do understand the merging process – as you might imagine, there’s active, ongoing development for this library happening behind the scenes. Because of that, it is nontrivial to ensure a pull requestor will not have merge conflicts (and this will be a sweeping change touching many files, increasing the likelihood of conflicts) as they will not have access to the branches where development has occurred. We also follow the semver versioning scheme, and so, as this is a larger change, we are looking to include this in a regular release milestone.

So, while we have the capacity to review large contributions via github, it only makes sense to accept them if the effort for the change is outweighed by the effort of taking the change from the community. Hope this helps clarify!

from azure-storage-net.

Cheesebaron avatar Cheesebaron commented on May 20, 2024

as they will not have access to the branches where development has occurred

Can you explain why this is so?

from azure-storage-net.

PureKrome avatar PureKrome commented on May 20, 2024

@Cheesebaron My guess is that an MS dev has made a local branch on their localhost machine and not pushed it up -- so we can't see/access that dev-branch.

. * * assumption **

from azure-storage-net.

Cheesebaron avatar Cheesebaron commented on May 20, 2024

My guess is that they are actively developing on a git repository internally and when they feel like it (i.e. they have something major to release) they push changes to github. Which is super bad practice if you want to accept pull requests.

from azure-storage-net.

guardrex avatar guardrex commented on May 20, 2024

Using TFS internally would make it more difficult.

Off-topic slightly, so I hope the OP doesn't mind if I interject here ... Some of the management at MS seems like they are either resistant to the community involvement concept or just waiting to see how it plays out with .NET and CoreFX before they embrace it. I think its working great over there, and this will probably be the smoothest release of the strongest .NET ever, because so many issues have been filed and addressed based on community members testing of nightly builds and prereleases and because many PR's in CoreFX have been for optimizations.

I hope the Storage Team is able to accept more PR's in the future and accept more good suggestions from the community. I still think we need an Annoucements repo!

IMHO @PureKrome should have been allowed to take a shot at the PR. If the team likes it and the unit tests pass, hey! better for all of us. If the team has problems and/or unit tests blow up, then I'm sure @PureKrome would understand if it were rejected. Shooting it down because it would "potential[ly]" not work out is a really bad way to continue developing software at MS ... again IMHO. At least look at the PR, then decide.

from azure-storage-net.

mirobers avatar mirobers commented on May 20, 2024

Thanks for the feedback everyone. This is getting really off-topic, but I want to make sure everyone knows the state of community contributions on the Azure storage repos. Our official policy is that we do accept community contributions in our repos. The newer storage repos (like the python client, iOS client, data movement library) are set up with contributions in mind and we have seen that model work well. We would like to make contributions easier in all of our repos and we are considering ways to restructure things internally to facilitate this.

In this particular case, at this particular time, unfortunately the work required to accept the contribution would outweigh the effort saved. I would not want anyone to spend their time on a PR that ultimately will not speed up the process.

Finally, let me restate that we are aware of the barriers to accepting contributions in this repo and we are working on removing those barriers. Of course, the Azure SDK Contribution Guidelines will continue to apply and we expect and appreciate coordination with us when contributing code.

from azure-storage-net.

PureKrome avatar PureKrome commented on May 20, 2024

from azure-storage-net.

flyingUnderTheRadar avatar flyingUnderTheRadar commented on May 20, 2024

Did I miss something. It does seem that we still have those classes as sealed. Example

public sealed partial class CloudQueueMessage

from azure-storage-net.

joshrizzo avatar joshrizzo commented on May 20, 2024

Did I miss something. It does seem that we still have those classes as sealed. Example

public sealed partial class CloudQueueMessage

Ya, CloudQueue is still not mockable... We seems to have made backwards progress

from azure-storage-net.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.