Skip to content

A tool to test go packages based on your local changes according to git

License

Notifications You must be signed in to change notification settings

fisherevans/gogitest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

gogitest

gogitest (/go-gee-test/), originally from "Go Git Test" (due to the melding of git and go commands).

This tool tries to solve one problem: make it easier to test local go changes without having to "test the world".

In large projects with many dependencies, changing a single file can result in many compilation and test failures in other local dependent packages. gogitest detects your changes with git, looks for packages that may depend on those changes, and tests them all for you. No more hunting down dependencies manually, games of ping pong against your CI test suite, or waiting for 30 minutes while the full test suite runs locally (which still fails due to unrelated environment issues).

Just run gogitest.

Install

Clone this repo, then add the ./bin folder to your $PATH:

cd ~/git
git clone [email protected]:fisherevans/gogitest.git
export PATH="$PATH:$HOME/git/gogitest/bin"

You will need to have go and git installed.

Examples

Check out gogitest -help for all available options and arguments. The command will not make any change to your filesystem.

  • gogitest

    • Detect all changes (staged and unstaged) compared to the merge base of the main development branch.
    • Find all packages that might depend on the changed (by naively looking for references to the fully qualified package import name).
    • go test all discovered packages.
  • gogitest -match http -- -args integration

    • Only test and inspect packages with http within the fully qualified name.
    • Pass in -args integration to go test.
  • gogitest -local

    • When detecting changes, compare your current filesystem to the origin of the current branch.
  • gogitest -nodeps -base some-non/prod-branch

    • Skip package dependency detection, just test the modified packages.
    • Detect the merge base of some-non/prod-branch instead of the main development branch.
  • gogitest -build -ignore kafka 'native$'

    • Only build the impacted packages and their tests without running them.
    • Ignore any packages with kafka anywhere inside the fully qualified import reference.
    • Ignore any packages with native at the end of the fully qualified import reference.

About

A tool to test go packages based on your local changes according to git

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages