aboutsummaryrefslogtreecommitdiffstats
path: root/.ci/templates/job-uhd-hardware-tests.yml
blob: c0c51288b0204ab28bf93772c55282ac3e2d835b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
parameters:
- name: dutMatrix
  type: object
- name: runDevTest
  type: boolean
  default: true
- name: runPyTest
  type: boolean
  default: true

jobs:
- job: build_uhd_run_hardware_test
  displayName: Build uhd and run hardware test
  strategy:
    matrix: ${{ parameters.dutMatrix }}

  pool:
    name: 'de-dre-lab'
    demands: uhd_ats -equals $(pipelineAgent)

  steps:
  - checkout: ettus-rts
    clean: true

  - checkout: self
    clean: true

  - template: steps-build-uhd-make.yml
    parameters:
      uhdSrcDir: $(Build.SourcesDirectory)/uhddev
      uhdBuildDir: $(Build.BinariesDirectory)/uhddev/build

  - script: |
      mkdir -p $(Common.TestResultsDirectory)/devtest
      cd $(Common.TestResultsDirectory)/devtest
      python3 $(Build.SourcesDirectory)/uhddev/host/tests/devtest/run_testsuite.py \
        --src-dir $(Build.SourcesDirectory)/uhddev/host/tests/devtest \
        --devtest-pattern $(devtestPattern) --args addr=$(devAddr),type=$(devType) \
        --build-type Release --build-dir $(Build.BinariesDirectory)/uhddev/build \
        --python-interp python3 --xml
    continueOnError: true
    condition: and(succeeded(), eq('${{ parameters.runDevTest }}', true), eq(variables['deviceEnabled'], 'true'), eq(variables['devBus'], 'ip'))
    displayName: Run devtest for IP

  - script: |
      mkdir -p $(Common.TestResultsDirectory)/devtest
      cd $(Common.TestResultsDirectory)/devtest
      python3 $(Build.SourcesDirectory)/uhddev/host/tests/devtest/run_testsuite.py \
        --src-dir $(Build.SourcesDirectory)/uhddev/host/tests/devtest \
        --devtest-pattern $(devtestPattern) --args serial=$(devSerial),type=$(devType) \
        --build-type Release --build-dir $(Build.BinariesDirectory)/uhddev/build \
        --python-interp python3 --xml
    continueOnError: true
    condition: and(succeeded(), eq('${{ parameters.runDevTest }}', true), eq(variables['deviceEnabled'], 'true'), ne(variables['devBus'], 'ip'))
    displayName: Run devtest for PCIe / USB

  - script: |
      mkdir -p $(Common.TestResultsDirectory)/pytest
      cd $(Build.SourcesDirectory)/ettus-rts/config/remote/python_tests

      export PATH=$(Build.BinariesDirectory)/uhddev/build/utils:$(Build.BinariesDirectory)/uhddev/build/examples:$PATH
      export LD_LIBRARY_PATH=$(Build.BinariesDirectory)/uhddev/build/lib:$LD_LIBRARY_PATH
      export PYTHONPATH=$(Build.BinariesDirectory)/uhddev/build/python/build/lib:$PYTHONPATH

      python3 automated_main.py --ats_config $(pytestAtsConfig) --dut $(pytestDUT) \
        --results_path $(Common.TestResultsDirectory)/pytest
    continueOnError: true
    condition: and(succeeded(), eq('${{ parameters.runPyTest }}', true), eq(variables['deviceEnabled'], 'true'))
    displayName: Run pytests

  - script: |
      cd $(Common.TestResultsDirectory)/devtest
      python3 $(Build.SourcesDirectory)/uhddev/.ci/utils/format_devtest_junitxml.py \
        $(Common.TestResultsDirectory)/devtest \
        $(Common.TestResultsDirectory)/devtest/devtestresults.xml
    continueOnError: true
    condition: and(succeeded(), eq('${{ parameters.runDevTest }}', true), eq(variables['deviceEnabled'], 'true'))
    displayName: Format devtest xml

  - task: PublishTestResults@2
    inputs:
      testResultsFormat: 'JUnit'
      testResultsFiles: '$(Common.TestResultsDirectory)/devtest/devtestresults.xml'
      testRunTitle: $(devName) devtest
      buildConfiguration: 'Release'
      mergeTestResults: true
      failTaskOnFailedTests: true
    condition: and(eq('${{ parameters.runDevTest }}', true), eq(variables['deviceEnabled'], 'true'))
    displayName: Upload devtest results

  - task: PublishTestResults@2
    inputs:
      testResultsFormat: 'JUnit'
      testResultsFiles: '$(Common.TestResultsDirectory)/pytest/**/*.xml'
      testRunTitle: $(devName) pytest
      buildConfiguration: 'Release'
      mergeTestResults: true
    condition: and(succeeded(), eq('${{ parameters.runPyTest }}', true), eq(variables['deviceEnabled'], 'true'))
    displayName: Upload pytest results