Skip to content

Conversation

@sudiptob2
Copy link
Member

@sudiptob2 sudiptob2 commented Mar 7, 2025

What type of PR is this?

Implement fuzzers to target translateGatewayAPIToIR.

Which issue(s) this PR fixes:

Fixes #5428

Release Notes: No

@sudiptob2 sudiptob2 requested a review from a team as a code owner March 7, 2025 00:15
@sudiptob2 sudiptob2 changed the title Test/fuzz/gateway to ir test: add fuzzers for egctl. translateGatewayAPIToIR Mar 7, 2025
@sudiptob2 sudiptob2 changed the title test: add fuzzers for egctl. translateGatewayAPIToIR test: add fuzzers for egctl. translateGatewayAPIToIR Mar 7, 2025
@sudiptob2 sudiptob2 changed the title test: add fuzzers for egctl. translateGatewayAPIToIR test: add fuzzers for egctl.translateGatewayAPIToIR Mar 7, 2025
@arkodg
Copy link
Contributor

arkodg commented Mar 7, 2025

@sudiptob2 you'll need to run

if err = defaultValidator.Validate(yamlByte); err != nil {
to default some of the nil values (those defaults live in the CRD/OpenAPI definition), else this fuzzer will easily crash. These defaults are either set by the kube api server or by the file loader/provider

@sudiptob2 sudiptob2 marked this pull request as draft March 7, 2025 00:37
@sudiptob2 sudiptob2 force-pushed the test/fuzz/gateway-to-ir branch from f8039bb to d41073d Compare March 7, 2025 07:05
@sudiptob2 sudiptob2 marked this pull request as ready for review March 7, 2025 07:06
@sudiptob2 sudiptob2 force-pushed the test/fuzz/gateway-to-ir branch from d41073d to 6b5949b Compare March 8, 2025 00:57
@codecov
Copy link

codecov bot commented Mar 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 65.25%. Comparing base (8b74d01) to head (a06bd97).
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5430      +/-   ##
==========================================
- Coverage   65.30%   65.25%   -0.05%     
==========================================
  Files         213      213              
  Lines       33915    33915              
==========================================
- Hits        22147    22131      -16     
- Misses      10438    10449      +11     
- Partials     1330     1335       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

return
}

if resources.GatewayClass == nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see LoadResourcesFromYAMLBytes actually adds a default GatewayClass if it doesn't exist, so this check may not be needed.

if err != nil {
return
}
rs, err := resource.LoadResourcesFromYAMLBytes(yamlBytes, true)
Copy link
Contributor

@nareddyt nareddyt Mar 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also have go-fuzz-headers generate the 2nd bool value, instead of hardcoding it to true? Would be good to test this function under both cases.

@sudiptob2 sudiptob2 force-pushed the test/fuzz/gateway-to-ir branch from 6b5949b to 9e5a890 Compare March 10, 2025 02:47
@sudiptob2 sudiptob2 requested a review from nareddyt March 10, 2025 02:59
@sudiptob2 sudiptob2 force-pushed the test/fuzz/gateway-to-ir branch from 9e5a890 to b5135b6 Compare March 11, 2025 00:23
@sudiptob2 sudiptob2 force-pushed the test/fuzz/gateway-to-ir branch from b5135b6 to a06bd97 Compare March 11, 2025 03:36
Copy link
Contributor

@arkodg arkodg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks !

@arkodg arkodg merged commit d5872be into envoyproxy:main Mar 11, 2025
24 of 25 checks passed
@sudiptob2 sudiptob2 deleted the test/fuzz/gateway-to-ir branch March 11, 2025 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement fuzzers for Gateway API resource to IR translation

3 participants