-
-
Notifications
You must be signed in to change notification settings - Fork 667
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make unfocus ("blur") much faster (#674)
- Existing implementation used `gofmt` with a rule (`-r`) to sequentially remove each type of focus - Existing implementation would ignore `vendor` directories at the top level, but not subdirectories - New implementation parses all Go files and looks for calls to focus functions. If it finds them, it records their position and removes the `F` byte from each function call to remove the focus - This approach was found to be 30 times faster on a test repo
- Loading branch information
Showing
4 changed files
with
239 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
integration/_fixtures/focused_fixture/internal/focused_fixture_suite_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package focused_fixture_test | ||
|
||
import ( | ||
. "github.com/onsi/ginkgo" | ||
. "github.com/onsi/gomega" | ||
|
||
"testing" | ||
) | ||
|
||
func TestFocused_fixture(t *testing.T) { | ||
RegisterFailHandler(Fail) | ||
RunSpecs(t, "Focused_fixture Suite") | ||
} |
73 changes: 73 additions & 0 deletions
73
integration/_fixtures/focused_fixture/internal/focused_fixture_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
package focused_fixture_test | ||
|
||
import ( | ||
. "github.com/onsi/ginkgo" | ||
. "github.com/onsi/ginkgo/extensions/table" | ||
) | ||
|
||
var _ = Describe("FocusedFixture", func() { | ||
FDescribe("focused", func() { | ||
It("focused", func() { | ||
|
||
}) | ||
}) | ||
|
||
FContext("focused", func() { | ||
It("focused", func() { | ||
|
||
}) | ||
}) | ||
|
||
FWhen("focused", func() { | ||
It("focused", func() { | ||
|
||
}) | ||
}) | ||
|
||
FIt("focused", func() { | ||
|
||
}) | ||
|
||
FSpecify("focused", func() { | ||
|
||
}) | ||
|
||
FMeasure("focused", func(b Benchmarker) { | ||
|
||
}, 2) | ||
|
||
FDescribeTable("focused", | ||
func() {}, | ||
Entry("focused"), | ||
) | ||
|
||
DescribeTable("focused", | ||
func() {}, | ||
FEntry("focused"), | ||
) | ||
|
||
Describe("not focused", func() { | ||
It("not focused", func() { | ||
|
||
}) | ||
}) | ||
|
||
Context("not focused", func() { | ||
It("not focused", func() { | ||
|
||
}) | ||
}) | ||
|
||
It("not focused", func() { | ||
|
||
}) | ||
|
||
Measure("not focused", func(b Benchmarker) { | ||
|
||
}, 2) | ||
|
||
DescribeTable("not focused", | ||
func() {}, | ||
Entry("not focused"), | ||
) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters