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

Add initial interop testing framework #1932

Merged
merged 1 commit into from
Jul 28, 2020
Merged

Conversation

hughbe
Copy link
Contributor

@hughbe hughbe commented Sep 18, 2019

Proposed Changes

  • Add C++ interop tests for WebBrowserSiteBase

@JeremyKuhne @RussKie @zsd4yr

Microsoft Reviewers: Open in CodeFlow

@hughbe hughbe requested a review from a team as a code owner September 18, 2019 12:34
@codecov
Copy link

codecov bot commented Oct 29, 2019

Codecov Report

Merging #1932 into master will decrease coverage by 38.34061%.
The diff coverage is n/a.

@@                 Coverage Diff                  @@
##              master       #1932          +/-   ##
====================================================
- Coverage   65.14931%   26.80870%   -38.34061%     
====================================================
  Files           1328         855         -473     
  Lines         489778      266794      -222984     
  Branches       40042       37916        -2126     
====================================================
- Hits          319087       71524      -247563     
- Misses        165265      190162       +24897     
+ Partials        5426        5108         -318     
Flag Coverage Δ
#Debug 26.80870% <ø> (-38.34061%) ⬇️
#production 26.80870% <ø> (-7.37191%) ⬇️
#test 100.00000% <ø> (+1.53383%) ⬆️

@hughbe
Copy link
Contributor Author

hughbe commented Jan 21, 2020

Waiting on dotnet/arcade#4533. Does anyone know how I can pull in a PR build of aracde so I can test getting this working with the new SDK? Do I have to have a local build, maybe

@RussKie RussKie mentioned this pull request Feb 19, 2020
@RussKie
Copy link
Member

RussKie commented Feb 19, 2020

Just to confirm, is this work addressing #1817?

@hughbe
Copy link
Contributor Author

hughbe commented Apr 19, 2020

Just to confirm, is this work addressing #1817?

It makes a start by adding a limited set of tests. Mostly the PR is designed to setup the infrastructure for adding more tests in the future

@hughbe
Copy link
Contributor Author

hughbe commented Apr 28, 2020

YAY! dotnet/arcade has merged the change we need. Now we need the latest version of arcade (#3134) and we can get this PR out of WIP!!

@hughbe
Copy link
Contributor Author

hughbe commented Apr 29, 2020

Looks like the latest build of arcade still isn't out :)

@hughbe hughbe changed the title [WIP] Add initial interop testing framework Add initial interop testing framework May 1, 2020
@hughbe
Copy link
Contributor Author

hughbe commented May 1, 2020

Okee dokee, we have progress! I've rebased the PR onto the latest master, which has Microsoft.DotNet.CMake.SDK

However we now have the following error in build:

.packages\microsoft.dotnet.cmake.sdk\5.0.0-beta.20228.4\build\Microsoft.DotNet.CMake.Sdk.targets(29,5): error : (NETCORE_ENGINEERING_TELEMETRY=Build) A CMake project must be built for a specific architecture.

I suspect it is because we're building the c# test project as AnyCPU but should be building it for x86 and x64 separately.

Also I would add it wasn't clear that I had to include Microsoft.DotNet.CMake.Sdk in global.json :))

@hughbe
Copy link
Contributor Author

hughbe commented Jun 16, 2020

Yeah sadly adding to the path doesn’t seem to work anymore now that we init the tools only once. It may be possible that the path changed. Will Check after my exam today

@hughbe
Copy link
Contributor Author

hughbe commented Jun 16, 2020

Lets see if a similar change to 32eaa68 changing from tools/native/bin -> tools/bin will work

@weltkante

This comment has been minimized.

@hughbe
Copy link
Contributor Author

hughbe commented Jul 27, 2020

@RussKie could you take another look at this?

@RussKie
Copy link
Member

RussKie commented Jul 28, 2020

@vatsan-madhavan any further concerns?

@vatsan-madhavan
Copy link
Member

@vatsan-madhavan any further concerns?

lgtm.

@RussKie
Copy link
Member

RussKie commented Jul 28, 2020

could you take another look at this?

I'm probably with the least of knowledge in this area here. Everyone seem to give thumbs up, and the build is green, so :shipit:
We can always iterate further and tweak, if necessary.

A massive feat, thank you 🚀

@RussKie RussKie merged commit 3bae4e6 into dotnet:master Jul 28, 2020
@ghost ghost added this to the 5.0 RC1 milestone Jul 28, 2020
@hughbe hughbe deleted the interop-tests branch July 28, 2020 08:32
@vatsan-madhavan
Copy link
Member

Nice job @hughbe!

@RussKie

This comment has been minimized.

@hughbe
Copy link
Contributor Author

hughbe commented Jul 29, 2020

Igor what is your version of cmake (cmake --version)? This looks similar to dotnet/runtime#660 so perhaps updating your cmake might work

@vladimir-krestov
Copy link
Contributor

@hughbe, I had cmake version 3.17.20032601-MSVC_2 as now too. Before I had a different error in build.cmd:
image
But I just updated VisualStudio ✔️ , restart PC and now build works well:
image
FYI: @RussKie

@RussKie
Copy link
Member

RussKie commented Jul 29, 2020

C:\Development\winforms>cmake --version
cmake version 3.17.20032601-MSVC_2

I'm also on the internal preview of VS Version 16.8.0 Preview 2.0 [30324.147.master].... 🤔

@RussKie
Copy link
Member

RussKie commented Jul 29, 2020

I have updated VS and rebooted... No joy.
Can't build from VS either:

33>------ Rebuild All started: Project: System.Windows.Forms.Interop.Tests, Configuration: Debug x86 ------
32>C:\Development\winforms\src\System.Windows.Forms.Design\tests\UnitTests\System\ComponentModel\Design\Serialization\CodeDomSerializerExceptionTests.cs(99,61,99,99): warning SYSLIB0011: 'BinaryFormatter.Serialize(Stream, object)' is obsolete: 'BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.'
32>C:\Development\winforms\src\System.Windows.Forms.Design\tests\UnitTests\System\ComponentModel\Design\Serialization\CodeDomComponentSerializationServiceTests.cs(808,61,808,95): warning SYSLIB0011: 'BinaryFormatter.Serialize(Stream, object)' is obsolete: 'BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.'
32>C:\Development\winforms\src\System.Windows.Forms.Design\tests\UnitTests\System\ComponentModel\Design\ExceptionCollectionTests.cs(49,61,49,100): warning SYSLIB0011: 'BinaryFormatter.Serialize(Stream, object)' is obsolete: 'BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.'
32>System.Windows.Forms.Design.Tests -> C:\Development\winforms\artifacts\bin\System.Windows.Forms.Design.Tests\Debug\netcoreapp5.0\System.Windows.Forms.Design.Tests.dll
32>Done building project "System.Windows.Forms.Design.Tests.csproj".
33>System.Windows.Forms.Interop.Tests -> C:\Development\winforms\artifacts\bin\System.Windows.Forms.Interop.Tests\x86\Debug\netcoreapp5.0\System.Windows.Forms.Interop.Tests.dll
33>'cmake' is not recognized as an internal or external command,
33>operable program or batch file.
33>C:\Users\igveliko\.nuget\packages\microsoft.dotnet.cmake.sdk\5.0.0-beta.20256.5\build\Microsoft.DotNet.CMake.Sdk.targets(172,5): error MSB3073: The command "
33>C:\Users\igveliko\.nuget\packages\microsoft.dotnet.cmake.sdk\5.0.0-beta.20256.5\build\Microsoft.DotNet.CMake.Sdk.targets(172,5): error MSB3073:       
33>C:\Users\igveliko\.nuget\packages\microsoft.dotnet.cmake.sdk\5.0.0-beta.20256.5\build\Microsoft.DotNet.CMake.Sdk.targets(172,5): error MSB3073:       
33>C:\Users\igveliko\.nuget\packages\microsoft.dotnet.cmake.sdk\5.0.0-beta.20256.5\build\Microsoft.DotNet.CMake.Sdk.targets(172,5): error MSB3073:        cmake -G "Visual Studio 16 2019" -A Win32 -B "C:\Development\winforms\artifacts\obj\NativeTests\x86\Debug" -S "" -DCMAKE_INSTALL_PREFIX=C:\Development\winforms\artifacts\bin\NativeTests\x86\Debug
33>C:\Users\igveliko\.nuget\packages\microsoft.dotnet.cmake.sdk\5.0.0-beta.20256.5\build\Microsoft.DotNet.CMake.Sdk.targets(172,5): error MSB3073:       " exited with code 9009.
33>Done building project "NativeTests.proj" -- FAILED.
Build has been canceled.

@vladimir-krestov
Copy link
Contributor

Sometimes I see this problem in VS too.

@RussKie
Copy link
Member

RussKie commented Jul 29, 2020

I think I had a headway.

I found cmake.exe and a cmake folder in winforms\.tools\native\bin folder. cmake.exe was dated 10 Jul 2020, and the folder had cmake 3.14.2...
I have deleted both, and it appears to work now.

I have also nuked the whole .tools folder, and it seemed to make no difference to the build ¯\_(ツ)_/¯

@RussKie
Copy link
Member

RussKie commented Jul 29, 2020

VS can't find cmake, so we'll need to tweak start-vs.cmd to resolve and add the path to cmake, I guess the Arcade build scripts do it internally.

In mean time I solved it by installing cmake globally: choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System' and reboot.

@vatsan-madhavan
Copy link
Member

See https://aka.ms/vs/workloads - Microsoft.VisualStudio.Component.VC.CMake.Project

Can you add that to your VS installation and then try again ? Once you've figured out a min-set of workloads needed to build dotnet/winforms, document it like this.

@RussKie
Copy link
Member

RussKie commented Jul 30, 2020

Thank you @vatsan-madhavan, I knew it was possible just didn't know how.

@ghost ghost locked as resolved and limited conversation to collaborators Feb 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-COM area-Interop test-enhancement Improvements of test source code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants