Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the fuzz targets. #246

Merged
merged 1 commit into from
Apr 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
run: |
echo "lint: ${{ needs.lint.result }}"
echo "rust-tests: ${{ needs.rust-tests.result }}"
echo "rust-fuzz: ${{ needs.rust-fuzz.result }}"
echo "python-tests: ${{ needs.python-tests.result }}"
echo "wasm-tests: ${{ needs.wasm-tests.result }}"
echo "js-lint: ${{ needs.js-lint.result }}"
Expand All @@ -44,6 +45,8 @@ jobs:
run: exit 1
- if: ${{ needs.rust-tests.result != 'success' }}
run: exit 1
- if: ${{ needs.rust-fuzz.result != 'success' }}
run: exit 1
- if: ${{ needs.python-tests.result != 'success' }}
run: exit 1
- if: ${{ needs.wasm-tests.result != 'success' }}
Expand Down
4 changes: 2 additions & 2 deletions trustfall_core/fuzz/fuzz_targets/frontend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::path::PathBuf;
use async_graphql_parser::{parse_query, parse_schema, types::ServiceDocument};
use lazy_static::lazy_static;
use trustfall_core::{
frontend::{error::FrontendError, parse},
frontend::{error::FrontendError, parse_doc},
graphql_query::error::ParseError,
schema::Schema,
};
Expand All @@ -30,7 +30,7 @@ fuzz_target!(|data: &[u8]| {
if let Ok(query_string) = std::str::from_utf8(data) {
if query_string.match_indices("...").count() <= 3 {
if let Ok(document) = parse_query(query_string) {
let result = parse(&SCHEMA, &document);
let result = parse_doc(&SCHEMA, &document);
if let Err(
FrontendError::OtherError(..)
| FrontendError::ParseError(ParseError::OtherError(..)),
Expand Down
4 changes: 2 additions & 2 deletions trustfall_core/fuzz/fuzz_targets/frontend_numbers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::path::PathBuf;
use async_graphql_parser::{parse_query, parse_schema, types::ServiceDocument};
use lazy_static::lazy_static;
use trustfall_core::{
frontend::{error::FrontendError, parse},
frontend::{error::FrontendError, parse_doc},
graphql_query::error::ParseError,
schema::Schema,
};
Expand All @@ -30,7 +30,7 @@ fuzz_target!(|data: &[u8]| {
if let Ok(query_string) = std::str::from_utf8(data) {
if query_string.match_indices("...").count() <= 3 {
if let Ok(document) = parse_query(query_string) {
let result = parse(&SCHEMA, &document);
let result = parse_doc(&SCHEMA, &document);
if let Err(
FrontendError::OtherError(..)
| FrontendError::ParseError(ParseError::OtherError(..)),
Expand Down