Skip to content

Commit 3c28bd6

Browse files
authored
fix(workers): remove schema_version from test files (#4977)
To prevent updating the schema version from requiring us to regenerate the test files (blocking #4940), changed the worker tests to manually remove the schema_version from the compared vulnerability files.
1 parent 8d6fc14 commit 3c28bd6

25 files changed

Lines changed: 87 additions & 74 deletions

gcp/workers/oss_fuzz_worker/testdata/UpdateTest_update_bad_ecosystem_new.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@
33
'modified': '3000-01-01T00:00:00Z',
44
'published': '3000-01-01T00:00:00Z',
55
'references': [{'type': 'WEB', 'url': 'https://ref.com/ref'}],
6-
'schema_version': '1.7.3',
76
'summary': 'A vulnerability'}

gcp/workers/oss_fuzz_worker/testdata/UpdateTest_update_partly_bad_ecosystem_delete.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@
33
'modified': '3000-01-01T00:00:00Z',
44
'published': '2021-01-01T00:00:00Z',
55
'references': [{'type': 'WEB', 'url': 'https://ref.com/ref'}],
6-
'schema_version': '1.7.3',
76
'summary': 'A vulnerability'}

gcp/workers/worker/testdata/RESTUpdateTest_update_no_introduced.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,5 +217,4 @@
217217
'id': 'CURL-CVE-2022-32221',
218218
'modified': '3000-01-01T00:00:00Z',
219219
'published': '2022-10-26T08:00:00Z',
220-
'schema_version': '1.7.3',
221220
'summary': 'POST following PUT confusion'}

gcp/workers/worker/testdata/UpdateTest_last_affected_git.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,4 @@
88
'modified': '3000-01-01T00:00:00Z',
99
'published': '3000-01-01T00:00:00Z',
1010
'references': [{'type': 'WEB', 'url': 'https://ref.com/ref'}],
11-
'schema_version': '1.7.3',
1211
'summary': 'A vulnerability'}

gcp/workers/worker/testdata/UpdateTest_normalized_pypi.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,4 @@
1313
'modified': '3000-01-01T00:00:00Z',
1414
'published': '3000-01-01T00:00:00Z',
1515
'references': [{'type': 'WEB', 'url': 'https://ref.com/ref'}],
16-
'schema_version': '1.7.3',
1716
'summary': 'A vulnerability in an unnormalized package'}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
[call('projects/test-osv/topics/pypi-bridge', data=b'{"id": "PYSEC-456", "summary": "A vulnerability in an unnormalized package", "details": "Blah blah blah\\nBlah\\n", "modified": "3000-01-01T00:00:00Z", "published": "3000-01-01T00:00:00Z", "references": [{"type": "WEB", "url": "https://ref.com/ref"}], "affected": [{"package": {"name": "scrapy", "ecosystem": "PyPI", "purl": "pkg:pypi/scrapy"}, "ranges": [{"type": "ECOSYSTEM", "events": [{"introduced": "1.14.2"}, {"fixed": "1.31.0"}]}, {"type": "GIT", "repo": "https://osv-test/repo/url", "events": [{"introduced": "eefe8ec3f1f90d0e684890e810f3f21e8500a4cd"}, {"fixed": "8d8242f545e9cec3e6d0d2e3f5bde8be1c659735"}]}], "versions": []}], "schema_version": "1.7.3"}')]
1+
[call('projects/test-osv/topics/pypi-bridge', data=b'{"id": "PYSEC-456", "summary": "A vulnerability in an unnormalized package", "details": "Blah blah blah\\nBlah\\n", "modified": "3000-01-01T00:00:00Z", "published": "3000-01-01T00:00:00Z", "references": [{"type": "WEB", "url": "https://ref.com/ref"}], "affected": [{"package": {"name": "scrapy", "ecosystem": "PyPI", "purl": "pkg:pypi/scrapy"}, "ranges": [{"type": "ECOSYSTEM", "events": [{"introduced": "1.14.2"}, {"fixed": "1.31.0"}]}, {"type": "GIT", "repo": "https://osv-test/repo/url", "events": [{"introduced": "eefe8ec3f1f90d0e684890e810f3f21e8500a4cd"}, {"fixed": "8d8242f545e9cec3e6d0d2e3f5bde8be1c659735"}]}], "versions": []}], "schema_version": "SCHEMA_VERSION"}')]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
[call('projects/test-osv/topics/pypi-bridge', data=b'{"id": "PYSEC-123", "summary": "A vulnerability", "details": "Blah blah blah\\nBlah\\n", "modified": "3000-01-01T00:00:00Z", "published": "3000-01-01T00:00:00Z", "references": [{"type": "WEB", "url": "https://ref.com/ref"}], "affected": [{"package": {"name": "grpcio", "ecosystem": "PyPI", "purl": "pkg:pypi/grpcio"}, "ranges": [{"type": "ECOSYSTEM", "events": [{"introduced": "1.14.2"}, {"fixed": "1.31.0"}]}, {"type": "GIT", "repo": "https://osv-test/repo/url", "events": [{"introduced": "eefe8ec3f1f90d0e684890e810f3f21e8500a4cd"}, {"fixed": "8d8242f545e9cec3e6d0d2e3f5bde8be1c659735"}]}], "versions": ["1.14.2", "1.15.0", "1.15.0rc1", "1.16.0", "1.16.0rc1", "1.16.1", "1.17.0", "1.17.1", "1.18.0", "1.19.0", "1.20.0", "1.20.0rc1", "1.20.0rc2", "1.20.0rc3", "1.20.1", "1.21.0rc1", "1.21.1", "1.21.1rc1", "1.22.0", "1.22.0rc1", "1.22.1", "1.23.0", "1.23.0rc1", "1.23.1", "1.24.0", "1.24.0rc1", "1.24.1", "1.24.3", "1.25.0", "1.25.0rc1", "1.26.0", "1.26.0rc1", "1.27.0rc1", "1.27.0rc2", "1.27.1", "1.27.2", "1.28.0rc1", "1.28.0rc2", "1.28.1", "1.29.0", "1.30.0"]}], "schema_version": "1.7.3"}')]
1+
[call('projects/test-osv/topics/pypi-bridge', data=b'{"id": "PYSEC-123", "summary": "A vulnerability", "details": "Blah blah blah\\nBlah\\n", "modified": "3000-01-01T00:00:00Z", "published": "3000-01-01T00:00:00Z", "references": [{"type": "WEB", "url": "https://ref.com/ref"}], "affected": [{"package": {"name": "grpcio", "ecosystem": "PyPI", "purl": "pkg:pypi/grpcio"}, "ranges": [{"type": "ECOSYSTEM", "events": [{"introduced": "1.14.2"}, {"fixed": "1.31.0"}]}, {"type": "GIT", "repo": "https://osv-test/repo/url", "events": [{"introduced": "eefe8ec3f1f90d0e684890e810f3f21e8500a4cd"}, {"fixed": "8d8242f545e9cec3e6d0d2e3f5bde8be1c659735"}]}], "versions": ["1.14.2", "1.15.0", "1.15.0rc1", "1.16.0", "1.16.0rc1", "1.16.1", "1.17.0", "1.17.1", "1.18.0", "1.19.0", "1.20.0", "1.20.0rc1", "1.20.0rc2", "1.20.0rc3", "1.20.1", "1.21.0rc1", "1.21.1", "1.21.1rc1", "1.22.0", "1.22.0rc1", "1.22.1", "1.23.0", "1.23.0rc1", "1.23.1", "1.24.0", "1.24.0rc1", "1.24.1", "1.24.3", "1.25.0", "1.25.0rc1", "1.26.0", "1.26.0rc1", "1.27.0rc1", "1.27.0rc2", "1.27.1", "1.27.2", "1.28.0rc1", "1.28.0rc2", "1.28.1", "1.29.0", "1.30.0"]}], "schema_version": "SCHEMA_VERSION"}')]

gcp/workers/worker/testdata/UpdateTest_ubuntu_severity_type.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,5 @@
216216
'url': 'https://git.kernel.org/stable/c/aace6b63892ce8307e502a60fe2f5a4bc6e1cfe7'},
217217
{ 'type': 'REPORT',
218218
'url': 'https://git.kernel.org/stable/c/c92d6089d8ad7d4d815ebcedee3f3907b539ff1f'}],
219-
'schema_version': '1.7.3',
220219
'severity': [{'score': 'medium', 'type': 'Ubuntu'}],
221220
'upstream': ['CVE-2025-38094']}

gcp/workers/worker/testdata/UpdateTest_update.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
'modified': '3000-01-01T00:00:00Z',
1818
'published': '2021-01-01T00:00:00Z',
1919
'references': [{'type': 'WEB', 'url': 'https://ref.com/ref'}],
20-
'schema_version': '1.7.3',
2120
'severity': [ { 'score': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L',
2221
'type': 'CVSS_V3'}],
2322
'summary': 'A vulnerability'}

gcp/workers/worker/testdata/UpdateTest_update_alpine.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -506,5 +506,4 @@
506506
{ 'type': 'ARTICLE',
507507
'url': 'https://lists.debian.org/debian-lts-announce/2022/09/msg00023.html'},
508508
{ 'type': 'WEB',
509-
'url': 'https://lists.debian.org/debian-lts-announce/2022/09/msg00023.html'}],
510-
'schema_version': '1.7.3'}
509+
'url': 'https://lists.debian.org/debian-lts-announce/2022/09/msg00023.html'}]}

0 commit comments

Comments
 (0)