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

RTA: xWebApplication Integration tests & fixes #136

Merged
merged 13 commits into from
Jun 11, 2016
Merged

RTA: xWebApplication Integration tests & fixes #136

merged 13 commits into from
Jun 11, 2016

Conversation

nzspambot
Copy link

@nzspambot nzspambot commented May 23, 2016

Hi, added some basic xWebApplication integration tests as well as some fixes to xWebApplication


This change is Reviewable

@msftclas
Copy link

Hi @nzspambot, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!
You've already signed the contribution license agreement. Thanks!

The agreement was validated by Microsoft and real humans are currently evaluating your PR.

TTYL, MSBOT;

@nzspambot
Copy link
Author

nzspambot commented May 23, 2016

appveyor failed due to this btw

Exception calling "UploadFile" with "2" argument(s): "The remote server returned an error: (500) Internal Server Error."
At line:3 char:97
+ ... /ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Res ...
+                                              ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : WebException

Command executed with exception: Exception calling "UploadFile" with "2" argument(s): "The remote server returned an error: (500) Internal Server Error."

@PlagueHO
Copy link
Member

I'll give this a review tomorrow night unless someone else gets to it first. I'll also take a look at the AppVeyor issue.

@nzspambot
Copy link
Author

nzspambot commented May 25, 2016

@PlagueHO I'm assuming you're referring to the Integration git errors? Appveyor is working ok now

@nzspambot
Copy link
Author

I think appveyor has hung on this latest build

@nzspambot
Copy link
Author

@PlagueHO do you have access to rerun a appveyor build?

@tysonjhayes
Copy link

Unfortunately neither @PlagueHO or I have rights to rerun it. Easiest way is to add a line break somewhere and checkin which kicks off another build (terrible I know) or page @KarolKaczmarek or @TravisEz13 and ask nicely. 😁

@nzspambot
Copy link
Author

All good; pushed some style changes so see if this builds now 🏁

James Baker added 3 commits May 27, 2016 08:56
@PlagueHO
Copy link
Member

Reviewed 4 of 5 files at r1, 2 of 3 files at r3, 2 of 2 files at r5.
Review status: all files reviewed at latest revision, 4 unresolved discussions.


README.md, line 192 [r5] (raw file):

* Adding conditional logic to install the test helper module from the gallery if the user downloaded the module from the gallery.
* Added **xWebApplication** integration tests
* Added fixes to **xWebApplication**

Can we mention what the fixes to xWebApplication were? New SSL Flags added etc


DSCResources/MSFT_xWebApplication/MSFT_xWebApplication.schema.mof, line 0 [r5] (raw file):
There appears to be a problem with the MSFT_xSSLSettings.schema.mof
Both Reviewable and GitHub are reporting this file is a binary file (so the content is not being shown for review). Can you check it please? Might need to recreate it or check the char encoding etc.


Tests/Integration/MSFT_xWebApplication.Integration.Tests.ps1, line 4 [r5] (raw file):

$Global:DSCResourceName = 'MSFT_xWebApplication'

#region HEADER

Could you update the header here or add the version number?

Nice work on all of this - especially the integration tests too. Nice to see such complete coverage, I think everyone should be trying to achieve this level (including myself)! 😄


Tests/Integration/MSFT_xWebAppPoolDefaults.Integration.Tests.ps1, line 4 [r5] (raw file):

$Global:DSCResourceName    = 'MSFT_xWebAppPoolDefaults'

# Integration Test Template Version: 1.1.0

Can you add the #region HEADER above this line (just so the #Region collapse still works).


Comments from Reviewable

@nzspambot
Copy link
Author

Review status: all files reviewed at latest revision, 4 unresolved discussions.


README.md, line 192 [r5] (raw file):

Previously, PlagueHO (Daniel Scott-Raynsford) wrote…

Can we mention what the fixes to xWebApplication were? New SSL Flags added etc

Done.

Tests/Integration/MSFT_xWebApplication.Integration.Tests.ps1, line 4 [r5] (raw file):

Previously, PlagueHO (Daniel Scott-Raynsford) wrote…

Could you update the header here or add the version number?

Nice work on all of this - especially the integration tests too. Nice to see such complete coverage, I think everyone should be trying to achieve this level (including myself)! 😄

Done.

Tests/Integration/MSFT_xWebAppPoolDefaults.Integration.Tests.ps1, line 4 [r5] (raw file):

Previously, PlagueHO (Daniel Scott-Raynsford) wrote…

Can you add the #region HEADER above this line (just so the #Region collapse still works).

Done.

Comments from Reviewable

@nzspambot
Copy link
Author

@PlagueHO ok updated 👍

@nzspambot
Copy link
Author

nzspambot commented May 28, 2016

hmm appveyor failed yet again

Exception calling "UploadFile" with "2" argument(s): "The remote server returned an error: (500) Internal Server Error."
At line:3 char:97
+ ... /ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Res ...
+                                              ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : WebException

Command executed with exception: Exception calling "UploadFile" with "2" argument(s): "The remote server returned an error: (500) Internal Server Error."

I reckon this could be wrapped in a try/catch/while loop

e: appveyor/ci#826 :tumbleweeds:

@PlagueHO
Copy link
Member

That is actually a pretty good idea. If we do this perhaps we do it to the template one and advise it to be changed for all AppVeyor.yml (I've run into the same thing in lots of other projects). Perhaps we could use xWebAdministration as the test project for this change - @tysonjhayes?

Anyway, @tysonjhayes, this :LGTM: so ready for merge.

Previously, nzspambot (James Baker) wrote…

hmm appveyor failed yet again


Exception calling "UploadFile" with "2" argument(s): "The remote server returned an error: (500) Internal Server Error."

At line:3 char:97

+ ... /ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Res ...

+                                              ~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException

    + FullyQualifiedErrorId : WebException



Command executed with exception: Exception calling "UploadFile" with "2" argument(s): "The remote server returned an error: (500) Internal Server Error."

I reckon this could be wrapped in a try/catch/while loop

e: appveyor/ci#826 :tumbleweeds:


Reviewed 3 of 3 files at r6.
Review status: all files reviewed at latest revision, 2 unresolved discussions, some commit checks failed.


README.md, line 192 [r5] (raw file):

Previously, nzspambot (James Baker) wrote…

Done.

Thanks sir!

Comments from Reviewable

@PlagueHO
Copy link
Member

Review status: 7 of 8 files reviewed at latest revision, 2 unresolved discussions, some commit checks failed.


DSCResources/MSFT_xWebApplication/MSFT_xWebApplication.schema.mof, line [r5] (raw file):

Previously, PlagueHO (Daniel Scott-Raynsford) wrote…

There appears to be a problem with the MSFT_xSSLSettings.schema.mof
Both Reviewable and GitHub are reporting this file is a binary file (so the content is not being shown for review). Can you check it please? Might need to recreate it or check the char encoding etc.

Actually, I still missed this issue. Did you manage to figure out what is wrong with this MOF File?

Comments from Reviewable

@nzspambot
Copy link
Author

Yep it was UTF16 👎 fixed and build is running now

OOI (before I dig around) is there a check in the Test resource to check for this?

Could be a nice addition to flag things like this; I know it checks for ascii

@PlagueHO
Copy link
Member

There is supposed to be:

https://github.com/PowerShell/DscResource.Tests/blob/dev/Meta.Tests.ps1#L99
https://github.com/PowerShell/DscResource.Tests/blob/dev/MetaFixers.psm1#L67

I wonder if these tests could be updated to fail the file?

@nzspambot
Copy link
Author

nzspambot commented May 28, 2016

Yeah I'd say fail is better IMO; warning can get lost

e: actually it will fail : $unicodeFilesCount | Should Be 0

interesting I might test that out a bit further then

@PlagueHO
Copy link
Member

It should fail - but for some reason in this case it didn't. Needs to be fixed I reckon!

@TravisEz13
Copy link
Contributor

Review status: 7 of 8 files reviewed at latest revision, 3 unresolved discussions.


DSCResources/MSFT_xWebApplication/MSFT_xWebApplication.psm1, line 217 [r6] (raw file):

              Set-ItemProperty -Path "IIS:\Sites\$Website\$Name" `
                               -Name serviceAutoStartEnabled `
                               -Value $serviceAutoStartEnabled `

We should not be replacing spaces with tabs.
see Style guidelines -general, point 1


Comments from Reviewable

@nzspambot
Copy link
Author

Do we really have to go through a Tab vs Spaces argument?

@tysonjhayes
Copy link

@nzspambot as annoying as it is I've actually seen bugs with commands auto completing and ruining intended functionallity when a script has tabs in it, vs I do not see this with spaces. So the intent is not to spark a ververant debate but to actually correct for unintentded bugs (imo).

@nzspambot
Copy link
Author

nzspambot commented May 31, 2016

@tysonjhayes understood; as long as there is a valid reason I'm 👍

e: Especially after the latest episode of Silicon Valley ;) ;)

@PlagueHO
Copy link
Member

PlagueHO commented Jun 1, 2016

I've run into issues with Tabs and PowerShell as well (especially with back ticks).

As I was reading these reviews I was watching the most recent episode of Silicon Valley - with the Spaces vs. Tabs conflict - made me LOL. If you haven't watched it (or watch this show), I highly recommend it.

@TravisEz13
Copy link
Contributor

Reviewed 1 of 1 files at r7.
Review status: 7 of 8 files reviewed at latest revision, 3 unresolved discussions.


Comments from Reviewable

@nzspambot
Copy link
Author

Review status: 7 of 8 files reviewed at latest revision, 3 unresolved discussions.


DSCResources/MSFT_xWebApplication/MSFT_xWebApplication.psm1, line 217 [r6] (raw file):

Previously, TravisEz13 (Travis Plunk) wrote…

We should not be replacing spaces with tabs.
see Style guidelines -general, point 1

Done.

Comments from Reviewable

@PlagueHO
Copy link
Member

PlagueHO commented Jun 9, 2016

Reviewed 1 of 1 files at r8.
Review status: all files reviewed at latest revision, 3 unresolved discussions.


Comments from Reviewable

@nzspambot
Copy link
Author

I removed the tabs as requested

Previously, PlagueHO (Daniel Scott-Raynsford) wrote…

I've run into issues with Tabs and PowerShell as well (especially with back ticks).

As I was reading these reviews I was watching the most recent episode of Silicon Valley - with the Spaces vs. Tabs conflict - made me LOL. If you haven't watched it (or watch this show), I highly recommend it.


Review status: all files reviewed at latest revision, 3 unresolved discussions.


Comments from Reviewable

@nzspambot
Copy link
Author

Review status: all files reviewed at latest revision, 3 unresolved discussions.


README.md, line 192 [r5] (raw file):

Previously, PlagueHO (Daniel Scott-Raynsford) wrote…

Thanks sir!

np

Comments from Reviewable

@tysonjhayes
Copy link

Review status: all files reviewed at latest revision, 5 unresolved discussions.


Tests/Integration/MSFT_xWebApplication.Integration.Tests.ps1, line 28 [r8] (raw file):

    . $ConfigFile

    $null = Backup-WebConfiguration -Name $tempName

We should move this above loading the config file (basically the firs tthing we do) as it can present some errors in restoring/removing the backup if the config file ever gets horked.


Tests/Integration/MSFT_xWebApplication.Integration.Tests.ps1, line 57 [r8] (raw file):

    # Create a new website for the WebApplication

    New-Website -Name $DSCConfig.AllNodes.Website `

Does it make sense to do this with a params hashtable? Might look a bit cleaner.


Comments from Reviewable

@nzspambot
Copy link
Author

Review status: all files reviewed at latest revision, 5 unresolved discussions.


DSCResources/MSFT_xWebApplication/MSFT_xWebApplication.schema.mof, line [r5] (raw file):

Previously, PlagueHO (Daniel Scott-Raynsford) wrote…

Actually, I still missed this issue. Did you manage to figure out what is wrong with this MOF File?

This should be fixed

Tests/Integration/MSFT_xWebApplication.Integration.Tests.ps1, line 28 [r8] (raw file):

Previously, tysonjhayes (Tyson J. Hayes) wrote…

We should move this above loading the config file (basically the firs tthing we do) as it can present some errors in restoring/removing the backup if the config file ever gets horked.

Done.

Tests/Integration/MSFT_xWebApplication.Integration.Tests.ps1, line 57 [r8] (raw file):

Previously, tysonjhayes (Tyson J. Hayes) wrote…

Does it make sense to do this with a params hashtable? Might look a bit cleaner.

It's only ever called once so I think no

Comments from Reviewable

@tysonjhayes
Copy link

Reviewed 1 of 1 files at r9.
Review status: all files reviewed at latest revision, 3 unresolved discussions, some commit checks failed.


Comments from Reviewable

@PlagueHO
Copy link
Member

:lgtm:

Previously, nzspambot (James Baker) wrote…

I removed the tabs as requested


Review status: all files reviewed at latest revision, 2 unresolved discussions, some commit checks failed.


Comments from Reviewable

@PlagueHO
Copy link
Member

Oh wait - looks like there is still a merge conflict to resolve. 😦

Previously, PlagueHO (Daniel Scott-Raynsford) wrote…

:lgtm:


Review status: all files reviewed at latest revision, 2 unresolved discussions, some commit checks failed.


Comments from Reviewable

@PlagueHO
Copy link
Member

Reviewed 1 of 1 files at r7, 1 of 1 files at r9.
Review status: all files reviewed at latest revision, 2 unresolved discussions, some commit checks failed.


Comments from Reviewable

@tysonjhayes tysonjhayes merged commit 4bd8bc2 into dsccommunity:dev Jun 11, 2016
@nzspambot nzspambot deleted the IntegrationTests-xWebApplication branch June 23, 2016 09:02
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.

None yet

5 participants