Skip to content

feat(Improvements): Migrate gcsx integration and random_reader tests to testify - #5031

Open
charith87 wants to merge 2 commits into
masterfrom
charithc_changes_go_9
Open

feat(Improvements): Migrate gcsx integration and random_reader tests to testify#5031
charith87 wants to merge 2 commits into
masterfrom
charithc_changes_go_9

Conversation

@charith87

Copy link
Copy Markdown
Collaborator

Description

Migrate tests in internal/gcsx from legacy ogletest to testify:

  • integration_test.go: Convert helper and integration tests to use testify/assert and testify/require.
  • random_reader_test.go: Migrate random reader unit tests and mock expectations to testify/assert, testify/mock, and testify/require, and use t.TempDir() for isolated cache directory testing.
    Helps in standard IDE integration, moving away from unmaintained library, and unifying testing styles.

Link to the issue in case of a bug fix.

N/A

Testing details

  1. Manual - make build passed.
  2. Unit tests - go test -v -count=1 ./internal/gcsx/... passed.
  3. Integration tests - N/A

Any backward incompatible change? If so, please explain.

N/A

@charith87
charith87 requested a review from meet2mky August 16, 2026 14:55
@charith87
charith87 requested a review from a team as a code owner August 16, 2026 14:55
@github-actions github-actions Bot added the remind-reviewers Auto remind reviewers in attention set for review post 24hrs of inactivity on PR. label Aug 16, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the integration and random reader tests in internal/gcsx to migrate from the deprecated ogletest framework to standard Go testing using testify/assert and testify/require. This includes introducing helper structs (integrationTestHelper and randomReaderTestHelper) to streamline test setup, teardown, and mocking. The review feedback highlights opportunities to improve test robustness and readability by replacing manual polling loops with require.Eventually and replacing assert.True(reflect.DeepEqual(...)) or assert.True(bytes.Equal(...)) with idiomatic assert.Equal assertions to get better failure diffs.

Comment thread internal/gcsx/random_reader_test.go
Comment thread internal/gcsx/random_reader_test.go Outdated
Comment thread internal/gcsx/integration_test.go Outdated
@codecov

codecov Bot commented Aug 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.84%. Comparing base (872920d) to head (6a9faea).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5031      +/-   ##
==========================================
- Coverage   83.90%   83.84%   -0.07%     
==========================================
  Files         176      176              
  Lines       21546    21546              
==========================================
- Hits        18078    18065      -13     
- Misses       2769     2782      +13     
  Partials      699      699              
Flag Coverage Δ
unittests 83.84% <ø> (-0.07%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.

@charith87 charith87 changed the title test: Migrate gcsx integration and random_reader tests to testify feat(Improvements): Migrate gcsx integration and random_reader tests to testify Aug 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

remind-reviewers Auto remind reviewers in attention set for review post 24hrs of inactivity on PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant