microsoft / wopi-validator-core

A tool to test and validate server-side WOPI implementations
MIT License
42 stars 33 forks source link

Tests Don't Run Using net6.0 #106

Closed mikeebowen closed 2 years ago

mikeebowen commented 2 years ago

I pulled the latest update to be able to uses dotnet 6, but when I try to run the tests I receive this error:

System.ArgumentException: Could not find a prereq test case named {0} (Parameter 'SupportsCoauthPrereq')
   at Microsoft.Office.WopiValidator.Core.Factories.TestCaseFactory.GetPrereqTests(XElement definition, Dictionary`2 prereqsDictionary)+MoveNext() in C:\source\wopi-validator-core\src\WopiValidator.Core\Factories\TestCaseFactory.cs:line 43
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Microsoft.Office.WopiValidator.Core.ConfigParser.GetTestExecutionDataForGroup(XElement definition, Dictionary`2 prereqCasesDictionary, ITestCaseFactory testCaseFactory, IResourceManager resourceManager, TestCategory targetTestCategory) in C:\source\wopi-validator-core\src\WopiValidator.Core\ConfigParser.cs:line 52
   at Microsoft.Office.WopiValidator.Core.ConfigParser.<>c__DisplayClass1_0.<ParseExecutionData>b__1(XElement x) in C:\source\wopi-validator-core\src\WopiValidator.Core\ConfigParser.cs:line 38
   at System.Linq.Enumerable.SelectManySingleSelectorIterator`2.MoveNext()
   at System.Linq.Lookup`2.Create(IEnumerable`1 source, Func`2 keySelector, IEqualityComparer`1 comparer)
   at System.Linq.GroupedEnumerable`2.GetEnumerator()
   at System.Linq.Enumerable.SelectEnumerableIterator`2.MoveNext()
   at Microsoft.Office.WopiValidator.Program.Execute(Options options) in C:\source\wopi-validator-core\src\WopiValidator\Program.cs:line 98
   at Microsoft.Office.WopiValidator.Program.<>c.<Main>b__1_0(Options options) in C:\source\wopi-validator-core\src\WopiValidator\Program.cs:line 46
   at CommandLine.ParserResultExtensions.MapResult[TSource,TResult](ParserResult`1 result, Func`2 parsedFunc, Func`2 notParsedFunc)
   at Microsoft.Office.WopiValidator.Program.Main(String[] args) in C:\source\wopi-validator-core\src\WopiValidator\Program.cs:line 44

I did a git bisect and the error was introduced by this commit https://github.com/microsoft/wopi-validator-core/commit/81efc00e5720d12adda009e984c6960ca9206c6f . Unfortunately a lot was changed in that commit. If I revert to the previous version and use netcoreapp2.0 the tests pass. Let me know if more information is needed.

yang573 commented 2 years ago

Speculating here, are you missing the test case in your TestCases.xml? Under the <PrereqCases> tag, you should have the <TestCase Name="SupportsCoauthPrereq" Category="WopiCoauth"> tag too.

mikeebowen commented 2 years ago

Thanks for the suggestion @yang573 , but unfortunately the <TestCase Name="SupportsCoauthPrereq" Category="WopiCoauth"> element is in the TestCases.xml file. I'm trying to run the main branch without any code changes, so I have everything that is in the repo.

mikeebowen commented 2 years ago

It turns out the issue was that I had an incorrect path to my WOPI server. I fixed that and now it works. It's an odd error for an incorrect URL, but it's working now, so I'll close this issue