tag:help.appveyor.com,2012-11-13:/discussions/problems/3938-test-failures-on-appveyor-no-duplicated-locallyAppVeyor: Discussion 2018-08-25T02:03:44Ztag:help.appveyor.com,2012-11-13:Comment/388337332016-01-05T06:22:45Z2016-01-05T06:22:45ZTest failures on AppVeyor, not duplicated locally<div><p>I've got the build passing by skipping the tests, but, of
course, that's cheating.</p></div>roy.ivy.iiitag:help.appveyor.com,2012-11-13:Comment/388337332016-01-05T19:20:14Z2016-01-05T19:20:14ZTest failures on AppVeyor, not duplicated locally<div><p>I don't know the specifics of those failing tests, but can you
please create a very simple example of script demonstrating the
issue, preferably without pester at all.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/388337332016-01-06T23:44:25Z2016-01-06T23:44:25ZTest failures on AppVeyor, not duplicated locally<div><p>Yep, I'll set something up and reply again. It may be a couple
of days.</p>
<ul>
<li>Roy</li>
</ul></div>roy.ivy.iiitag:help.appveyor.com,2012-11-13:Comment/388337332016-01-07T01:58:51Z2016-01-07T01:59:27ZTest failures on AppVeyor, not duplicated locally<div><p>I had some time tonight and pared everything down.</p>
<p>In branch <code>t-appveyor</code> of the repository,
<code>.\test.ps1</code> passes locally on all machines (including a
Win8.1 machine with a duplicate <code>$PSVersionTable</code>) but
fails on AppVeyor.</p>
<p>The specific test is at (<a href="https://ci.appveyor.com/project/rivy/scoop/build/374-t-appveyor">https://ci.appveyor.com/project/rivy/scoop/build/374-t-appveyor</a>).</p>
<p>Does that narrow down the issue?</p></div>roy.ivy.iiitag:help.appveyor.com,2012-11-13:Comment/388337332016-01-08T22:16:51Z2016-01-08T22:16:51ZTest failures on AppVeyor, not duplicated locally<div><p>Yeah, that's definitely helps, thanks.</p>
<p>I've tried running the build and in fact <code>$o</code>
contains $null: <a href="https://ci.appveyor.com/project/FeodorFitsner/scoop">https://ci.appveyor.com/project/FeodorFitsner/scoop</a></p>
<p>Where does it get $null from?</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/388337332016-01-08T23:17:56Z2016-01-08T23:17:56ZTest failures on AppVeyor, not duplicated locally<div><p>Ok, I think that narrows down the problem.</p>
<p>The function loads an assembly dll (Newtonsoft.Json). The
version AppVeyor shows is '7.0.0.0', but my version locally on all
of my test machines is '8.0.0.0'. Your machine must be loading a
prior version, and I need '8.0.0.0'.</p>
<p>I'll try to force a reload and see if that will fix the test
issue.</p></div>roy.ivy.iiitag:help.appveyor.com,2012-11-13:Comment/388337332016-01-09T02:15:26Z2016-01-09T02:15:26ZTest failures on AppVeyor, not duplicated locally<div><p>I'm perplexed at this point.</p>
<p>I believe the problem boils down to an incorrect assembly being
loaded. But I don't understand how the '7.0.0.0' version is being
loaded. If you look at <a href="https://ci.appveyor.com/project/rivy/scoop/build/392-t-appveyor">https://ci.appveyor.com/project/rivy/scoop/build/392-t-appveyor</a>
, it appears that the assembly loaded from the clone is '7.0.0.0'.
But the same code, cloned locally, loads the assembly with version
'8.0.0.0'.</p>
<p>Am I missing something here?</p>
<p>Where would the other version be coming from?</p></div>roy.ivy.iiitag:help.appveyor.com,2012-11-13:Comment/388337332016-01-11T05:08:17Z2016-01-11T05:08:17ZTest failures on AppVeyor, not duplicated locally<div><p>AppVeyor build agent is currently referencing Newtonsoft.Json
7.0.1 if that helps.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/388337332016-01-16T05:19:52Z2016-01-16T05:19:52ZTest failures on AppVeyor, not duplicated locally<div><p>I've tried several different methods of loading the assembly
('-force', etc), but I keep getting a copy with version '7.0.0.0'
as shown in the test.</p>
<p>I'm at a loss on how to fix this... any ideas on your end?</p></div>roy.ivy.iiitag:help.appveyor.com,2012-11-13:Comment/388337332016-01-16T23:26:24Z2016-01-16T23:26:24ZTest failures on AppVeyor, not duplicated locally<div><p>It loads 7.0.0.0 even like that: <a href="https://github.com/FeodorFitsner/scoop/blob/t-appveyor/appveyor.yml#L13-L15">
https://github.com/FeodorFitsner/scoop/blob/t-appveyor/appveyor.yml...</a></p>
<p>This might happen because AppVeyor Build Agent already
references Newtonsoft.Json 7.0.1 and maybe import-module finds this
assembly in current app domain and loads it from memory rather from
disk.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/388337332016-01-16T23:32:51Z2016-01-16T23:32:51ZTest failures on AppVeyor, not duplicated locally<div><p>Ta-da! The solution is running tests in a new PowerShell
process: <a href="https://github.com/FeodorFitsner/scoop/blob/t-appveyor/appveyor.yml#L13-L14">
https://github.com/FeodorFitsner/scoop/blob/t-appveyor/appveyor.yml...</a></p>
<p>Results: <a href="https://ci.appveyor.com/project/FeodorFitsner/scoop/build/27-t-appveyor#L13">
https://ci.appveyor.com/project/FeodorFitsner/scoop/build/27-t-appv...</a></p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/388337332016-01-19T21:10:14Z2016-01-19T21:10:14ZTest failures on AppVeyor, not duplicated locally<div><p>Thank you! I wouldn't have been able to track this down without
your help.</p>
<p>It did take me some time to refactor the testing script to
integrate the use of a powershell sub-shell for the actual testing.
But, I've got it working now (see <a href="https://ci.appveyor.com/project/rivy/scoop/build/577-t">https://ci.appveyor.com/project/rivy/scoop/build/577-t</a>).</p>
<p>Thanks again for your help.</p></div>roy.ivy.iiitag:help.appveyor.com,2012-11-13:Comment/388337332016-01-19T21:12:01Z2016-01-19T21:12:01ZTest failures on AppVeyor, not duplicated locally<div><p>Looks great, thanks for the update!</p></div>Feodor Fitsner