Skip to content

test: add -short test mode support - #1109

Merged
kalbasit merged 2 commits into
mainfrom
test-add-short-test-mode-support
Mar 18, 2026
Merged

kalbasit merged 2 commits into
mainfrom
test-add-short-test-mode-support

Conversation

@kalbasit

Copy link
Copy Markdown
Owner

This adds testing.Short() guards to slow tests (>500ms) to enable fast
local development runs with 'go test -short -race ./...'. The following
tests are gated:

  • TestCDCChunker_Chunk_ErrorRace
  • TestGetNarInfoDistributedCoordination
  • TestGetNar_UploadOnly
  • TestIssue990_BackgroundJobContextCancellation
  • TestPrefetchPipelineOrdering,
  • TestProgressiveStreamingAborted
  • TestProgressiveStreamingWithPrefetch
  • TestPutNarInfo_DoesNotTriggerNARStreaming
  • TestRunCDCLazyRecovery
  • TestRunCDCLazyRecoveryNoStuckFiles
  • TestRunCDCLazyRecoveryWithFilesNewerThanCutoff
  • TestStoreNarWithCDCCleanupOnFailure

@kalbasit

kalbasit commented Mar 18, 2026 •

Copy link
Copy Markdown
Owner Author

@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. go Pull requests that update go code labels Mar 18, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly improves the local development workflow by integrating Go's built-in -short testing flag. It allows developers to quickly run a subset of tests, specifically skipping those identified as slow, to achieve a faster feedback loop without compromising the thoroughness of the full test suite run in continuous integration environments. The changes are purely test-related and do not affect production code.

Highlights

  • Enabled Go's -short test mode: Implemented support for go test -short to allow for faster local development runs by skipping long-running tests.
  • Gated slow tests: Added testing.Short() guards to specific tests identified as taking over 500ms to execute, ensuring they are skipped when the -short flag is used.
  • Introduced short-test-mode specification: Added new documentation, design, proposal, and specification files outlining the context, goals, decisions, and requirements for the new short test mode capability.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@dosubot

dosubot Bot commented Mar 18, 2026 •

Copy link
Copy Markdown

Documentation Updates

1 document(s) were updated by changes in this PR:

Development Environment with MinIO
View Changes
@@ -138,8 +138,11 @@
 eval "$(enable-postgres-tests)"    # PostgreSQL only
 eval "$(enable-mysql-tests)"       # MySQL/MariaDB only
 
-# Run tests using nix develop --command
+# Run full test suite
 nix develop --command go test -race ./...
+
+# Or run fast test suite (skips slow tests)
+nix develop --command go test -short -race ./...
 
 # Disable integration tests when done
 eval "$(disable-integration-tests)"
@@ -150,8 +153,14 @@
 The recommended way to run tests is using `nix develop --command`, which works consistently in both the main working tree and in worktrees:
 
 ```sh
+# Full test suite (comprehensive testing)
 nix develop --command go test -race ./...
+
+# Fast test suite (quick feedback during development)
+nix develop --command go test -short -race ./...
 ```
+
+Use `go test -short -race ./...` for faster local development runs. This skips slow tests (those taking longer than 500ms) and is useful for rapid iteration during development. The full test suite without `-short` runs all tests and should be used for comprehensive testing before submitting changes.
 
 For interactive use, you can also enter the development shell with `nix develop` or use `direnv allow` if you have `direnv` installed.
 

How did I do? Any feedback?  Join Discord

@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 introduces support for the testing.Short() flag in Go tests, allowing for faster local development runs by skipping long-running tests. The changes correctly apply t.Skip("skipping test in short mode") guards to identified slow tests across various pkg/cache and pkg/chunker test files. Additionally, new OpenSpec markdown files detail the context, goals, decisions, and tasks related to this feature. Overall, the implementation aligns well with the stated objective.

Comment thread openspec/specs/short-test-mode/spec.md Resolved
@kalbasit
kalbasit force-pushed the feat-add-closure-pinning-to branch from 9c5b701 to d5c5119 Compare March 18, 2026 16:34
@kalbasit
kalbasit force-pushed the test-add-short-test-mode-support branch 3 times, most recently from 972304a to 85d4519 Compare March 18, 2026 22:56
Base automatically changed from feat-add-closure-pinning-to to main March 18, 2026 23:10
@dosubot dosubot Bot added size:XXL This PR changes 1000+ lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Mar 18, 2026
kalbasit and others added 2 commits March 18, 2026 16:44
This adds testing.Short() guards to slow tests (>500ms) to enable fast
local development runs with 'go test -short -race ./...'. The following
tests are gated:
- TestCDCChunker_Chunk_ErrorRace
- TestGetNarInfoDistributedCoordination
- TestGetNar_UploadOnly
- TestIssue990_BackgroundJobContextCancellation
- TestPrefetchPipelineOrdering,
- TestProgressiveStreamingAborted
- TestProgressiveStreamingWithPrefetch
- TestPutNarInfo_DoesNotTriggerNARStreaming
- TestRunCDCLazyRecovery
- TestRunCDCLazyRecoveryNoStuckFiles
- TestRunCDCLazyRecoveryWithFilesNewerThanCutoff
- TestStoreNarWithCDCCleanupOnFailure
@kalbasit
kalbasit force-pushed the test-add-short-test-mode-support branch from 85d4519 to 5260965 Compare March 18, 2026 23:44
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:XXL This PR changes 1000+ lines, ignoring generated files. labels Mar 18, 2026
@kalbasit
kalbasit enabled auto-merge (squash) March 18, 2026 23:46
@kalbasit
kalbasit merged commit 6f5471e into main Mar 18, 2026
20 of 27 checks passed
@kalbasit
kalbasit deleted the test-add-short-test-mode-support branch March 18, 2026 23:57
@codecov

codecov Bot commented Mar 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 5.04%. Comparing base (6a00f38) to head (5260965).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #1109   +/-   ##
=====================================
  Coverage   5.04%   5.04%           
=====================================
  Files          6       6           
  Lines        436     436           
=====================================
  Hits          22      22           
  Misses       410     410           
  Partials       4       4           

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go Pull requests that update go code size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant