[sdk-platform-java] Remove internet request in unit tests

Open Beginner friendly
#12,418 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
65/100
Issue type
Refactor
Clarity
Clearly specified
Activity status
Stale
Tech stack
git, python
Domain
testing-qa

Research direction

Start with hermetic_build/release_note_generation/tests/generate_pr_description_unit_tests.py and identify the unit tests that invoke git clone and git checkout. Replace the real operations with mocks, then run the file's unit tests to confirm they no longer make internet requests and remain deterministic.

Written by the indexing model from the issue text.

Description

priority: p2 type: feature request

The unit tests in hermetic_build/release_note_generation/tests/generate_pr_description_unit_tests.py have real git clone and git checkout. However, it is not a best practice for unit tests to depend on internet request as it is slow and flaky.

We should mock these operations to make the unit tests quick and deterministic.

Dominant language
Java
Stars
2.1k
Forks
1.2k
Avg merge
1d 21h
Merged PRs (30d)
131

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from googleapis/google-cloud-java

All issues in googleapis/google-cloud-java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.