-
Notifications
You must be signed in to change notification settings - Fork 226
Enhance performance of DSC resource integration tests #2143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
738a3a2
Enhance performance of DSC resource integration tests by adding early…
johlju 735ac11
Fix line endings for YAML files according to .gitattributes
johlju a38e1e3
Refactor .gitattributes to ensure consistent line endings for YAML, M…
johlju 9ce94f7
Add temporary hostname adjustment to avoid SSL certificate errors dur…
johlju 88e579e
Add temporary hostname adjustment to avoid SSL certificate generation…
johlju 9d34850
Add hostname restoration trap to avoid SSL certificate issues during …
johlju File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,73 +1,73 @@ | ||
| name: Code analysis (built module) | ||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| pull_request: | ||
| branches: [ main ] | ||
| workflow_dispatch: | ||
| # cSpell: ignore codeql SARIF | ||
| jobs: | ||
| pssa: | ||
| name: PSScriptAnalyzer | ||
| runs-on: windows-latest | ||
| permissions: | ||
| contents: read # for actions/checkout to fetch code | ||
| security-events: write # for github/codeql-action/upload-sarif to upload SARIF results | ||
| #actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v5 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Install GitVersion | ||
| shell: powershell | ||
| run: | | ||
| dotnet tool install --global GitVersion.Tool --version 5.* | ||
| dotnet-gitversion | ||
| - name: Run GitVersion | ||
| shell: powershell | ||
| run: | | ||
| dotnet-gitversion | ConvertFrom-Json | ||
| - name: Resolve dependencies | ||
| shell: powershell | ||
| run: | | ||
| Write-Information -MessageData 'Resolving dependencies.' -InformationAction 'Continue' | ||
| .\build.ps1 -ResolveDependency -Tasks 'noop' | ||
| - name: Build Module | ||
| shell: powershell | ||
| run: | | ||
| Write-Information -MessageData 'Module is being built.' -InformationAction 'Continue' | ||
| .\build.ps1 -Tasks 'build' | ||
| - name: Run PSScriptAnalyzer | ||
| shell: powershell | ||
| run: | | ||
| Write-Information -MessageData 'Prepare the test pipeline.' -InformationAction 'Continue' | ||
| .\build.ps1 -Tasks 'noop' | ||
| Write-Information -MessageData 'Load SMO stubs into session.' -InformationAction 'Continue' | ||
| Add-Type -Path './tests/Unit/Stubs/SMO.cs' | ||
| Write-Information -MessageData 'Import module ConvertToSARIF into the session.' -InformationAction 'Continue' | ||
| Import-Module -Name 'ConvertToSARIF' -Force | ||
| Write-Information -MessageData 'Import module PSScriptAnalyzer into the session.' -InformationAction 'Continue' | ||
| Import-Module -Name 'PSScriptAnalyzer' -Force | ||
| $filesToScan = Get-ChildItem -Path './output/builtModule/SqlServerDsc/**/SqlServerDsc.psm1' -File | ||
| Write-Information -MessageData ("Will scan the file:`t{0}." -f $filesToScan.FullName) -InformationAction 'Continue' | ||
| Write-Information -MessageData 'Running PSScriptAnalyzer on built module.' -InformationAction 'Continue' | ||
| $pssaError = $filesToScan | | ||
| Invoke-ScriptAnalyzer -Settings './.vscode/analyzersettings.psd1' | ||
| Write-Information -MessageData 'Converting PSScriptAnalyzer result to SARIF.' -InformationAction 'Continue' | ||
| $pssaError | | ||
| ConvertTo-SARIF -FilePath 'results.sarif' | ||
| Write-Information -MessageData 'Analyzing done.' -InformationAction 'Continue' | ||
| - name: Upload SARIF results | ||
| uses: github/codeql-action/upload-sarif@v3 | ||
| with: | ||
| sarif_file: results.sarif | ||
| name: Code analysis (built module) | ||
johlju marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| pull_request: | ||
| branches: [ main ] | ||
| workflow_dispatch: | ||
|
|
||
johlju marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| # cSpell: ignore codeql SARIF | ||
| jobs: | ||
| pssa: | ||
| name: PSScriptAnalyzer | ||
| runs-on: windows-latest | ||
| permissions: | ||
| contents: read # for actions/checkout to fetch code | ||
| security-events: write # for github/codeql-action/upload-sarif to upload SARIF results | ||
| #actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v5 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Install GitVersion | ||
| shell: powershell | ||
| run: | | ||
| dotnet tool install --global GitVersion.Tool --version 5.* | ||
| dotnet-gitversion | ||
| - name: Run GitVersion | ||
| shell: powershell | ||
| run: | | ||
| dotnet-gitversion | ConvertFrom-Json | ||
| - name: Resolve dependencies | ||
| shell: powershell | ||
| run: | | ||
| Write-Information -MessageData 'Resolving dependencies.' -InformationAction 'Continue' | ||
| .\build.ps1 -ResolveDependency -Tasks 'noop' | ||
| - name: Build Module | ||
| shell: powershell | ||
| run: | | ||
| Write-Information -MessageData 'Module is being built.' -InformationAction 'Continue' | ||
| .\build.ps1 -Tasks 'build' | ||
| - name: Run PSScriptAnalyzer | ||
| shell: powershell | ||
| run: | | ||
| Write-Information -MessageData 'Prepare the test pipeline.' -InformationAction 'Continue' | ||
| .\build.ps1 -Tasks 'noop' | ||
|
|
||
| Write-Information -MessageData 'Load SMO stubs into session.' -InformationAction 'Continue' | ||
| Add-Type -Path './tests/Unit/Stubs/SMO.cs' | ||
|
|
||
| Write-Information -MessageData 'Import module ConvertToSARIF into the session.' -InformationAction 'Continue' | ||
| Import-Module -Name 'ConvertToSARIF' -Force | ||
|
|
||
| Write-Information -MessageData 'Import module PSScriptAnalyzer into the session.' -InformationAction 'Continue' | ||
| Import-Module -Name 'PSScriptAnalyzer' -Force | ||
|
|
||
| $filesToScan = Get-ChildItem -Path './output/builtModule/SqlServerDsc/**/SqlServerDsc.psm1' -File | ||
| Write-Information -MessageData ("Will scan the file:`t{0}." -f $filesToScan.FullName) -InformationAction 'Continue' | ||
|
|
||
| Write-Information -MessageData 'Running PSScriptAnalyzer on built module.' -InformationAction 'Continue' | ||
| $pssaError = $filesToScan | | ||
| Invoke-ScriptAnalyzer -Settings './.vscode/analyzersettings.psd1' | ||
|
|
||
| Write-Information -MessageData 'Converting PSScriptAnalyzer result to SARIF.' -InformationAction 'Continue' | ||
| $pssaError | | ||
| ConvertTo-SARIF -FilePath 'results.sarif' | ||
|
|
||
| Write-Information -MessageData 'Analyzing done.' -InformationAction 'Continue' | ||
| - name: Upload SARIF results | ||
| uses: github/codeql-action/upload-sarif@v3 | ||
| with: | ||
| sarif_file: results.sarif | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,83 +1,83 @@ | ||
| name: Code analysis (source) | ||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| pull_request: | ||
| branches: [ main ] | ||
| workflow_dispatch: | ||
| # cSpell: ignore codeql SARIF | ||
| jobs: | ||
| pssa: | ||
| name: PSScriptAnalyzer | ||
| runs-on: windows-latest | ||
| permissions: | ||
| contents: read # for actions/checkout to fetch code | ||
| security-events: write # for github/codeql-action/upload-sarif to upload SARIF results | ||
| #actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v5 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Install GitVersion | ||
| shell: powershell | ||
| run: | | ||
| dotnet tool install --global GitVersion.Tool --version 5.* | ||
| dotnet-gitversion | ||
| - name: Run GitVersion | ||
| shell: powershell | ||
| run: | | ||
| dotnet-gitversion | ConvertFrom-Json | ||
| - name: Resolve dependencies | ||
| shell: powershell | ||
| run: | | ||
| Write-Information -MessageData 'Resolving dependencies.' -InformationAction 'Continue' | ||
| .\build.ps1 -ResolveDependency -Tasks 'noop' | ||
| - name: Build Module | ||
| shell: powershell | ||
| run: | | ||
| Write-Information -MessageData 'Module is being built.' -InformationAction 'Continue' | ||
| .\build.ps1 -Tasks 'build' | ||
| - name: Run PSScriptAnalyzer | ||
| shell: powershell | ||
| run: | | ||
| Write-Information -MessageData 'Prepare the test pipeline.' -InformationAction 'Continue' | ||
| .\build.ps1 -Tasks 'noop' | ||
| Write-Information -MessageData 'Load SMO stubs into session.' -InformationAction 'Continue' | ||
| Add-Type -Path './tests/Unit/Stubs/SMO.cs' | ||
| Write-Information -MessageData 'Import module ConvertToSARIF into the session.' -InformationAction 'Continue' | ||
| Import-Module -Name 'ConvertToSARIF' -Force | ||
| Write-Information -MessageData 'Import module PSScriptAnalyzer into the session.' -InformationAction 'Continue' | ||
| Import-Module -Name 'PSScriptAnalyzer' -Force | ||
| $filesToScan = Get-ChildItem -Path './source/' -Recurse -Include @('*.psm1', '*.ps1') -File | ||
| Write-Information -MessageData ("Will scan the files:`n`r`t{0}." -f ($filesToScan.FullName -join "`n`r`t")) -InformationAction 'Continue' | ||
| Write-Information -MessageData 'Running PSScriptAnalyzer.' -InformationAction 'Continue' | ||
| $pssaError = $filesToScan | | ||
| Invoke-ScriptAnalyzer -Settings './.vscode/analyzersettings.psd1' | ||
| $parseErrorTypes = @( | ||
| 'TypeNotFound' | ||
| 'RequiresModuleInvalid' | ||
| ) | ||
| Write-Information -MessageData ('Filter out reported parse errors that is unable to be resolved in source files: {0}' -f ($parseErrorTypes -join ', ')) -InformationAction 'Continue' | ||
| $pssaError = $pssaError | | ||
| Where-Object -FilterScript { | ||
| $_.RuleName -notin $parseErrorTypes | ||
| } | ||
| Write-Information -MessageData 'Converting PSScriptAnalyzer result to SARIF.' -InformationAction 'Continue' | ||
| $pssaError | | ||
| ConvertTo-SARIF -FilePath 'results.sarif' | ||
| Write-Information -MessageData 'Analyzing done.' -InformationAction 'Continue' | ||
| - name: Upload SARIF results | ||
| uses: github/codeql-action/upload-sarif@v3 | ||
| with: | ||
| sarif_file: results.sarif | ||
| name: Code analysis (source) | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| pull_request: | ||
| branches: [ main ] | ||
| workflow_dispatch: | ||
|
|
||
johlju marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| # cSpell: ignore codeql SARIF | ||
| jobs: | ||
| pssa: | ||
| name: PSScriptAnalyzer | ||
| runs-on: windows-latest | ||
| permissions: | ||
| contents: read # for actions/checkout to fetch code | ||
| security-events: write # for github/codeql-action/upload-sarif to upload SARIF results | ||
| #actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v5 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Install GitVersion | ||
| shell: powershell | ||
| run: | | ||
| dotnet tool install --global GitVersion.Tool --version 5.* | ||
| dotnet-gitversion | ||
| - name: Run GitVersion | ||
| shell: powershell | ||
| run: | | ||
| dotnet-gitversion | ConvertFrom-Json | ||
| - name: Resolve dependencies | ||
| shell: powershell | ||
| run: | | ||
| Write-Information -MessageData 'Resolving dependencies.' -InformationAction 'Continue' | ||
| .\build.ps1 -ResolveDependency -Tasks 'noop' | ||
| - name: Build Module | ||
| shell: powershell | ||
| run: | | ||
| Write-Information -MessageData 'Module is being built.' -InformationAction 'Continue' | ||
| .\build.ps1 -Tasks 'build' | ||
| - name: Run PSScriptAnalyzer | ||
| shell: powershell | ||
| run: | | ||
| Write-Information -MessageData 'Prepare the test pipeline.' -InformationAction 'Continue' | ||
| .\build.ps1 -Tasks 'noop' | ||
|
|
||
| Write-Information -MessageData 'Load SMO stubs into session.' -InformationAction 'Continue' | ||
| Add-Type -Path './tests/Unit/Stubs/SMO.cs' | ||
|
|
||
| Write-Information -MessageData 'Import module ConvertToSARIF into the session.' -InformationAction 'Continue' | ||
| Import-Module -Name 'ConvertToSARIF' -Force | ||
|
|
||
| Write-Information -MessageData 'Import module PSScriptAnalyzer into the session.' -InformationAction 'Continue' | ||
| Import-Module -Name 'PSScriptAnalyzer' -Force | ||
|
|
||
| $filesToScan = Get-ChildItem -Path './source/' -Recurse -Include @('*.psm1', '*.ps1') -File | ||
| Write-Information -MessageData ("Will scan the files:`n`r`t{0}." -f ($filesToScan.FullName -join "`n`r`t")) -InformationAction 'Continue' | ||
|
|
||
| Write-Information -MessageData 'Running PSScriptAnalyzer.' -InformationAction 'Continue' | ||
| $pssaError = $filesToScan | | ||
| Invoke-ScriptAnalyzer -Settings './.vscode/analyzersettings.psd1' | ||
|
|
||
| $parseErrorTypes = @( | ||
| 'TypeNotFound' | ||
| 'RequiresModuleInvalid' | ||
| ) | ||
| Write-Information -MessageData ('Filter out reported parse errors that is unable to be resolved in source files: {0}' -f ($parseErrorTypes -join ', ')) -InformationAction 'Continue' | ||
| $pssaError = $pssaError | | ||
| Where-Object -FilterScript { | ||
| $_.RuleName -notin $parseErrorTypes | ||
| } | ||
|
|
||
| Write-Information -MessageData 'Converting PSScriptAnalyzer result to SARIF.' -InformationAction 'Continue' | ||
| $pssaError | | ||
| ConvertTo-SARIF -FilePath 'results.sarif' | ||
|
|
||
| Write-Information -MessageData 'Analyzing done.' -InformationAction 'Continue' | ||
| - name: Upload SARIF results | ||
| uses: github/codeql-action/upload-sarif@v3 | ||
| with: | ||
| sarif_file: results.sarif | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.