Remove code from CI.psm1
to optionally run Feature tests (#9212)
This commit is contained in:
parent
539c4a26de
commit
12276147e6
2
.github/CONTRIBUTING.md
vendored
2
.github/CONTRIBUTING.md
vendored
@ -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.
|
||||
|
1
.github/PULL_REQUEST_TEMPLATE.md
vendored
1
.github/PULL_REQUEST_TEMPLATE.md
vendored
@ -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)
|
||||
|
@ -55,9 +55,11 @@ 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.
|
||||
* `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:
|
||||
|
||||
|
@ -33,36 +33,7 @@ Function Test-DailyBuild
|
||||
{
|
||||
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 $false
|
||||
}
|
||||
|
||||
# Sets a build variable
|
||||
@ -127,7 +98,6 @@ function Invoke-CIBuild
|
||||
}
|
||||
|
||||
Start-PSBuild -CrossGen -PSModuleRestore -Configuration 'Release' -CI -ReleaseTag $releaseTag
|
||||
|
||||
Save-PSOptions
|
||||
|
||||
$options = (Get-PSOptions)
|
||||
@ -165,7 +135,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()
|
||||
@ -257,7 +227,7 @@ function Invoke-CITest
|
||||
$ExcludeTag = @('CI')
|
||||
}
|
||||
Default {
|
||||
throw "Unknow TagSet: '$TagSet'"
|
||||
throw "Unknown TagSet: '$TagSet'"
|
||||
}
|
||||
}
|
||||
|
||||
@ -530,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)
|
||||
# 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)
|
||||
}
|
||||
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 {
|
||||
@ -610,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
|
||||
|
Loading…
Reference in New Issue
Block a user