mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Add ability to run feature tests for pr (#4277)
This commit is contained in:
committed by
Dongbo Wang
parent
d6265c303b
commit
9571f8f2f4
@@ -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.
|
||||
|
||||
+12
-2
@@ -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
|
||||
}
|
||||
|
||||
+3
-1
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user