Commit Graph

47 Commits

Author SHA1 Message Date
jonathanmetzman e407f54e61
[infra][build] Switch to f-strings. (#6182) 2021-08-10 10:48:16 -07:00
jonathanmetzman e7952dac25
[presubmit][NFC] Use descriptive tone in docstrings (#6192) 2021-08-10 10:47:42 -07:00
jonathanmetzman 7e35b01f7e
[presubmit][NFC] Fix copyright line 2021-08-04 19:38:54 -07:00
jonathanmetzman aac1cb8c76
[infra][NFC] Use one source of truth for engines, languages etc. (#6163)
Do this only where it makes sense. For example, since CIFuzz doesn't
support dataflow, maintain a separate source of truth.
2021-08-04 17:04:55 -07:00
jonathanmetzman 0bf87a10c4
[cifuzz] Only grab github-specific env vars on github (#6150)
This removes need for non-OSS-Fuzz users to fake using OSS-Fuzz.

Fixes: #6129
2021-08-03 18:13:59 -07:00
jonathanmetzman c75d1b362f
[cifuzz] Create validate method on BaseConfig (#6135)
* [cifuzz] Create validate method on BaseConfig

Use it to validate that either OSS_FUZZ_PROJECT_NAME
or BUILD_INTEGRATION_PATH is set.
Also use it to validate that workspace is set
(rather than duplicate code).
Add tests.

* Use env var hack to bypass valdiation

* fix

* fix

* fmt

* fix

* tmp

* fix
2021-08-02 12:37:37 -07:00
MarcoFalke aed20a9b62
ci: Fix get_changed_files_output (#5944)
* ci: Fix get_changed_files_output

* Update project_tests.yml

* ci: Fix presubmit checks

* ci: Use fetch-depth:0 instead of --unshallow
2021-06-21 07:14:41 -07:00
jonathanmetzman 1876845050
[CIFuzz] Add python port of github's actions/toolkit nodejs library (#5932) 2021-06-18 04:57:44 -07:00
jonathanmetzman 9648a6ebf4
[presubmit] Add option to skip slow build tests. (#5844) 2021-05-25 21:44:24 -07:00
jonathanmetzman e146f71833
[presubmit] Add check to ensure dataflow is specified properly. (#5833)
Also remove dataflow from projects where it was removed improperly
or added improperly.
2021-05-25 16:02:44 +00:00
Catena cyber 446d59e6e9
Adds swift-protobuf project (#5493)
* Adds swift-protobuf project

* Support swift language

* Fuzz target improvements

* No test for fuzz package

* fixup comments

* rename to binary

* symbolizer
2021-04-13 13:59:07 +10:00
Fabian Meumertzheim 481280c650
[jazzer] Adapt infra scripting to JVM fuzz targets (#5176)
compile, bad_build_check, and presubmit.py require small tweaks to
support JVM fuzz targets, most of which are similar to those required
for Python. The following additional changes are required:

* Since the Jazzer driver binary already links in libFuzzer, it should
  not be built as a static library.
* It is not clear how to do architecture checks as JVM fuzz targets can
  load their native dependencies dynamically at runtime. For now, the
  check is disabled.
* The Jazzer binaries are moved into $OUT and need to be skipped over in
  find_fuzz_targets.
2021-02-16 07:06:58 -08:00
jonathanmetzman ae802f3017
[presubmit] Make sure to run build tests even if nonbuild tests fail (#5183)
Previously "and" shortcircuiting caused the build tests not to be
run if the non-build tests (which are run first) failed.
2021-02-12 09:24:13 -08:00
jonathanmetzman 6e38a76220
[infra] Improve test speed (#5118)
Make unittests take 20 seconds to run instead of 35.
Make integration tests take 50 seconds to run instead of 6 minutes.
Make CI take 6 minutes instead of 12 minutes.

1. Allow running tests in parallel. Locally this takes the time for running all tests (including integration tests) from 6 minutes to ~50 seconds. We don't do parallel by default since it doesn't really save any time unless running integration tests on my machine (probably due to overhead of starting ~70 processes). This also speeds up CI from about 12 minutes to 6 minutes  (since github actions has 2 cores per machine).
2. Fix how we run tests. I'm not exactly sure why, but the method we used for discovering tests, recursing through every directory and passing to unittest caused the build/infra tests to execute twice. Fixing this makes running unittests take ~20 seconds instead of ~35.

This change also uses pytest for running tests since it's easy to use it to run tests in parallel.
This change was made possible by #5113
2021-02-05 06:10:42 -08:00
Abhishek Arya d45336243a
Simplify changed files logic. (#5056) 2021-01-27 17:43:15 -08:00
Abhishek Arya 23e24a4bac
Get list of changed files from branch head, instead of master. (#5048)
* Get list of changed files from branch head, instead of master.

Fixes https://github.com/google/oss-fuzz/issues/5022

* Add debug with subprocess.call.

* Try again debugginig.

* Try again

* Fix works!
2021-01-27 14:28:27 -08:00
jonathanmetzman 0ac841a1a4
Replace terms that are uninclusive. (#5045) 2021-01-25 08:41:34 -08:00
Oliver Chang 5b51cfb00f
Fix build functions tests when invoked from unittest.TestSuite. (#5027) 2021-01-21 07:43:42 -08:00
Jonathan Metzman c5397ce3df fix nits 2021-01-20 18:00:33 -08:00
Jonathan Metzman e4195808a8 Explain why blacklisting base-sanitizer-libs-builder 2021-01-20 17:58:06 -08:00
Jonathan Metzman 0dbdeae5d2 fmt/lnt 2021-01-20 15:55:25 -08:00
Jonathan Metzman adebf8ece3 implement blocklist 2021-01-20 15:52:20 -08:00
Jonathan Metzman 9ce539763f fix 2021-01-20 15:18:18 -08:00
Jonathan Metzman b3e30e5170 Fix lint function and add pylint directive 2021-01-20 13:29:47 -08:00
Jonathan Metzman a5ad91c7f5 Fix docstring 2021-01-20 13:25:56 -08:00
Jonathan Metzman 2b26c5446f Lint everything (and test everything too? 2021-01-20 13:25:56 -08:00
jonathanmetzman c2165341d2
[presubmit] Support option to run on all files (#4870) 2020-12-18 10:43:22 -08:00
Oliver Chang 84faf55729
Populate a bunch of main_repo values. (#4815)
Also enforce this for future integrations.
2020-12-10 09:49:27 +11:00
mbarbella-chromium e36bb8f7c6
Initial support for ujson (as a Python fuzzing sample). (#4657)
* Initial support for ujson (as a Python fuzzing sample).

* Add python to supported languages.

* Fix TODO.

* Update presubmit to ignore python in projects.

* Format

* Remove explicit addition of -fsanitize=fuzzer-no-link

* Only fuzz using libFuzzer.

Co-authored-by: Martin Barbella <mbarbella@google.com>
2020-11-19 07:40:10 -08:00
Oliver Chang 97136f87e4
Set main repo for clamav. (#4466) 2020-09-23 10:41:20 +10:00
Oliver Chang a8263735f5
Add a blackbox field to project.yaml (#4405)
This is needed for CF to determine whether or not to allocate the
project on a higher end bot to run the blackbox fuzzer.

Previously this was keyed on the "none" entry under fuzzing_engines,
which wasn't very descriptive. This change also lets us do both blackbox
and greybox fuzzing in the same project, which will be done for quickjs.
2020-09-03 11:08:09 +10:00
jonathanmetzman 13f7ba0f63
[presubmit] Allow 'none' as a fuzzing engine (#4370)
'none' is used by projects like spidermonkey that use the JS fuzzer.
2020-08-25 16:31:29 -07:00
Abhishek Arya 103aca2e27
Add |builds_per_day| to supported section in project.yaml. (#4291) 2020-08-10 08:08:25 -07:00
jonathanmetzman 659d4e8228
Fix CIFuzz issue where targets assumed in OSS-Fuzz build if exists (#3817)
Make some other changes:
1. Refactor fuzz_target.py and fuzz_target_test.py
2. Introduce pyfakefs and parameterized as dependencies and use them
in tests.
3. Fix infra-tests in CI so that they use installed dependencies
2020-05-28 10:14:57 -07:00
jonathanmetzman 1f533163cc
[CIFuzz] Support ALLOWED_BROKEN_TARGETS_PERCENTAGE (#3726)
Currently we use Github action's inputs as inputs to cifuzz.
This means we need to do an extra step to convert each input into
an env var so our scripts can actually use it.
This is pretty bug prone and unnecessary, we should probably
get rid of this abstraction and switch to encouraging devs to set
the env vars directly.
2020-05-13 12:44:11 -07:00
Jonathan Metzman dac83d7b8e Revert "[CIFuzz] Support ALLOWED_BROKEN_TARGETS_PERCENTAGE"
This reverts commit 6f1a7f7911.
2020-04-28 13:37:58 -07:00
Jonathan Metzman 6f1a7f7911 [CIFuzz] Support ALLOWED_BROKEN_TARGETS_PERCENTAGE 2020-04-28 13:36:21 -07:00
Max Moroz 71f4914c45
[presubmit] Enforce language attribute in project.yaml to be always set. (#3477)
* [presubmit] Enforce language attribute in projectt.yaml to be always set.

* Update documentation, better presubmit check, new project template.

* add docstring to templates.py

* Add example values in the project.yaml template and remove python value for now

* Add "project: c++" to 256 projects

* format

* Add labels and selective_unpack sections to the presubmit check

* fix incorrect auto_ccs format in three projects

* fix nss emails after rebase
2020-03-10 11:08:01 -07:00
Leo Neat ffa49091d6
[infra] Presubmit fix - test (#3443)
Fixes issue that presubmit test was not returning failure even when a test failed.
2020-03-05 08:44:18 -08:00
Leo Neat 1522a7428c
[Infra] Add tests to presubmit (#3405)
Adds unit/integration tests to travis presubmit.
2020-02-21 08:47:13 -08:00
Philip Withnall b036df0ce1
glib: Fix build due to Meson option changing type (#3358)
* glib: Fix build due to Meson option changing type

In GLib master commit b220033c we changed the `libmount` option from a
`boolean` to a `feature`, which means it now takes
`enabled`/`disabled`/`auto` rather than `true`/`false`.

Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>

Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20552

* glib: Fix homepage URI

The FSF page on GLib is not official, loaded with their advertising, and
quite out of date.

Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>

* infra: Add help_url to the valid section names list in Travis checks

It’s documented as valid:
https://google.github.io/oss-fuzz/getting-started/new-project-guide/#help_url

Signed-off-by: Philip Withnall <philip@tecnocode.co.uk>
2020-02-07 05:03:31 -08:00
Max Moroz 7751ab5a87
[infra] Introduce "language" attribute in the project.yaml (#3297). (#3299)
* [infra] Introduce "language" attribute in the project.yaml (#3297).

* follow up

* enable the attribute for more projects

* trailing newline
2020-01-30 15:36:44 -08:00
Max Moroz 9918ef3f67
[infra] Make presubmit script handle experimental flag in project.yaml (#3277). (#3280)
* [infra] Make presubmit script handle experimental flag in project.yaml (#3277).

* make Travis happy

* address review feedback

* fix one more comment

* fix yaml file and address review feedback
2020-01-23 07:20:59 -08:00
Max Moroz a37f237ca5
[infra] Add fuzzing_engines section for the project.yaml. (#3267)
* [infra] Add fuzzing_engines section for the project.yaml.

* Update presubmit.py

* Update presubmit.py

* Update presubmit.py
2020-01-21 15:48:09 -08:00
Max Moroz b5abd91f20
[infra] Presubmit: remove license check for all .yaml files. (#3235) 2020-01-15 09:33:39 -08:00
Abhishek Arya f06afc1ebe
Fix presubmit parsing issue with emails. (#3234)
* Fix presubmit parsing issue with emails.

* Fix
2020-01-15 07:41:53 -08:00
jonathanmetzman 363d00ba5f
[infra] Add presubmit script (#3196) 2020-01-10 10:19:42 -08:00