diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 55785face..cacdd6b8c 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -26,4 +26,4 @@ jobs: contains(github.event.pull_request.body, '[x] ')) && (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 \ No newline at end of file diff --git a/.github/workflows/run_g_tests.yml b/.github/workflows/run_g_tests.yml index ff7a0611c..3a71fd003 100644 --- a/.github/workflows/run_g_tests.yml +++ b/.github/workflows/run_g_tests.yml @@ -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"] + 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 }} \ No newline at end of file diff --git a/.github/workflows/run_pr_commenter.yml b/.github/workflows/run_pr_commenter.yml index d1dcd8687..2be028883 100644 --- a/.github/workflows/run_pr_commenter.yml +++ b/.github/workflows/run_pr_commenter.yml @@ -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 @@ -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}} \ No newline at end of file diff --git a/.github/workflows/run_vi_analyzer.yml b/.github/workflows/run_vi_analyzer.yml index ee383e6c6..2fb68accc 100644 --- a/.github/workflows/run_vi_analyzer.yml +++ b/.github/workflows/run_vi_analyzer.yml @@ -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 @@ -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 diff --git a/Source/Tests/run_tests.vi b/Source/Tests/run_tests.vi index 6ce6d183a..acde965ab 100644 Binary files a/Source/Tests/run_tests.vi and b/Source/Tests/run_tests.vi differ diff --git a/Source/Tests/run_tests_original.vi b/Source/Tests/run_tests_original.vi new file mode 100644 index 000000000..6ce6d183a Binary files /dev/null and b/Source/Tests/run_tests_original.vi differ diff --git a/Source/Tests/skip_tests.lst b/Source/Tests/skip_tests.lst index 5124df292..45c7743bb 100644 --- a/Source/Tests/skip_tests.lst +++ b/Source/Tests/skip_tests.lst @@ -1 +1,6 @@ -test_DefaultTemplateMeasurement_GetUiDetails_CorrectUiPathUrl.vi \ No newline at end of file +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 \ No newline at end of file diff --git a/Source/Tools/run_diff.py b/Source/Tools/run_diff.py index 2bdba27f0..262cf36fe 100644 --- a/Source/Tools/run_diff.py +++ b/Source/Tools/run_diff.py @@ -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"]) diff --git a/Source/Tools/run_vi_analyzer.py b/Source/Tools/run_vi_analyzer.py index d4e373abf..cd43bc955 100644 --- a/Source/Tools/run_vi_analyzer.py +++ b/Source/Tools/run_vi_analyzer.py @@ -1,3 +1,4 @@ +import argparse import logging import os import subprocess @@ -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() @@ -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()