diff --git a/docs/testing-guidelines/testing-guidelines.md b/docs/testing-guidelines/testing-guidelines.md index 4197f324f9..b5178a3415 100755 --- a/docs/testing-guidelines/testing-guidelines.md +++ b/docs/testing-guidelines/testing-guidelines.md @@ -76,6 +76,15 @@ Additionally, the tag: * `SLOW` indicates that the test takes a somewhat longer time to execute (97% of our `CI` tests take 100ms or less), a test which takes longer than 1 second should be considered as a candidate for being tagged `Slow` +#### Requesting additional tests for a PR + +In our CI systems, we normally run only run tests tagged with `CI`. If in the first line of the last (most recent) commit description you add `[Feature]`, +we will ensure that we will also run the tests tagged with `Feature`. When you would want to do this: + +- You have added or changed a `Feature` test. +- A maintainer asks you to run the `Feature` tests. +- Based on experience, you are confident that a maintainer will ask you to run the `Feature` tests. + ### xUnit For those tests which are not easily run via Pester, we have decided to use [xUnit](https://xunit.github.io/) as the test framework. diff --git a/tools/appveyor.psm1 b/tools/appveyor.psm1 index 86387c3f48..9bb167bf47 100644 --- a/tools/appveyor.psm1 +++ b/tools/appveyor.psm1 @@ -91,6 +91,13 @@ Function Test-DailyBuild { return $true } + + # if [Feature] is in the commit message, + # Run Daily tests + if($env:APPVEYOR_REPO_COMMIT_MESSAGE -match '\[feature\]') + { + return $true + } return $false } @@ -180,11 +187,14 @@ function Invoke-AppVeyorInstall { if(Test-DailyBuild){ $buildName = "[Daily]" - if($env:APPVEYOR_PULL_REQUEST_TITLE) + + # Add daily to title if it's not already there + # It can be there already for rerun requests + if($env:APPVEYOR_PULL_REQUEST_TITLE -and $env:APPVEYOR_PULL_REQUEST_TITLE -notmatch '^\[Daily\]') { $buildName += $env:APPVEYOR_PULL_REQUEST_TITLE } - else + elseif($env:APPVEYOR_REPO_COMMIT_MESSAGE -notmatch '^\[Daily\].*$' ) { $buildName += $env:APPVEYOR_REPO_COMMIT_MESSAGE } diff --git a/tools/travis.ps1 b/tools/travis.ps1 index 0e4e57eee4..dd44a99415 100644 --- a/tools/travis.ps1 +++ b/tools/travis.ps1 @@ -96,7 +96,9 @@ function Set-DailyBuildBadge # TRAVIS_EVENT_TYPE: Indicates how the build was triggered. # One of push, pull_request, api, cron. $isPR = $env:TRAVIS_EVENT_TYPE -eq 'pull_request' -$isFullBuild = $env:TRAVIS_EVENT_TYPE -eq 'cron' -or $env:TRAVIS_EVENT_TYPE -eq 'api' + +# Run a full build if the build was trigger via cron, api or the commit message contains `[Feature]` +$isFullBuild = $env:TRAVIS_EVENT_TYPE -eq 'cron' -or $env:TRAVIS_EVENT_TYPE -eq 'api' -or $env:TRAVIS_COMMIT_MESSAGE -match '\[feature\]' if($Bootstrap.IsPresent) {