aboutsummaryrefslogtreecommitdiffstats
path: root/ci/lint-test.yml
blob: 2d70f6e8d95a923c337353eed3f35b347c6d583b (plain) (blame)
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
steps:
  - script: |
      docker exec snekbox_test /bin/bash -c \
        'flake8; flake8 --format junit-xml --output-file test-lint.xml'
    displayName: 'Run Linter'

  - task: PublishTestResults@2
    displayName: 'Publish Lint Results'
    condition: succeededOrFailed()
    inputs:
      testResultsFiles: '**/test-lint.xml'
      testRunTitle: 'Lint Results'

  # Memory limit tests would fail if this isn't disabled.
  - script: sudo swapoff -a
    displayName: 'Disable Swap Memory'

  - script: |
      docker exec snekbox_test /bin/bash -c \
        'coverage run -m xmlrunner'
    displayName: 'Run Unit Tests'

  - task: PublishTestResults@2
    displayName: 'Publish Test Results'
    condition: succeededOrFailed()
    inputs:
      testResultsFiles: '**/TEST-*.xml'
      testRunTitle: 'Test Results'

  # Run report too because the XML report doesn't output to stdout.
  - script: |
      docker exec snekbox_test /bin/bash -c \
        'coverage report && coverage xml'
    displayName: 'Generate Coverage Report'

  - task: PublishCodeCoverageResults@1
    displayName: 'Publish Coverage Results'
    condition: succeededOrFailed()
    inputs:
      codeCoverageTool: Cobertura
      summaryFileLocation: '**/coverage.xml'