From fbb0e545004b67ec2afb8cc3f086f868b45a16f0 Mon Sep 17 00:00:00 2001 From: Reece Dunham Date: Sat, 23 Mar 2019 14:18:16 -0400 Subject: [PATCH 01/12] (WIP) remove feature tests --- tools/ci.psm1 | 38 ++------------------------------------ 1 file changed, 2 insertions(+), 36 deletions(-) diff --git a/tools/ci.psm1 b/tools/ci.psm1 index f235b670d71..5b3c3a2a66e 100644 --- a/tools/ci.psm1 +++ b/tools/ci.psm1 @@ -28,41 +28,7 @@ if($PSVersionTable.PSEdition -eq 'Desktop' -or $isWindows) # or is a pushed tag Function Test-DailyBuild { - $trueString = 'True' - if(($env:PS_DAILY_BUILD -eq $trueString) -or $env:BUILD_REASON -eq 'Schedule') - { - return $true - } - - # if [feature] is in the commit message, - # Run Daily tests - $commitMessage = Get-CommitMessage - Write-log -message "commitMessage: $commitMessage" - - if($commitMessage -match '\[feature\]' -or $env:FORCE_FEATURE -eq 'True') - { - Set-BuildVariable -Name PS_DAILY_BUILD -Value $trueString - return $true - } - else - { - return $false - } -} - -# Returns the commit message for the current build -function Get-CommitMessage -{ - if ($env:BUILD_SOURCEVERSIONMESSAGE -match 'Merge\s*([0-9A-F]*)') - { - # We are in VSTS and have a commit ID in the Source Version Message - $commitId = $Matches[1] - return &git log --format=%B -n 1 $commitId - } - else - { - Write-Log "Unknown BUILD_SOURCEVERSIONMESSAGE format '$env:BUILD_SOURCEVERSIONMESSAGE'" -Verbose - } + return $true } # Sets a build variable @@ -257,7 +223,7 @@ function Invoke-CITest $ExcludeTag = @('CI') } Default { - throw "Unknow TagSet: '$TagSet'" + throw "Unknown TagSet: '$TagSet'" } } From b4a5bb851d71ee7eb007a14559850f7f29b0572f Mon Sep 17 00:00:00 2001 From: Reece Dunham Date: Sat, 23 Mar 2019 14:23:29 -0400 Subject: [PATCH 02/12] Update CONTRIBUTING.md --- .github/CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 40411b3b027..2df4d7618e0 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -79,7 +79,7 @@ To run the link-checker, follow these steps: ### Code Editor -You should use the multi-platform [Visual Studio Code (VS Code)][use-vscode-editor]. +You should use the multi-platform [Visual Studio Code (VSCode)][use-vscode-editor]. ### Building and testing @@ -244,7 +244,7 @@ Additional references: When updating your pull request, please **create new commits** and **don't rewrite the commits history**. This way it's very easy for the reviewers to see diff between iterations. If you rewrite the history in the pull request, review could be much slower. - The PR is likely to be squashed on merge to master by the *assignee*. + The PR is likely to be squash-merged to master by the *assignee*. 1. *Reviewers* are anyone who wants to contribute. They are responsible for ensuring the code: addresses the issue being fixed, does not create new issues (functional, performance, reliability, or security), and implements proper design. *Reviewers* should use the `Review changes` drop down to indicate they are done with their review. From 042dcf46eb82815c3287adc0935faacf9f78ed99 Mon Sep 17 00:00:00 2001 From: Reece Dunham Date: Sat, 23 Mar 2019 14:27:16 -0400 Subject: [PATCH 03/12] Update testing-guidelines.md --- docs/testing-guidelines/testing-guidelines.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/testing-guidelines/testing-guidelines.md b/docs/testing-guidelines/testing-guidelines.md index 75c3de63d78..778bf5ea935 100755 --- a/docs/testing-guidelines/testing-guidelines.md +++ b/docs/testing-guidelines/testing-guidelines.md @@ -55,8 +55,6 @@ The Pester framework allows `Describe` blocks to be tagged, and our CI system re One of the following tags must be used: * `CI` - this tag indicates that the tests in the `Describe` block will be executed as part of the CI/PR process -* `Feature` - tests with this tag will not be executed as part of the CI/PR process, but they will be executed on a daily basis as part of a `cron` driven build. - They indicate that the test will be validating more behavior, or will be using remote network resources (ex: package management tests) * `Scenario` - this tag indicates a larger scale test interacting with multiple areas of functionality and/or remote resources, these tests are also run daily. Additionally, the tag: From cd9dde3513b94fbb853c706934be24c5646b6cac Mon Sep 17 00:00:00 2001 From: Reece Dunham Date: Sat, 23 Mar 2019 14:28:19 -0400 Subject: [PATCH 04/12] Update PULL_REQUEST_TEMPLATE.md --- .github/PULL_REQUEST_TEMPLATE.md | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 5e6a9aa6694..454957f75fd 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -26,4 +26,3 @@ - [ ] N/A or can only be tested interactively - **OR** - [ ] [Make sure you've added a new test if existing tests do not effectively test the code changed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#before-submitting) - - [ ] [Add `[feature]` to your commit messages if the change is significant or affects feature tests](https://github.com/PowerShell/PowerShell/blob/master/docs/testing-guidelines/testing-guidelines.md#requesting-additional-tests-for-a-pr) From 6c9e5d93cd1e1b63736d4da68f0d99177b2dc027 Mon Sep 17 00:00:00 2001 From: Reece Dunham Date: Sun, 24 Mar 2019 14:16:05 -0400 Subject: [PATCH 05/12] Revert `VS Code` => `VSCode` change --- .github/CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 2df4d7618e0..20a7a7c3335 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -79,7 +79,7 @@ To run the link-checker, follow these steps: ### Code Editor -You should use the multi-platform [Visual Studio Code (VSCode)][use-vscode-editor]. +You should use the multi-platform [Visual Studio Code (VS Code)][use-vscode-editor]. ### Building and testing From e20a8d9dc5b436ed6a616f0b19b81b3bef605137 Mon Sep 17 00:00:00 2001 From: Reece Dunham Date: Sun, 24 Mar 2019 14:17:38 -0400 Subject: [PATCH 06/12] cleanup --- tools/ci.psm1 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/ci.psm1 b/tools/ci.psm1 index 5b3c3a2a66e..59d2cd0333e 100644 --- a/tools/ci.psm1 +++ b/tools/ci.psm1 @@ -93,7 +93,6 @@ function Invoke-CIBuild } Start-PSBuild -CrossGen -PSModuleRestore -Configuration 'Release' -CI -ReleaseTag $releaseTag - Save-PSOptions $options = (Get-PSOptions) @@ -131,7 +130,7 @@ function Invoke-CIInstall if ($env:TF_BUILD -and !$SkipUser.IsPresent) { # Generate new credential for CI (only) remoting tests. - Write-Log -Message "Creating account for remoting tests in CI." + Write-Verbose "Creating account for remoting tests in CI." -Verbose # Password $randomObj = [System.Random]::new() From c83d35d7255665f1cd215fe4ffcfa8265a11ad92 Mon Sep 17 00:00:00 2001 From: Reece Dunham Date: Tue, 26 Mar 2019 10:55:08 -0400 Subject: [PATCH 07/12] Run daily build if conditions are met --- tools/ci.psm1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/ci.psm1 b/tools/ci.psm1 index 59d2cd0333e..34bde22bbe4 100644 --- a/tools/ci.psm1 +++ b/tools/ci.psm1 @@ -28,7 +28,8 @@ if($PSVersionTable.PSEdition -eq 'Desktop' -or $isWindows) # or is a pushed tag Function Test-DailyBuild { - return $true + $trueString = 'True' + return (($env:PS_DAILY_BUILD -eq $trueString) -or $env:BUILD_REASON -eq 'Schedule') == $true } # Sets a build variable From baf4a5f39a75ca6800296519b593e762ddfc661c Mon Sep 17 00:00:00 2001 From: Reece Dunham Date: Tue, 26 Mar 2019 10:57:37 -0400 Subject: [PATCH 08/12] Update logic :( --- tools/ci.psm1 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/ci.psm1 b/tools/ci.psm1 index 34bde22bbe4..5db2bbc2ffb 100644 --- a/tools/ci.psm1 +++ b/tools/ci.psm1 @@ -29,7 +29,11 @@ if($PSVersionTable.PSEdition -eq 'Desktop' -or $isWindows) Function Test-DailyBuild { $trueString = 'True' - return (($env:PS_DAILY_BUILD -eq $trueString) -or $env:BUILD_REASON -eq 'Schedule') == $true + if(($env:PS_DAILY_BUILD -eq $trueString) -or $env:BUILD_REASON -eq 'Schedule') + { + return $true + } + return $false } # Sets a build variable From dc2db000c0f0661c812aeca18ffca8c193c97741 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Tue, 26 Mar 2019 08:07:20 -0700 Subject: [PATCH 09/12] always produce windows arm packages --- tools/ci.psm1 | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/tools/ci.psm1 b/tools/ci.psm1 index 5db2bbc2ffb..2ee2785a825 100644 --- a/tools/ci.psm1 +++ b/tools/ci.psm1 @@ -500,17 +500,14 @@ function Invoke-CIFinish } } - if (Test-DailyBuild) - { - # produce win-arm and win-arm64 packages if it is a daily build - Start-PSBuild -Restore -Runtime win-arm -PSModuleRestore -Configuration 'Release' -ReleaseTag $releaseTag - $arm32Package = Start-PSPackage -Type zip -WindowsRuntime win-arm -ReleaseTag $releaseTag -SkipReleaseChecks - $artifacts.Add($arm32Package) - - Start-PSBuild -Restore -Runtime win-arm64 -PSModuleRestore -Configuration 'Release' -ReleaseTag $releaseTag - $arm64Package = Start-PSPackage -Type zip -WindowsRuntime win-arm64 -ReleaseTag $releaseTag -SkipReleaseChecks - $artifacts.Add($arm64Package) - } + # produce win-arm and win-arm64 packages if it is a daily build + Start-PSBuild -Restore -Runtime win-arm -PSModuleRestore -Configuration 'Release' -ReleaseTag $releaseTag + $arm32Package = Start-PSPackage -Type zip -WindowsRuntime win-arm -ReleaseTag $releaseTag -SkipReleaseChecks + $artifacts.Add($arm32Package) + + Start-PSBuild -Restore -Runtime win-arm64 -PSModuleRestore -Configuration 'Release' -ReleaseTag $releaseTag + $arm64Package = Start-PSPackage -Type zip -WindowsRuntime win-arm64 -ReleaseTag $releaseTag -SkipReleaseChecks + $artifacts.Add($arm64Package) $pushedAllArtifacts = $true $artifacts | ForEach-Object { From b6698d27449b51c0a4a66e9ff0b6a1df699063a3 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Tue, 26 Mar 2019 08:11:34 -0700 Subject: [PATCH 10/12] always throw on failure --- tools/ci.psm1 | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tools/ci.psm1 b/tools/ci.psm1 index 2ee2785a825..aab5d14f6e3 100644 --- a/tools/ci.psm1 +++ b/tools/ci.psm1 @@ -577,12 +577,6 @@ function Invoke-LinuxTestsCore } # create packages if it is a full build $isFullBuild = Test-DailyBuild - if (!$isFullBuild) { - $noSudoPesterParam['ThrowOnFailure'] = $true - } - if ($hasRunFailingTestTag) { - $noSudoPesterParam['IncludeFailingTest'] = $true - } # Get the experimental feature names and the tests associated with them $ExperimentalFeatureTests = Get-ExperimentalFeatureTests From 555efce3e7ad23027c850c9c1ad2b09d3220cfe2 Mon Sep 17 00:00:00 2001 From: Reece Dunham Date: Tue, 26 Mar 2019 16:59:25 -0400 Subject: [PATCH 11/12] Address feedback --- docs/testing-guidelines/testing-guidelines.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/testing-guidelines/testing-guidelines.md b/docs/testing-guidelines/testing-guidelines.md index 778bf5ea935..46f235299d2 100755 --- a/docs/testing-guidelines/testing-guidelines.md +++ b/docs/testing-guidelines/testing-guidelines.md @@ -56,6 +56,7 @@ One of the following tags must be used: * `CI` - this tag indicates that the tests in the `Describe` block will be executed as part of the CI/PR process * `Scenario` - this tag indicates a larger scale test interacting with multiple areas of functionality and/or remote resources, these tests are also run daily. +* `Feature` - tests with this tag will not be executed as part of the CI/PR process, but they will be executed on a daily basis as part of a `cron` driven build. Additionally, the tag: From cc0f626bf604fb2c9b8eb4071b24c6f28aeefb5c Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 27 Mar 2019 09:49:35 -0700 Subject: [PATCH 12/12] Update testing-guidelines.md --- docs/testing-guidelines/testing-guidelines.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/testing-guidelines/testing-guidelines.md b/docs/testing-guidelines/testing-guidelines.md index 46f235299d2..b7b952f1a1a 100755 --- a/docs/testing-guidelines/testing-guidelines.md +++ b/docs/testing-guidelines/testing-guidelines.md @@ -56,7 +56,10 @@ One of the following tags must be used: * `CI` - this tag indicates that the tests in the `Describe` block will be executed as part of the CI/PR process * `Scenario` - this tag indicates a larger scale test interacting with multiple areas of functionality and/or remote resources, these tests are also run daily. -* `Feature` - tests with this tag will not be executed as part of the CI/PR process, but they will be executed on a daily basis as part of a `cron` driven build. +* `Feature` - tests with this tag will not be executed as part of the CI/PR process, + but they will be executed on a daily basis as part of a `cron` driven build. + They indicate that the test will be validating more behavior, + or will be using remote network resources (ex: package management tests) Additionally, the tag: