Skip to content
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

Replaced spawningpool with measlinkbot self-hosted runner #456

Closed
wants to merge 66 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
c870d3e
Feat: Added measlinkbot runner
MounikaBattu17 Dec 13, 2023
474105b
Fix: Spacing
MounikaBattu17 Dec 13, 2023
12732a1
Test: Enable git long paths
MounikaBattu17 Dec 13, 2023
b04cf93
Test: Syntax change
MounikaBattu17 Dec 13, 2023
a4081f1
Test: Run generate port number job in bash
MounikaBattu17 Dec 13, 2023
df5f981
Merge branch 'main' into users/mounika/setup-measlinkbot-runner
MounikaBattu17 Dec 14, 2023
4b4afa3
Fix: Adapt to powershell syntax
MounikaBattu17 Dec 14, 2023
57f308e
Empty-Commit~
MounikaBattu17 Dec 14, 2023
7f02dff
Fix: Remove enable git long paths step
MounikaBattu17 Dec 14, 2023
64578df
Test: Revert back previous commit
MounikaBattu17 Dec 15, 2023
eecf14d
Merge branch 'main' into users/mounika/setup-measlinkbot-runner
MounikaBattu17 Dec 15, 2023
0df6044
Feat: Make measlinkbot as runner for all workflows
MounikaBattu17 Dec 15, 2023
0adb4a3
Test commit
MounikaBattu17 Dec 15, 2023
4a98214
Fix: unicodeescape error
MounikaBattu17 Dec 15, 2023
51ae986
Fix: Enable long paths in git
MounikaBattu17 Dec 15, 2023
4a261dc
Test: Close LV after usage
MounikaBattu17 Dec 15, 2023
823457a
Test: Do not run for LV 2023
MounikaBattu17 Dec 15, 2023
9e798ca
Fix: Remove LV 2020 from VI analyzer workflow
MounikaBattu17 Dec 15, 2023
191421f
Merge branch 'main' into users/mounika/setup-measlinkbot-runner
MounikaBattu17 Dec 18, 2023
c312e90
Fix: Only support LV 2023 for VI analyzer
MounikaBattu17 Dec 18, 2023
bb88b99
Fix: Remove hardcoded LV path in run_diff.py
MounikaBattu17 Jan 17, 2024
a3ba065
Merge branch 'main' into users/mounika/setup-measlinkbot-runner
MounikaBattu17 Jan 17, 2024
924db51
Fix; Remove fail-fast
MounikaBattu17 Jan 17, 2024
09a1c69
Test-Commit
MounikaBattu17 Mar 18, 2024
ec89cc7
Merge branch 'main' into users/mounika/setup-measlinkbot-runner
MounikaBattu17 Mar 28, 2024
5148cfa
Fix: Use include for setting port number
MounikaBattu17 Mar 28, 2024
23f7dd0
Test: Hardcode default LabVIEW path
MounikaBattu17 Apr 2, 2024
5b5495d
Test: Remove invalid enclosing quotes
MounikaBattu17 Apr 4, 2024
50558fd
Test: Fix unicodeespace error
MounikaBattu17 Apr 4, 2024
8f595ca
Test: Change python version
MounikaBattu17 Apr 16, 2024
3899c8c
Test: run tests sequentially
MounikaBattu17 Apr 16, 2024
a730a09
Test: Run only Generator tests
MounikaBattu17 Apr 16, 2024
df2181a
Test: Run only Runtime Discovery tests
MounikaBattu17 Apr 16, 2024
39e4a08
Test: Run runtime Pinmap & SessionManagement tests
MounikaBattu17 Apr 16, 2024
ec394ef
Test: Run only Measurement Server tests 1
MounikaBattu17 Apr 17, 2024
20f4f25
Test: Run Driver tests excluding VISA
MounikaBattu17 Apr 17, 2024
7d49a59
Test: Run VISA tests alone
MounikaBattu17 Apr 17, 2024
7b9468e
Test: Run Runtime Measurement Server & Reserve Sessions tests
MounikaBattu17 Apr 17, 2024
447bb67
Test: Run Runtime Session Management tests
MounikaBattu17 Apr 17, 2024
3b3924c
Test: Run only Runtime tests
MounikaBattu17 Apr 17, 2024
361f6da
Test: Repeat previous commit
MounikaBattu17 Apr 17, 2024
b31243e
Test: Run tests exclude Session Management, VISA tests
MounikaBattu17 Apr 17, 2024
63564c0
Test: Run tests exclude Session Management, VISA, Measurement Plugin …
MounikaBattu17 Apr 17, 2024
295ab43
Test: Run only Runtime MeasurementServer tests
MounikaBattu17 Apr 17, 2024
5b1d5de
Test: Run tests Runtime Measurement Server method2
MounikaBattu17 Apr 17, 2024
54e8a64
Test: path error fix on previous commit
MounikaBattu17 Apr 17, 2024
e604901
Test: Exclude Generator tests from previous commit
MounikaBattu17 Apr 18, 2024
6acfb41
Test: Inlcude PinMap, Session Management tests from previous commit
MounikaBattu17 Apr 18, 2024
3a3252e
Test: Using LabVIEWCLI directly
MounikaBattu17 Apr 18, 2024
67541c4
Test: fix path error in previous commit
MounikaBattu17 Apr 18, 2024
89a9754
Test: Fix error in previous commit
MounikaBattu17 Apr 18, 2024
8961ebb
Test: Close Labview after running tests
MounikaBattu17 Apr 18, 2024
572dbc1
Test: Exclude folders
MounikaBattu17 Apr 18, 2024
b12e294
Test: Don't close LabVIEW
MounikaBattu17 Apr 18, 2024
bf168b0
Test: Run only Generator tests
MounikaBattu17 Apr 18, 2024
9eea415
Test: Run only/all Runtime tests
MounikaBattu17 Apr 18, 2024
c5c03ea
Test: Run test run only Discovery Client test
MounikaBattu17 Apr 18, 2024
3db4d79
Test: Exclude only Discovery Client test
MounikaBattu17 Apr 18, 2024
24f6c33
Test: Revert back test commits
MounikaBattu17 Apr 18, 2024
af90d66
Test: Exclude Generator tests
MounikaBattu17 Apr 18, 2024
2825ee4
Test: Remove issue folders
MounikaBattu17 Apr 23, 2024
0a40637
Test: Add few more tests to skip tests list
MounikaBattu17 Apr 23, 2024
d453acc
Test: Skip only the issue test
MounikaBattu17 Apr 23, 2024
5bd72fc
Test: Add back skip tests
MounikaBattu17 Apr 23, 2024
2a9bb81
Test: Skip few tests
MounikaBattu17 Apr 23, 2024
9d98dc2
Test: Skip few tests
MounikaBattu17 Apr 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ jobs:
contains(github.event.pull_request.body, '[x] <!--G_DIFF_CHECK-->')) &&
(github.repository == 'ni/measurementlink-labview' ||
github.event.pull_request.head.repo.full_name == 'ni/measurementlink-labview') }}
uses: ./.github/workflows/run_pr_commenter.yml
uses: ./.github/workflows/run_pr_commenter.yml
40 changes: 29 additions & 11 deletions .github/workflows/run_g_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,33 @@ on:

jobs:
run_g_tests:
name: Run G Tests
runs-on: self-hosted
name: Run G Tests LV${{ matrix.version }}
runs-on:
- self-hosted
- windows
- x64
- rdss-measlinkbot-win-10-lv64
strategy:
matrix:
version: ["2020", "2021", "2022", "2023"]
MounikaBattu17 marked this conversation as resolved.
Show resolved Hide resolved
include:
- version: 2020
port: "3363"
- version: 2021
port: "3364"
- version: 2022
port: "3365"
- version: 2023
port: "3366"
timeout-minutes: 90
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Run G Tests
run:
python ${{runner.workspace}}/measurementlink-labview/Source/Tests/run_tests.py
- name: Enable git long paths
run: git config --global core.longpaths true
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.9'

- name: Run G Tests
run:
python ${{runner.workspace}}/measurementlink-labview/Source/Tests/run_tests.py --labview-path "C:\Program Files\National Instruments\LabVIEW ${{ matrix.version }}\LabVIEW.exe" --port-number ${{ matrix.port }}
12 changes: 10 additions & 2 deletions .github/workflows/run_pr_commenter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,16 @@ on:
jobs:
run_pr_commenter:
name: Run PR Commenter
runs-on: self-hosted
runs-on:
- self-hosted
- windows
- x64
- rdss-measlinkbot-win-10-lv64
timeout-minutes: 90
steps:
- name: Enable git long paths
run: git config --global core.longpaths true

- uses: actions/checkout@v4

- uses: actions/checkout@v4
Expand All @@ -24,4 +32,4 @@ jobs:
- name: Run G Diff
id: run-diff
run: |
python ${{runner.workspace}}/measurementlink-labview/Source/Tools/run_diff.py --token ${{secrets.GITHUB_TOKEN}} --pull-req ${{github.event.pull_request.number}} --commit-id ${{github.event.pull_request.head.sha}}
python ${{runner.workspace}}/measurementlink-labview/Source/Tools/run_diff.py --token ${{secrets.GITHUB_TOKEN}} --pull-req ${{github.event.pull_request.number}} --commit-id ${{github.event.pull_request.head.sha}}
12 changes: 10 additions & 2 deletions .github/workflows/run_vi_analyzer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,16 @@ on:
jobs:
run_vi_analyzer:
name: Run VI Analyzer
runs-on: self-hosted
runs-on:
- self-hosted
- windows
- x64
- rdss-measlinkbot-win-10-lv64
timeout-minutes: 90
steps:
- name: Enable git long paths
run: git config --global core.longpaths true

- uses: actions/checkout@v4

- uses: actions/setup-python@v5
Expand All @@ -17,4 +25,4 @@ jobs:

- name: Run VI Analyzer
run:
python ${{runner.workspace}}/measurementlink-labview/Source/Tools/run_vi_analyzer.py
python ${{runner.workspace}}/measurementlink-labview/Source/Tools/run_vi_analyzer.py --labview-path "C:\Program Files\National Instruments\LabVIEW 2023\LabVIEW.exe" --port-number 3366
Binary file modified Source/Tests/run_tests.vi

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Diff Image Data for Source/Tests/run_tests.vi as follows

No images produced. This is indicative of no functional changes, e.g. resaved, mass-compiled, or cosmetic changes only.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Diff Image Data for Source/Tests/run_tests.vi as follows

No images produced. This is indicative of no functional changes, e.g. resaved, mass-compiled, or cosmetic changes only.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Diff Image Data for Source/Tests/run_tests.vi as follows

No images produced. This is indicative of no functional changes, e.g. resaved, mass-compiled, or cosmetic changes only.

Binary file not shown.
Binary file added Source/Tests/run_tests_original.vi
Binary file not shown.
7 changes: 6 additions & 1 deletion Source/Tests/skip_tests.lst
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
test_DefaultTemplateMeasurement_GetUiDetails_CorrectUiPathUrl.vi
test_DefaultTemplateMeasurement_GetUiDetails_CorrectUiPathUrl.vi
test_NoServicesRegistered_InvalidRegisterRequests_Error.vi
test_SingleServiceRegistered_DiscoveryApiRoundTrip_AllNodesSucceed.vi
test_SingleServiceRegistered_InvalidResolveRequests_Error.vi
test_DCPowerInstrument_InitializeSessionsWithUnregisteredSessionsReserved_RemoteSessionsInitialized.vi
test_SessionManagerWrapper_StopSessionManagementService_WrapperMethodsWorkWithoutError.vi
2 changes: 1 addition & 1 deletion Source/Tools/run_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def run_full_diff(pr_number, token, commit_id):
diff_vi = os.path.join(tools_directory , "run_diff.vi")
_logger.debug(f"Launching {diff_vi}.")

kwargs = ["LabVIEWCLI", "-OperationName", "RunVI", "-VIPath", os.path.normpath(diff_vi)]
kwargs = ["LabVIEWCLI", "-OperationName", "RunVI", "-VIPath", os.path.normpath(diff_vi), "-LabVIEWPath", "C:\\Program Files\\National Instruments\\LabVIEW 2023\\LabVIEW.exe", "-PortNumber", "3366"]
kwargs.extend(["--added_labview_files"])
kwargs.extend(added_labview_files)
kwargs.extend(["--modified_labview_files"])
Expand Down
19 changes: 16 additions & 3 deletions Source/Tools/run_vi_analyzer.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import argparse
import logging
import os
import subprocess
Expand All @@ -12,16 +13,19 @@
_logger.addHandler(handler)

def main():
return_code = run_all_tests()
labview_path, port_number = _parse_command_line_args()
return_code = run_all_tests(labview_path, port_number)
sys.exit(return_code)


def run_all_tests():
def run_all_tests(labview_path, port_number):
tools_directory = os.path.abspath(os.path.dirname(__file__))
vi_analyzer_config_path = os.path.join(tools_directory, "PR.viancfg")
_logger.debug(f"Analyzing VIs per {vi_analyzer_config_path}.")
vi_analyzer_output_path = tempfile.TemporaryFile().name
kwargs = ["LabVIEWCLI", "-OperationName", "RunVIAnalyzer", "-ConfigPath", vi_analyzer_config_path, "-ReportPath", vi_analyzer_output_path]
kwargs = ["LabVIEWCLI", "-OperationName", "RunVIAnalyzer", "-ConfigPath", vi_analyzer_config_path, "-ReportPath", vi_analyzer_output_path, "-PortNumber", str(port_number)]
if labview_path:
kwargs.extend(["-LabVIEWPath", labview_path])
test_result = subprocess.run(kwargs, capture_output= True)

formatted_stdout = test_result.stdout.decode().replace('\r\n','\n').strip()
Expand All @@ -35,4 +39,13 @@ def run_all_tests():
return test_result.returncode


def _parse_command_line_args():
parser = argparse.ArgumentParser(description="Run VI Analyzer using LabVIEWCLI")
parser.add_argument("--labview-path", type=str, help="Path to the LabVIEW executable", nargs='?', default=None)
parser.add_argument("--port-number", type=int, help="TCP/IP port number of LabVIEW executable", nargs='?', default=3363)

args = parser.parse_args()
return args.labview_path, args.port_number


main()