nginx-gateway-fabric icon indicating copy to clipboard operation
nginx-gateway-fabric copied to clipboard

Update simplified http response assertion

Open miledxz opened this issue 9 months ago • 2 comments
trafficstars

Proposed changes

Adding simplified http response assertion

Problem: Not using built in Gomega assertions

Solution: Using built in Gomega assertions

Here we explicitly returns nil, making it clear that if framework.Get does not fail, the function should not return an error. Expect will fail the test if conditions are not met, so returning err does not add value.

Closes #1992

  • [x] I have read the CONTRIBUTING doc
  • [ ] I have added tests that prove my fix is effective or that my feature works
  • [x] I have checked that all unit tests pass after adding my changes
  • [ ] I have updated necessary documentation
  • [x] I have rebased my branch onto main
  • [ ] I will ensure my PR is targeting the main branch and pulling from my branch from my own fork

miledxz avatar Feb 16 '25 11:02 miledxz

Thanks @miledxz, I think there are a couple other locations in a few tests that can also be updated. If you do a search for http.StatusOK, that should help find them.

sjberman avatar Feb 18 '25 15:02 sjberman

This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 14 days.

github-actions[bot] avatar Mar 28 '25 02:03 github-actions[bot]

This PR was closed because it has been stalled for 14 days with no activity.

github-actions[bot] avatar Apr 11 '25 02:04 github-actions[bot]