You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 24, 2021. It is now read-only.
For some reason the class Microsoft.DscResourceKit.IntegrationTest cannot be loaded when dot-sourcing the configuration files. This did work when the PR was tested. But those tests that worked before, does no longer work either. This is really strange 🤔
Maybe it was just luck that it worked before, or if I did a mistake in the testing. I don't know. Either way it is broken. :)
Something strange has happened, because it can no longer see the sealed class. It seems that making this a public class it starts to find it. But then it reports it does not have a constructor with zero arguments. But we are passing in one argument.
PS > . .\MSFT_xSQLServerSetup.config.ps1
Cannot find an overload for ".ctor" and the argument count: "0".
At V:\Source\xSqlServer\Tests\Integration\MSFT_xSQLServerSetup.config.ps1:2 char:1
+ [Microsoft.DscResourceKit.IntegrationTest(OrderNumber = 1)]
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodException
+ FullyQualifiedErrorId : MethodCountCouldNotFindBest
Adding a constructor with zero arguments gives this error
PS > . .\MSFT_xSQLServerSetup.config.ps1
'OrderNumber' is a ReadOnly property.
At V:\Source\xSqlServer\Tests\Integration\MSFT_xSQLServerSetup.config.ps1:2 char:1
+ [Microsoft.DscResourceKit.IntegrationTest(OrderNumber = 1)]
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : PropertyIsReadOnly
Finally adding a new named property, instead of using a positional seems to work.
namespace Microsoft.DscResourceKit
{
// See the attribute guidelines at http://go.microsoft.com/fwlink/?LinkId=85236
[System.AttributeUsage(System.AttributeTargets.All, Inherited = false, AllowMultiple = true)]
public sealed class IntegrationTest : System.Attribute
{
public IntegrationTest() {}
public int OrderNumber { get; set; }
}
}
I really need for this to work, so I will refactor the class to this, if it passes the tests, I will send in a PR to change to this.
The text was updated successfully, but these errors were encountered:
johlju
added a commit
to johlju/DscResource.Tests
that referenced
this issue
Sep 1, 2017
For some reason the class Microsoft.DscResourceKit.IntegrationTest cannot be loaded when dot-sourcing the configuration files. This did work when the PR was tested. But those tests that worked before, does no longer work either. This is really strange 🤔
Maybe it was just luck that it worked before, or if I did a mistake in the testing. I don't know. Either way it is broken. :)
The error:
https://ci.appveyor.com/project/johlju/xsqlserver/build/6.0.927.0#L5627
Something strange has happened, because it can no longer see the sealed class. It seems that making this a public class it starts to find it. But then it reports it does not have a constructor with zero arguments. But we are passing in one argument.
Adding a constructor with zero arguments gives this error
Finally adding a new named property, instead of using a positional seems to work.
I really need for this to work, so I will refactor the class to this, if it passes the tests, I will send in a PR to change to this.
The text was updated successfully, but these errors were encountered: