Skip to content

Commit

Permalink
[Internal] Added self-hosted runner in run system tests workflow (#479)
Browse files Browse the repository at this point in the history
* Feat: Added workflows & tox file

* Feat: Add run_unit_tests in CI.yml

* Fix: corrected file name

* Test: Install tox externally & run system tests

* Fix: Added timeout

* Test: Run python version individually

* Revert: bring back tox changes

* Fix: Remove no-extras in tox to ensure tests uses real drivers

* Fix: Change RUNNERNAME

* Fix: Deleted run_tests.yml

* Fix: Refractored tox.ini

* Fix: Added tox to dev dependencies

* Fix: Remove unnecessary file name additions

* Fix: Removed tox installation in run_system_tests.yml

* Fix: refractor run_unit_test.yml

* Fix: Removed ProgramW6432 in tox.ini

* Fix: review comments update

* Fix: poetry install with version 1.2.2

* Test: Let runner be more

* Revert: Changed last commit

* Test: Set ProgramW6432 variable

* Fix: Do poetry install for tox

* Test: Let runner be more

* Revert: Revert back previous commit

* Test: Without overriding  ProgramW6432 in tox

* Test: Override ProgramW6432 in tox

* Fix: Pass the environment varaiables to tox

* Fix: Removed unneccessary env passing in jobs

* GitHub workflow: Revert unnecessary change

* tox: Pass ProgramData env var

---------

Co-authored-by: Brad Keryan <brad.keryan@ni.com>
  • Loading branch information
MounikaBattu17 and bkeryan authored Oct 28, 2023
1 parent fd3af5a commit f658411
Show file tree
Hide file tree
Showing 6 changed files with 2,177 additions and 1,996 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,16 @@ jobs:
check_examples:
name: Check examples
uses: ./.github/workflows/check_examples.yml
run_tests:
name: Run tests
uses: ./.github/workflows/run_tests.yml
run_unit_tests:
name: Run unit tests
uses: ./.github/workflows/run_unit_tests.yml
needs: [check_nims, check_nimg]
run_system_tests:
name: Run system tests
uses: ./.github/workflows/run_system_tests.yml
needs: [run_unit_tests]
report_test_results:
name: Report test results
uses: ./.github/workflows/report_test_results.yml
needs: [run_tests]
needs: [run_unit_tests, run_system_tests]
if: always()
34 changes: 34 additions & 0 deletions .github/workflows/run_system_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Run system tests

on:
workflow_call:
workflow_dispatch:

jobs:
run_system_tests:
name: Run system tests
runs-on:
- self-hosted
- windows
- x64
- rdss-measlinkbot-win-10-${{ matrix.configuration }}
strategy:
matrix:
configuration: ["py32", "py64"]
# Fail-fast skews the pass/fail ratio and seems to make pytest produce
# incomplete JUnit XML results.
fail-fast: false
timeout-minutes: 90
steps:
- name: Check out repo
uses: actions/checkout@v3
- name: Install dependencies
run: poetry install
- name: Run system tests
run: poetry run tox
- name: Upload test results
uses: actions/upload-artifact@v3
with:
name: test_results
path: test_results/*.xml
if: always()
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run tests
name: Run unit tests

on:
workflow_call:
Expand All @@ -8,8 +8,8 @@ env:
POETRY_VERSION: 1.2.2

jobs:
run_tests:
name: Run tests
run_unit_tests:
name: Run unit tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand All @@ -36,12 +36,12 @@ jobs:
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
- name: Install ni-measurementlink-service (no extras)
run: poetry install -v
- name: Run tests and code coverage (ni-measurementlink-service, no extras)
run: poetry run pytest ./tests -v --cov=ni_measurementlink_service --junitxml=test_results/nims-${{ matrix.os }}-py${{ matrix.python-version}}-no-extras.xml
- name: Run unit tests and code coverage (ni-measurementlink-service, no extras)
run: poetry run pytest ./tests/unit -v --cov=ni_measurementlink_service --junitxml=test_results/nims-${{ matrix.os }}-py${{ matrix.python-version}}-no-extras.xml
- name: Install ni-measurementlink-service (all extras)
run: poetry install -v --all-extras
- name: Run tests and code coverage (ni-measurementlink-service, all extras)
run: poetry run pytest ./tests -v --cov=ni_measurementlink_service --junitxml=test_results/nims-${{ matrix.os }}-py${{ matrix.python-version}}-all-extras.xml
- name: Run unit tests and code coverage (ni-measurementlink-service, all extras)
run: poetry run pytest ./tests/unit -v --cov=ni_measurementlink_service --junitxml=test_results/nims-${{ matrix.os }}-py${{ matrix.python-version}}-all-extras.xml
- name: Install ni-measurementlink-generator
run: poetry install -v
working-directory: ./ni_measurementlink_generator
Expand Down
Loading

0 comments on commit f658411

Please sign in to comment.