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

Updated UnitTests to use the same strongnaming logic as the main SDK #178

Closed
wants to merge 8 commits into from

Conversation

jstedfast
Copy link
Member

Description of Change

Describe your changes here.

Bugs Fixed

  • Provide links to bugs here

API Changes

List all API changes here (or just put None), example:

Added:

  • void SomeMethod()

Changed:

  • void SomeMethod() => bool SomeMethod()

Behavioral Changes

Describe any non-bug related behavioral changes that may change how users app behaves when upgrading to this version of the codebase.

PR Checklist

  • Has tests (if omitted, state reason in description)
  • Rebased on top of master at time of PR
  • Changes adhere to coding standard

@jstedfast
Copy link
Member Author

Okay, so I think we have to strongname UnitTests.dll so that InternalsVisibleTo works, but we also need to strongname Microsoft.Xaml.Behaviors.dll so that UnitTests.dll doesn't complain that it's loading an unsigned assembly.

@jstedfast
Copy link
Member Author

Ugh! still failing:

Error: D:\a\XamlBehaviorsWpf\XamlBehaviorsWpf\Test\UnitTests\KeyTriggerTest.cs(20,25): error CS0281: Friend access was granted by 'Microsoft.Xaml.Behaviors, Version=1.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a', but the public key of the output assembly ('') does not match that specified by the InternalsVisibleTo attribute in the granting assembly. [D:\a\XamlBehaviorsWpf\XamlBehaviorsWpf\Test\UnitTests\UnitTests.csproj]

@mgoertz-msft
Copy link
Member

Hmm, seems to me that SignAssembly and DelaySign should always be true for all assemblies. And in the official build the product assembly would actually get signed.

@jstedfast
Copy link
Member Author

I got this building/running locally and the issue seemed to be some sort of incompatibility between msbuild and dotnet test not being able to run the built tests without having issues.

Once switching over to vstest.console.exe, it worked locally. Hopefully the same will be true on the bots.

@jstedfast
Copy link
Member Author

Run microsoft/[email protected]
with:
testAssembly: Test\UnitTests\bin\Release\net462\UnitTests.dll
resultLogsArtifactName: vs-test-result-logs
ifNoFilesFound: warn
env:
DOTNET_ROOT: C:\Users\runneradmin\AppData\Local\Microsoft\dotnet
GitAssemblyInformationalVersion: 1.1.135+b1f1bcd790
GitBuildVersion: 1.1.135.61873
GitBuildVersionSimple: 1.1.135
Downloading test tools...
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe Invoke-WebRequest -Uri https://aka.ms/local-worker-win-x6[4](https://github.com/microsoft/XamlBehaviorsWpf/actions/runs/10583947960/job/29327060389?pr=178#step:7:4) -OutFile D:\a_actions\microsoft\vstest-action\v1.0.0\dist\win-x64.zip
Invoke-WebRequest : The remote name could not be resolved: 'localworker.blob.core.windows.net'
At line:1 char:1

  • Invoke-WebRequest -Uri https://aka.ms/local-worker-win-x64 -OutFile D ...
  •   + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc 
     eption
      + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
    
    

Error: The process 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe' failed with exit code 1
Warning: No files were found with the provided path: TestResults. No artifacts will be uploaded.

@jstedfast
Copy link
Member Author

Looks like the vstest action is broken due to a link to a non-existent resource on the web.

I propose deleting the GitHub pipeline

@jstedfast jstedfast closed this Aug 27, 2024
@jstedfast jstedfast deleted the dev/jestedfa/github-pipeline-fix2 branch August 27, 2024 18:44
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.

2 participants