aboutsummaryrefslogtreecommitdiffhomepage
path: root/infra/build/functions/test_data/expected_coverage_build_steps.json
blob: 5a1011d0f8c8ecd97974746411bc62f325f1dd10 (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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
[
  {
    "args": [
      "clone",
      "https://github.com/google/oss-fuzz.git",
      "--depth",
      "1"
    ],
    "name": "gcr.io/cloud-builders/git"
  },
  {
    "name": "gcr.io/cloud-builders/docker",
    "args": [
      "build",
      "-t",
      "gcr.io/oss-fuzz/test-project",
      "."
    ],
    "dir": "oss-fuzz/projects/test-project"
  },
  {
    "name": "gcr.io/oss-fuzz/test-project",
    "args": [
      "bash",
      "-c",
      "srcmap > /workspace/srcmap.json && cat /workspace/srcmap.json"
    ],
    "env": [
      "OSSFUZZ_REVISION=$REVISION_ID",
      "FUZZING_LANGUAGE=c++"
    ],
    "id": "srcmap"
  },
  {
    "name": "gcr.io/oss-fuzz/test-project",
    "env": [
      "ARCHITECTURE=x86_64",
      "FUZZING_ENGINE=libfuzzer",
      "FUZZING_LANGUAGE=c++",
      "HOME=/root",
      "OUT=/workspace/out/libfuzzer-coverage-x86_64",
      "SANITIZER=coverage"
    ],
    "args": [
      "bash",
      "-c",
      "rm -r /out && cd /src && cd /src && mkdir -p /workspace/out/libfuzzer-coverage-x86_64 && compile || (echo \"********************************************************************************\nFailed to build.\nTo reproduce, run:\npython infra/helper.py build_image test-project\npython infra/helper.py build_fuzzers --sanitizer coverage --engine libfuzzer --architecture x86_64 test-project\n********************************************************************************\" && false)"
    ],
    "id": "compile-libfuzzer-coverage-x86_64"
  },
  {
    "url": "test_download"
  },
  {
    "name": "gcr.io/oss-fuzz-base/base-runner",
    "env": [
      "ARCHITECTURE=x86_64",
      "FUZZING_ENGINE=libfuzzer",
      "FUZZING_LANGUAGE=c++",
      "HOME=/root",
      "OUT=/workspace/out/libfuzzer-coverage-x86_64",
      "SANITIZER=coverage",
      "HTTP_PORT=",
      "COVERAGE_EXTRA_ARGS="
    ],
    "args": [
      "bash",
      "-c",
      "for f in /corpus/*.zip; do unzip -q $f -d ${f%%.*} || (echo \"Failed to unpack the corpus for $(basename ${f%%.*}). This usually means that corpus backup for a particular fuzz target does not exist. If a fuzz target was added in the last 24 hours, please wait one more day. Otherwise, something is wrong with the fuzz target or the infrastructure, and corpus pruning task does not finish successfully.\" && exit 1); done && coverage || (echo \"********************************************************************************\nCode coverage report generation failed.\nTo reproduce, run:\npython infra/helper.py build_image test-project\npython infra/helper.py build_fuzzers --sanitizer coverage test-project\npython infra/helper.py coverage test-project\n********************************************************************************\" && false)"
    ],
    "volumes": [
      {
        "name": "corpus",
        "path": "/corpus"
      }
    ]
  },
  {
    "name": "gcr.io/cloud-builders/gsutil",
    "entrypoint": "sh",
    "args": [
      "-c",
      "gsutil -m rm -rf gs://oss-fuzz-coverage/test-project/reports/20200101 || exit 0"
    ]
  },
  {
    "name": "gcr.io/cloud-builders/gsutil",
    "args": [
      "-m",
      "cp",
      "-r",
      "/workspace/out/libfuzzer-coverage-x86_64/report",
      "gs://oss-fuzz-coverage/test-project/reports/20200101"
    ]
  },
  {
    "name": "gcr.io/cloud-builders/gsutil",
    "entrypoint": "sh",
    "args": [
      "-c",
      "gsutil -m rm -rf gs://oss-fuzz-coverage/test-project/fuzzer_stats/20200101 || exit 0"
    ]
  },
  {
    "name": "gcr.io/cloud-builders/gsutil",
    "args": [
      "-m",
      "cp",
      "-r",
      "/workspace/out/libfuzzer-coverage-x86_64/fuzzer_stats",
      "gs://oss-fuzz-coverage/test-project/fuzzer_stats/20200101"
    ]
  },
  {
    "name": "gcr.io/cloud-builders/gsutil",
    "entrypoint": "sh",
    "args": ["-c",
      "gsutil -m rm -rf gs://oss-fuzz-coverage/test-project/textcov_reports/20200101 || exit 0"]
  },
  {
    "name": "gcr.io/cloud-builders/gsutil",
    "args": ["-m",
            "cp",
            "-r",
            "/workspace/out/libfuzzer-coverage-x86_64/textcov_reports",
            "gs://oss-fuzz-coverage/test-project/textcov_reports/20200101"]
  },
  {
    "name": "gcr.io/cloud-builders/gsutil",
    "entrypoint": "sh",
    "args": [
      "-c",
      "gsutil -m rm -rf gs://oss-fuzz-coverage/test-project/logs/20200101 || exit 0"
    ]
  },
  {
    "name": "gcr.io/cloud-builders/gsutil",
    "args": [
      "-m",
      "cp",
      "-r",
      "/workspace/out/libfuzzer-coverage-x86_64/logs",
      "gs://oss-fuzz-coverage/test-project/logs/20200101"
    ]
  },
  {
    "name": "gcr.io/cloud-builders/gsutil",
    "args": [
      "cp",
      "/workspace/srcmap.json",
      "gs://oss-fuzz-coverage/test-project/srcmap/20200101.json"
    ]
  },
  {
    "name": "gcr.io/cloud-builders/curl",
    "args": [
      "-H",
      "Content-Type: application/json",
      "-X",
      "PUT",
      "-d",
      "{\"fuzzer_stats_dir\": \"gs://oss-fuzz-coverage/test-project/fuzzer_stats/20200101\", \"html_report_url\": \"https://storage.googleapis.com/oss-fuzz-coverage/test-project/reports/20200101/linux/index.html\", \"report_date\": \"20200101\", \"report_summary_path\": \"gs://oss-fuzz-coverage/test-project/reports/20200101/linux/summary.json\"}",
      "test_url"
    ]
  }
]