Skip to content

Commit 1227614

Browse files
RDILTravisEz13
authored andcommitted
Remove code from CI.psm1 to optionally run Feature tests (PowerShell#9212)
1 parent 539c4a2 commit 1227614

4 files changed

Lines changed: 16 additions & 54 deletions

File tree

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ Additional references:
244244
When updating your pull request, please **create new commits** and **don't rewrite the commits history**.
245245
This way it's very easy for the reviewers to see diff between iterations.
246246
If you rewrite the history in the pull request, review could be much slower.
247-
The PR is likely to be squashed on merge to master by the *assignee*.
247+
The PR is likely to be squash-merged to master by the *assignee*.
248248
1. *Reviewers* are anyone who wants to contribute.
249249
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.
250250
*Reviewers* should use the `Review changes` drop down to indicate they are done with their review.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,3 @@
2626
- [ ] N/A or can only be tested interactively
2727
- **OR**
2828
- [ ] [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)
29-
- [ ] [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)

docs/testing-guidelines/testing-guidelines.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,11 @@ The Pester framework allows `Describe` blocks to be tagged, and our CI system re
5555
One of the following tags must be used:
5656

5757
* `CI` - this tag indicates that the tests in the `Describe` block will be executed as part of the CI/PR process
58-
* `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.
59-
They indicate that the test will be validating more behavior, or will be using remote network resources (ex: package management tests)
6058
* `Scenario` - this tag indicates a larger scale test interacting with multiple areas of functionality and/or remote resources, these tests are also run daily.
59+
* `Feature` - tests with this tag will not be executed as part of the CI/PR process,
60+
but they will be executed on a daily basis as part of a `cron` driven build.
61+
They indicate that the test will be validating more behavior,
62+
or will be using remote network resources (ex: package management tests)
6163

6264
Additionally, the tag:
6365

tools/ci.psm1

Lines changed: 11 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -33,36 +33,7 @@ Function Test-DailyBuild
3333
{
3434
return $true
3535
}
36-
37-
# if [feature] is in the commit message,
38-
# Run Daily tests
39-
$commitMessage = Get-CommitMessage
40-
Write-log -message "commitMessage: $commitMessage"
41-
42-
if($commitMessage -match '\[feature\]' -or $env:FORCE_FEATURE -eq 'True')
43-
{
44-
Set-BuildVariable -Name PS_DAILY_BUILD -Value $trueString
45-
return $true
46-
}
47-
else
48-
{
49-
return $false
50-
}
51-
}
52-
53-
# Returns the commit message for the current build
54-
function Get-CommitMessage
55-
{
56-
if ($env:BUILD_SOURCEVERSIONMESSAGE -match 'Merge\s*([0-9A-F]*)')
57-
{
58-
# We are in VSTS and have a commit ID in the Source Version Message
59-
$commitId = $Matches[1]
60-
return &git log --format=%B -n 1 $commitId
61-
}
62-
else
63-
{
64-
Write-Log "Unknown BUILD_SOURCEVERSIONMESSAGE format '$env:BUILD_SOURCEVERSIONMESSAGE'" -Verbose
65-
}
36+
return $false
6637
}
6738

6839
# Sets a build variable
@@ -127,7 +98,6 @@ function Invoke-CIBuild
12798
}
12899

129100
Start-PSBuild -CrossGen -PSModuleRestore -Configuration 'Release' -CI -ReleaseTag $releaseTag
130-
131101
Save-PSOptions
132102

133103
$options = (Get-PSOptions)
@@ -165,7 +135,7 @@ function Invoke-CIInstall
165135
if ($env:TF_BUILD -and !$SkipUser.IsPresent)
166136
{
167137
# Generate new credential for CI (only) remoting tests.
168-
Write-Log -Message "Creating account for remoting tests in CI."
138+
Write-Verbose "Creating account for remoting tests in CI." -Verbose
169139

170140
# Password
171141
$randomObj = [System.Random]::new()
@@ -257,7 +227,7 @@ function Invoke-CITest
257227
$ExcludeTag = @('CI')
258228
}
259229
Default {
260-
throw "Unknow TagSet: '$TagSet'"
230+
throw "Unknown TagSet: '$TagSet'"
261231
}
262232
}
263233

@@ -530,17 +500,14 @@ function Invoke-CIFinish
530500
}
531501
}
532502

533-
if (Test-DailyBuild)
534-
{
535-
# produce win-arm and win-arm64 packages if it is a daily build
536-
Start-PSBuild -Restore -Runtime win-arm -PSModuleRestore -Configuration 'Release' -ReleaseTag $releaseTag
537-
$arm32Package = Start-PSPackage -Type zip -WindowsRuntime win-arm -ReleaseTag $releaseTag -SkipReleaseChecks
538-
$artifacts.Add($arm32Package)
539-
540-
Start-PSBuild -Restore -Runtime win-arm64 -PSModuleRestore -Configuration 'Release' -ReleaseTag $releaseTag
541-
$arm64Package = Start-PSPackage -Type zip -WindowsRuntime win-arm64 -ReleaseTag $releaseTag -SkipReleaseChecks
542-
$artifacts.Add($arm64Package)
543-
}
503+
# produce win-arm and win-arm64 packages if it is a daily build
504+
Start-PSBuild -Restore -Runtime win-arm -PSModuleRestore -Configuration 'Release' -ReleaseTag $releaseTag
505+
$arm32Package = Start-PSPackage -Type zip -WindowsRuntime win-arm -ReleaseTag $releaseTag -SkipReleaseChecks
506+
$artifacts.Add($arm32Package)
507+
508+
Start-PSBuild -Restore -Runtime win-arm64 -PSModuleRestore -Configuration 'Release' -ReleaseTag $releaseTag
509+
$arm64Package = Start-PSPackage -Type zip -WindowsRuntime win-arm64 -ReleaseTag $releaseTag -SkipReleaseChecks
510+
$artifacts.Add($arm64Package)
544511

545512
$pushedAllArtifacts = $true
546513
$artifacts | ForEach-Object {
@@ -610,12 +577,6 @@ function Invoke-LinuxTestsCore
610577
}
611578
# create packages if it is a full build
612579
$isFullBuild = Test-DailyBuild
613-
if (!$isFullBuild) {
614-
$noSudoPesterParam['ThrowOnFailure'] = $true
615-
}
616-
if ($hasRunFailingTestTag) {
617-
$noSudoPesterParam['IncludeFailingTest'] = $true
618-
}
619580

620581
# Get the experimental feature names and the tests associated with them
621582
$ExperimentalFeatureTests = Get-ExperimentalFeatureTests

0 commit comments

Comments
 (0)