Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

ikartiksh
Copy link
Contributor

@ikartiksh ikartiksh commented Apr 28, 2025

Signed-off-by: @ikartiksh , [email protected]

Description

Issue #23

shouldHandleNetworkConnectivityLoss: Simulates a network connectivity loss by having WireMock return a 503 Service Unavailable response. The test verifies that an OrasException with a "Response code: 503" message is thrown when the registry is queried.

shouldHandleCorruptedResponse: Simulates a corrupted blob response by returning a mismatched response body. The test checks that an OrasException is thrown with a "Digest mismatch" message when the blob's digest does not match the expected one.

Testing done

  • Tests successfully run in relevant environments.
  • Tests pass in CI.

Submitter checklist

  • I have read and understood the CONTRIBUTING guide
  • I have run mvn license:update-file-header, mvn spotless:apply, pre-commit run -a, mvn clean install before opening the PR

@ikartiksh ikartiksh requested a review from jonesbusy as a code owner April 28, 2025 19:44
@ikartiksh ikartiksh changed the title add NetworkConnectivity and CorrputedResponses using Wiremock add NetworkConnectivity and CorruptedResponses using Wiremock Apr 28, 2025
@ikartiksh ikartiksh changed the title add NetworkConnectivity and CorruptedResponses using Wiremock add NetworkConnectivity and CorruptedResponses Tests using Wiremock Apr 28, 2025
Copy link
Collaborator

@jonesbusy jonesbusy left a comment

Choose a reason for hiding this comment

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

PR contains unrelated changes. Make sure it's rebased correctly on main and contains only one single commit that reflect the test changes

@ikartiksh
Copy link
Contributor Author

@jonesbusy due to the specific utils file src/main/generated/Versions.java the build is failing.
when this utils is moved to src/main/java/land/oras/utils the build works fine.

@jonesbusy
Copy link
Collaborator

Looks at the CI on main. It works.

Build is faling because of spotless.

@ikartiksh
Copy link
Contributor Author

I ran spotless and the build was successful.

@jonesbusy
Copy link
Collaborator

I would be great to follow the contributing quideline before opening PR.

Not doing it creates extra work for maintainer and lower chances for PR to get merged (even for small changes like this one).

Thanks

@ikartiksh
Copy link
Contributor Author

apologies for the inconvenience caused

Copy link

codecov bot commented Apr 29, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.20%. Comparing base (24901a0) to head (00aae58).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main     #295   +/-   ##
=========================================
  Coverage     88.20%   88.20%           
  Complexity      561      561           
=========================================
  Files            39       39           
  Lines          1772     1772           
  Branches        194      194           
=========================================
  Hits           1563     1563           
  Misses          132      132           
  Partials         77       77           

☔ 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.

@jonesbusy
Copy link
Collaborator

Looking at codecov those 2 tests doesn't increase coverage. I'm fine to keep them since it will be useful for #18

Mergint then. Thanks.

@jonesbusy jonesbusy merged commit eb6e1e8 into oras-project:main Apr 29, 2025
4 checks passed
@ikartiksh ikartiksh deleted the wiremock-tests branch April 29, 2025 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants