conan-io / conan-vs-extension

Conan Extension for Visual Studio
https://marketplace.visualstudio.com/items?itemName=conan-io.conan-vs-extension
MIT License
59 stars 34 forks source link

Improve CI: check that the extension installs in VS2017 and VS2019 [skip changelog] #104

Closed jgsogo closed 5 years ago

jgsogo commented 5 years ago

closes https://github.com/conan-io/conan-vs-extension/issues/96 closes https://github.com/conan-io/conan-vs-extension/issues/116

Playing with Appveyor we can create the extension in the first job using VS2019, upload the artifact and then get the artifact from the other jobs and install it in the corresponding VS version.

TODO:

SSE4 commented 5 years ago

initially I was going to use MSBuild tasks exposed from the vsix to verify it's correctly installed however, it turns out it's not something recommended per https://blogs.msdn.microsoft.com/visualstudio/2010/06/09/vsix-best-practices/:

Some extensions still need to be installed by MSI: for example some of your files might have to be in a specific, well-known loca
tion, you might have a component like an MSBuild task that VSIX install doesn’t support, you might need to use binding redirection – see more information here

as installation location isn't something we have control over, I think it's not the way to go.

however, it turns out there is a simpler way - just expose command line switch for devenv.exe: https://docs.microsoft.com/en-us/visualstudio/extensibility/adding-command-line-switches?view=vs-2019 therefore, calling devenv.exe without our own switch may trigger extension to be loaded, and we may verify that it's actually installed and loaded.

jgsogo commented 5 years ago

I'm really worried about the test line . "$devenv" /ConanVisualStudioVersion /?. Sometimes it works and sometimes it doesn't print the version, so you get lots of false positives 😕

Besides that, I like the approach in three stages:

jgsogo commented 5 years ago

Please, @SSE4 , review paying extra attention. I think it is ready although I'm still worried with the false negatives

jgsogo commented 5 years ago

About the other comments, I prefer to leave them there for the future... This PR already contains enough noise