Skip to content
This repository has been archived by the owner on Feb 24, 2021. It is now read-only.

Add AppVeyor Module #84

Closed
wants to merge 25 commits into from
Closed

Add AppVeyor Module #84

wants to merge 25 commits into from

Conversation

PlagueHO
Copy link
Contributor

@PlagueHO PlagueHO commented Jan 21, 2017

This PR adds the AppVeyor.psm1 module that contains the shared code that usually can be found in the AppVeyor.yml tasks.

@tysonjhayes , @johlju , @BrianFarnhill , @kwirkykat

It resolves the following issue: PowerShell/DscResources#205

This PR contains the following changes:

  • Updated common test output format
  • Added Install-NugetExe to TestHelper.psm1
  • Fixed up Readme.md to remove markdown violaions and resolve duplicate information.
  • Added AppVeyor.psm1 module

On it's own this change shouldn't affect any resource. Each resource will need to be updated to make use of it. I have tested and prepared changes in the following resource modules to ensure it works.

Note: xSQLServer and SharePointDsc seem to have one or two unit test failures at the moment that will prevent the changes going in. I'm not sure if the issues are related to modifying AppVeyor, but given there are such a small number (8 in SharePointDsc and 9 in xSQLServer) of them I think it would be unlikely.

To see the changes to the modules see this list:

For details on the module, please see the Module Help.


This change is Reviewable

@johlju
Copy link
Contributor

johlju commented Jan 21, 2017

@PlagueHO There should not be any tests failing in xSQLServer... 🤔

Latest merge to dev: https://ci.appveyor.com/project/PowerShell/xsqlserver/build/4.0.740.0
Latest push to my fork: https://ci.appveyor.com/project/johlju/xsqlserver/build/4.0.331.0

It could be that it cannot find the stub module? For xSQLServerScript.Tests.ps1 this row loads the stubs. Stubs contain the Invoke-SqlCmd.
https://github.com/PowerShell/xSQLServer/blob/dev/Tests/Unit/MSFT_xSQLServerScript.Tests.ps1#L31

Import-Module -Name (Join-Path -Path (Join-Path -Path (Join-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'Tests') -ChildPath 'Unit') -ChildPath 'Stubs') -ChildPath 'SQLPSStub.psm1') -Force

@PlagueHO
Copy link
Contributor Author

@johlju - ah! That is some awesome information. I went to sleep last night thinking that there must be something I'd missed as I couldn't see why any tests should suddenly fail. xStorage is the same (failing tests because a module isn't loaded). SharePointDsc is probably the same as well.

I'll sort it today! Thanks again for the info 😁

@PlagueHO
Copy link
Contributor Author

@johlju , @kwirkykat - Ok, I've found the cause of why the xSQLServer (and xStorage tests) fail when moved to this model:

Any modules being loaded by the tests need to be loaded into the -Global scope (by adding the global keyword). So the solution is pretty trivial but will need to be done if moving over to using an AppVeyor.psm1 module (in the resource repo or in this repo).

After making this change it indeed resolves this unit test issue: https://ci.appveyor.com/project/PlagueHO/xsqlserver

I haven't looked at SharePointDsc to see if it is the same problem. xStorage is definitely the same problem. So my PR for this repo will contain the fix for that when I move it over to use AppVeyor.psm1.

It looks like @tysonjhayes and @BrianFarnhill had already solved the problem in xNetworking and SharePointDsc respectively and addressed this when they moved over to using AppVeyor.psm1.

@PlagueHO
Copy link
Contributor Author

I'm going to close this PR temporarily, because as I think the automatic Wiki/Help generation code and the Markdown validation tests should also be included centrally. The AppVeyor.psm1 is dependent on these if you specify -Type Wiki but it still needs to find them in the resource repo - which is a bit silly (my bad).

So I'll copy this code in tonight and then reopen the PR once the code is included and tested.

@PlagueHO PlagueHO closed this Jan 22, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants