Skip to content

Commit

Permalink
Merge branch 'oneof-support' of https://github.com/pratheekshasn/grpc…
Browse files Browse the repository at this point in the history
…-labview into oneof-support
  • Loading branch information
CPattar-NI committed Aug 7, 2023
2 parents b70782b + e1c6180 commit 8fd16b4
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 5 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/build_release_artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,42 @@ jobs:
- name: Run CI Tests
run: python ${{runner.workspace}}\grpc-labview\tests\run_tests.py

- name: Get current time
uses: josStorer/get-current-time@v2
id: current-time
with:
format: YYYY-MM-DD_hh-mm-ss
utcOffset: "+05:30"

- name: Run New Testing Suite's Tests
run: python ${{runner.workspace}}\grpc-labview\tests\New_ATS\pylib\run_tests.py

- name: Check whether logs folder exists in New_ATS
id: check_files
uses: andstor/[email protected]
with:
files: "${{runner.workspace}}/grpc-labview/tests/New_ATS/logs/*.xml"

- if: ${{always() && steps.check_files.outputs.files_exists == 'true' }}
name: Download New_ATS Test Results if logs folder exists
uses: actions/upload-artifact@v3
with:
name: New_ATS Test Results ${{ steps.current-time.outputs.formattedTime }}
path: ${{runner.workspace}}/grpc-labview/tests/New_ATS/logs

- if: ${{always() && steps.check_files.outputs.files_exists == 'true' }}
name: Show New_ATS Test Results
run: |
$directory = "${{runner.workspace}}/grpc-labview/tests/New_ATS/logs"
Get-ChildItem -Path $directory | ForEach-Object {
if ($_.PSIsContainer -eq $false) {
Write-Host "Contents of $($_.Name):"
Get-Content $_.FullName
Write-Host ""
}
}
- if: startsWith(github.ref, 'refs/tags/v')
name: Create Draft Release
id: create_release
Expand Down
Binary file not shown.
3 changes: 2 additions & 1 deletion tests/New_ATS/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ venv
*.lvproj
*.lvlps
Generated_server
Generated_client
Generated_client
logs
4 changes: 3 additions & 1 deletion tests/New_ATS/RunPythonClient.bat
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
@echo off
set python_client_path=%1
set test_name=%2
pushd %~dp0
set script_dir=%CD%
popd

echo Running Python Client
call %script_dir%\venv\Scripts\python.exe -m pytest %python_client_path% -vv
if not exist "./logs" mkdir logs
call %script_dir%\venv\Scripts\python.exe -m pytest %python_client_path% --junitxml=%script_dir%/logs/%test_name%_test_results.xml -vv
10 changes: 7 additions & 3 deletions tests/New_ATS/pylib/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ def generate_server(test_config):
f"-VIPath {main_wrapper_vi_path}",
f"{test_config['proto_path']}",
f"{test_config['project_path']}",
f"{test_config['gen_type']}"])
f"{test_config['gen_type']}"
])
run_command(CLI_command)


Expand Down Expand Up @@ -81,7 +82,8 @@ def run_test(test_config):
f'-LabVIEWPath "{test_config["labview_path"]}"',
'-OperationName RunVI',
f"-VIPath {runservice_wrapper_vi_path}",
f"{test_config['test_folder']}"])
f"{test_config['test_folder']}"
])

# TODO Check whether labviewCLI is installed or not before running the command
run_command(CLI_command)
Expand All @@ -107,7 +109,9 @@ def run_test(test_config):
client_py_path = test_config['test_folder'] / str(test_config['test_name'] + '_client.py')
run_client_command = ' '.join([
str(test_config['test_suite_folder'] / 'RunPythonClient.bat'),
str(client_py_path)])
str(client_py_path),
test_config['test_name']
])
output = run_command(run_client_command)
print(output)
FAILED += count_failed_testcases(output)
Expand Down

0 comments on commit 8fd16b4

Please sign in to comment.