~cypheon/dronecov

ref: daf17a6193508decad5fd450fe9043fc86032bde dronecov/tests/test_minimal.tavern.yaml -rw-r--r-- 1.6 KiB
daf17a61 — Johann Rudloff Add IDs to all test stages in preparation for tavern upgrade. 2 years ago
                                                                                
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
---
test_name: POST coverage report and verify returned SVG

stages:
  - name: post initial coverage
    id: post_initial_coverage

    request:
      url: '{host}/testuser/testrepo/master/coverage'
      method: POST
      headers:
        content-type: application/json
        authorization: 'Bearer {tavern.env_vars.ACCESS_TOKEN}'
      json:
        coverage_total: 42.3
        build_number: 18

    response:
      status_code: 201

  - name: verify returned coverage is correct
    id: coverage_correct

    request:
      url: '{host}/testuser/testrepo/master/coverage.svg'
      method: GET

    response:
      status_code: 200
      headers:
        content-type: image/svg+xml;charset=utf-8
      body:
        $ext:
          function: tests.utils:validate_svg
          extra_kwargs:
            coverage: "42.3"


  - name: update coverage
    id: update_coverage

    request:
      url: '{host}/testuser/testrepo/master/coverage'
      method: POST
      headers:
        content-type: application/json
        authorization: 'Bearer {tavern.env_vars.ACCESS_TOKEN}'
      json:
        coverage_total: 2.311
        build_number: 19

    response:
      status_code: 201

  - name: verify updated coverage is returned correctly
    id: updated_coverage_correct

    request:
      url: '{host}/testuser/testrepo/master/coverage.svg'
      method: GET

    response:
      status_code: 200
      headers:
        content-type: image/svg+xml;charset=utf-8
      body:
        $ext:
          function: tests.utils:validate_svg
          extra_kwargs:
            coverage: "2.31"