Skip to content

Commit

Permalink
Add designated runner for perf jobs. (#2845)
Browse files Browse the repository at this point in the history
* test perf runner

* run perf test on PR push

* remove gh condition

* remove repo restriction

* add perf label in yml

* works, uncomment

* user perf label for all of bpf_performance tests

* restore event-triggered run behavior

---------

Co-authored-by: Igor Klemenski <[email protected]>
  • Loading branch information
rectified95 and Igor Klemenski authored Sep 15, 2023
1 parent 3003ad0 commit c1ef869
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,8 @@ jobs:
test_command: .\execute_ebpf_cicd_tests.ps1 -TestMode "Performance"
post_test: .\cleanup_ebpf_cicd_tests.ps1
build_artifact: Build-x64
environment: ebpf_cicd_tests
environment: ebpf_cicd_perf
configurations: '["Release"]'

performance_with_profile:
needs: regular
Expand All @@ -497,4 +498,5 @@ jobs:
test_command: .\execute_ebpf_cicd_tests.ps1 -TestMode "Performance" -Options @("CaptureProfile")
post_test: .\cleanup_ebpf_cicd_tests.ps1
build_artifact: Build-x64
environment: ebpf_cicd_tests
environment: ebpf_cicd_perf
configurations: '["Release"]'
18 changes: 9 additions & 9 deletions .github/workflows/reusable-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ jobs:

# Perform shallow checkout for self-hosted runner.
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac
if: (inputs.environment == 'ebpf_cicd_tests') && (steps.skip_check.outputs.should_skip != 'true')
if: (inputs.environment == 'ebpf_cicd_tests' || inputs.environment == 'ebpf_cicd_perf') && (steps.skip_check.outputs.should_skip != 'true')
with:
ref: ${{ github.event.workflow_run.head_branch }}

Expand All @@ -113,7 +113,7 @@ jobs:
- name: Set up OpenCppCoverage and add to PATH
id: set_up_opencppcoverage
if: (inputs.code_coverage == true) && (inputs.environment != 'ebpf_cicd_tests') && (steps.skip_check.outputs.should_skip != 'true')
if: (inputs.code_coverage == true) && (inputs.environment != 'ebpf_cicd_tests' && inputs.environment != 'ebpf_cicd_perf') && (steps.skip_check.outputs.should_skip != 'true')
run: |
choco install -y --requirechecksum=true --checksum=2295A733DA39412C61E4F478677519DD0BB1893D88313CE56B468C9E50517888 --checksum-type=sha256 OpenCppCoverage
echo "C:\Program Files\OpenCppCoverage" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
Expand All @@ -130,7 +130,7 @@ jobs:
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps" -Name "DumpFolder" -Value "$dump_path" -PropertyType ExpandString -ErrorAction SilentlyContinue
- name: Remove existing artifacts
if: (inputs.environment == 'ebpf_cicd_tests') && (steps.skip_check.outputs.should_skip != 'true')
if: (inputs.environment == 'ebpf_cicd_tests' || inputs.environment == 'ebpf_cicd_perf') && (steps.skip_check.outputs.should_skip != 'true')
run: |
Remove-Item -Path ${{github.workspace}}\${{env.BUILD_PLATFORM}}\${{env.BUILD_CONFIGURATION}} -Recurse -Force -ErrorAction SilentlyContinue
Expand Down Expand Up @@ -171,14 +171,14 @@ jobs:
.\export_program_info.exe
- name: Run pre test command
if: steps.skip_check.outputs.should_skip != 'true' && (inputs.environment != 'ebpf_cicd_tests')
if: steps.skip_check.outputs.should_skip != 'true' && (inputs.environment != 'ebpf_cicd_tests' && inputs.environment != 'ebpf_cicd_perf')
id: run_pre_test_command
working-directory: ./${{env.BUILD_PLATFORM}}/${{env.BUILD_CONFIGURATION}}
run: |
${{env.PRE_COMMAND}}
- name: Run pre test command on self-hosted runner
if: steps.skip_check.outputs.should_skip != 'true' && (inputs.environment == 'ebpf_cicd_tests')
if: steps.skip_check.outputs.should_skip != 'true' && (inputs.environment == 'ebpf_cicd_tests' || inputs.environment == 'ebpf_cicd_perf')
id: run_pre_test_command_self_hosted
working-directory: ./${{env.BUILD_PLATFORM}}/${{env.BUILD_CONFIGURATION}}
run: |
Expand Down Expand Up @@ -220,14 +220,14 @@ jobs:
OpenCppCoverage.exe -q --sources %CD% --excluded_sources %CD%\external\Catch2 --export_type cobertura:ebpf_for_windows.xml --working_dir ${{env.BUILD_PLATFORM}}\${{env.BUILD_CONFIGURATION}} -- powershell .\Run-Test.ps1 ${{env.DUMP_PATH}} ${{env.TEST_TIMEOUT}} ${{env.TEST_COMMAND}}
- name: Run test on self-hosted runner
if: (inputs.code_coverage == false) && (steps.skip_check.outputs.should_skip != 'true') && (inputs.environment == 'ebpf_cicd_tests') && (inputs.fault_injection != true)
if: (inputs.code_coverage == false) && (steps.skip_check.outputs.should_skip != 'true') && (inputs.environment == 'ebpf_cicd_tests' || inputs.environment == 'ebpf_cicd_perf') && (inputs.fault_injection != true)
id: run_test_self_hosted
working-directory: ./${{env.BUILD_PLATFORM}}/${{env.BUILD_CONFIGURATION}}
run: |
${{env.TEST_COMMAND}} -LogFileName ${{ runner.name }}.log -SelfHostedRunnerName ${{ runner.name }}
- name: Run test without Code Coverage
if: (inputs.code_coverage == false) && (steps.skip_check.outputs.should_skip != 'true') && (inputs.environment != 'ebpf_cicd_tests') && (inputs.fault_injection != true)
if: (inputs.code_coverage == false) && (steps.skip_check.outputs.should_skip != 'true') && (inputs.environment != 'ebpf_cicd_tests' && inputs.environment != 'ebpf_cicd_perf') && (inputs.fault_injection != true)
id: run_test_without_code_coverage
working-directory: ./${{env.BUILD_PLATFORM}}/${{env.BUILD_CONFIGURATION}}
shell: cmd
Expand All @@ -237,15 +237,15 @@ jobs:
- name: Run post test command
# Run the post test command even if the workflow has failed.
if: (success() || failure()) && (steps.skip_check.outputs.should_skip != 'true') && (inputs.environment != 'ebpf_cicd_tests')
if: (success() || failure()) && (steps.skip_check.outputs.should_skip != 'true') && (inputs.environment != 'ebpf_cicd_tests' && inputs.environment != 'ebpf_cicd_perf')
id: run_post_test_command
working-directory: ./${{env.BUILD_PLATFORM}}/${{env.BUILD_CONFIGURATION}}
run: |
${{env.POST_COMMAND}}
- name: Run post test command on self-hosted runner
# Run the post test command even if the workflow has failed.
if: (success() || failure()) && (steps.skip_check.outputs.should_skip != 'true') && (inputs.environment == 'ebpf_cicd_tests')
if: (success() || failure()) && (steps.skip_check.outputs.should_skip != 'true') && (inputs.environment == 'ebpf_cicd_tests' || inputs.environment == 'ebpf_cicd_perf')
id: run_post_test_command_self_hosted
working-directory: ./${{env.BUILD_PLATFORM}}/${{env.BUILD_CONFIGURATION}}
run: |
Expand Down
6 changes: 6 additions & 0 deletions scripts/test_execution.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@
{
"Name": "vm2"
}
],
"TK5-3WP07R0703_1":
[
{
"Name": "vm_perf"
}
]
},

Expand Down

0 comments on commit c1ef869

Please sign in to comment.