Skip to content

Commit

Permalink
outline: Add support for "table" extension containers and specs (#758)
Browse files Browse the repository at this point in the history
* outline: Do not embed ginkgoNode in the outline struct

Although the outline struct did embed the ginkgoNode struct, I think embedding
does not make sense: The outline struct only needs a `Nodes` field, and does
not use the other fields of the ginkgoNode struct.

* outline: Import table extension in alias and nodot tests

Although the table extension isn't supported by outline, the import was left
out by mistake.

* outline: Refactor package name comparison

* outline: Add support for "table" extension containers and specs
  • Loading branch information
dlipovetsky authored Jan 3, 2021
1 parent 071c369 commit 6803cc3
Show file tree
Hide file tree
Showing 15 changed files with 132 additions and 75 deletions.
11 changes: 6 additions & 5 deletions ginkgo/outline/_testdata/alias_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package example_test

import (
fooginkgo "github.com/onsi/ginkgo"
footable "github.com/onsi/ginkgo/extensions/table"
)

var _ = fooginkgo.Describe("NodotFixture", func() {
Expand Down Expand Up @@ -33,17 +34,17 @@ var _ = fooginkgo.Describe("NodotFixture", func() {

})

fooginkgo.Measure("normal", func(b Benchmarker) {
fooginkgo.Measure("normal", func(b fooginkgo.Benchmarker) {

}, 2)

fooginkgo.DescribeTable("normal",
footable.DescribeTable("normal",
func() {},
fooginkgo.Entry("normal"),
footable.Entry("normal"),
)

fooginkgo.DescribeTable("normal",
footable.DescribeTable("normal",
func() {},
fooginkgo.Entry("normal"),
footable.Entry("normal"),
)
})
28 changes: 16 additions & 12 deletions ginkgo/outline/_testdata/alias_test.go.csv
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
Name,Text,Start,End,Spec,Focused,Pending
Describe,NodotFixture,79,728,false,false,false
Describe,normal,124,257,false,false,false
It,normal,164,253,true,false,false
By,normal,199,221,false,false,false
By,normal,225,247,false,false,false
Context,normal,260,340,false,false,false
It,normal,299,336,true,false,false
When,normal,343,420,false,false,false
It,normal,379,416,true,false,false
It,normal,423,459,true,false,false
Specify,normal,462,503,true,false,false
Measure,normal,506,563,true,false,false
Describe,NodotFixture,131,786,false,false,false
Describe,normal,176,309,false,false,false
It,normal,216,305,true,false,false
By,normal,251,273,false,false,false
By,normal,277,299,false,false,false
Context,normal,312,392,false,false,false
It,normal,351,388,true,false,false
When,normal,395,472,false,false,false
It,normal,431,468,true,false,false
It,normal,475,511,true,false,false
Specify,normal,514,555,true,false,false
Measure,normal,558,625,true,false,false
DescribeTable,normal,628,704,false,false,false
Entry,normal,676,700,true,false,false
DescribeTable,normal,707,783,false,false,false
Entry,normal,755,779,true,false,false
2 changes: 1 addition & 1 deletion ginkgo/outline/_testdata/alias_test.go.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"name":"Describe","text":"NodotFixture","start":79,"end":728,"spec":false,"focused":false,"pending":false,"nodes":[{"name":"Describe","text":"normal","start":124,"end":257,"spec":false,"focused":false,"pending":false,"nodes":[{"name":"It","text":"normal","start":164,"end":253,"spec":true,"focused":false,"pending":false,"nodes":[{"name":"By","text":"normal","start":199,"end":221,"spec":false,"focused":false,"pending":false},{"name":"By","text":"normal","start":225,"end":247,"spec":false,"focused":false,"pending":false}]}]},{"name":"Context","text":"normal","start":260,"end":340,"spec":false,"focused":false,"pending":false,"nodes":[{"name":"It","text":"normal","start":299,"end":336,"spec":true,"focused":false,"pending":false}]},{"name":"When","text":"normal","start":343,"end":420,"spec":false,"focused":false,"pending":false,"nodes":[{"name":"It","text":"normal","start":379,"end":416,"spec":true,"focused":false,"pending":false}]},{"name":"It","text":"normal","start":423,"end":459,"spec":true,"focused":false,"pending":false},{"name":"Specify","text":"normal","start":462,"end":503,"spec":true,"focused":false,"pending":false},{"name":"Measure","text":"normal","start":506,"end":563,"spec":true,"focused":false,"pending":false}]}]
[{"name":"Describe","text":"NodotFixture","start":131,"end":786,"spec":false,"focused":false,"pending":false,"nodes":[{"name":"Describe","text":"normal","start":176,"end":309,"spec":false,"focused":false,"pending":false,"nodes":[{"name":"It","text":"normal","start":216,"end":305,"spec":true,"focused":false,"pending":false,"nodes":[{"name":"By","text":"normal","start":251,"end":273,"spec":false,"focused":false,"pending":false},{"name":"By","text":"normal","start":277,"end":299,"spec":false,"focused":false,"pending":false}]}]},{"name":"Context","text":"normal","start":312,"end":392,"spec":false,"focused":false,"pending":false,"nodes":[{"name":"It","text":"normal","start":351,"end":388,"spec":true,"focused":false,"pending":false}]},{"name":"When","text":"normal","start":395,"end":472,"spec":false,"focused":false,"pending":false,"nodes":[{"name":"It","text":"normal","start":431,"end":468,"spec":true,"focused":false,"pending":false}]},{"name":"It","text":"normal","start":475,"end":511,"spec":true,"focused":false,"pending":false},{"name":"Specify","text":"normal","start":514,"end":555,"spec":true,"focused":false,"pending":false},{"name":"Measure","text":"normal","start":558,"end":625,"spec":true,"focused":false,"pending":false},{"name":"DescribeTable","text":"normal","start":628,"end":704,"spec":false,"focused":false,"pending":false,"nodes":[{"name":"Entry","text":"normal","start":676,"end":700,"spec":true,"focused":false,"pending":false}]},{"name":"DescribeTable","text":"normal","start":707,"end":783,"spec":false,"focused":false,"pending":false,"nodes":[{"name":"Entry","text":"normal","start":755,"end":779,"spec":true,"focused":false,"pending":false}]}]}]
4 changes: 4 additions & 0 deletions ginkgo/outline/_testdata/focused_test.go.csv
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ It,focused,342,370,true,true,false
FIt,focused,377,405,true,true,false
FSpecify,focused,408,441,true,true,false
FMeasure,focused,444,493,true,true,false
FDescribeTable,focused,496,557,false,true,false
Entry,focused,537,553,true,true,false
DescribeTable,focused,560,621,false,false,false
FEntry,focused,600,617,true,true,false
2 changes: 1 addition & 1 deletion ginkgo/outline/_testdata/focused_test.go.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"name":"Describe","text":"unfocused","start":116,"end":624,"spec":false,"focused":false,"pending":false,"nodes":[{"name":"FDescribe","text":"focused","start":148,"end":245,"spec":false,"focused":true,"pending":false,"nodes":[{"name":"It","text":"focused","start":180,"end":241,"spec":true,"focused":true,"pending":false,"nodes":[{"name":"By","text":"focused","start":206,"end":219,"spec":false,"focused":true,"pending":false},{"name":"By","text":"focused","start":223,"end":236,"spec":false,"focused":true,"pending":false}]}]},{"name":"FContext","text":"focused","start":248,"end":311,"spec":false,"focused":true,"pending":false,"nodes":[{"name":"It","text":"focused","start":279,"end":307,"spec":true,"focused":true,"pending":false}]},{"name":"FWhen","text":"focused","start":314,"end":374,"spec":false,"focused":true,"pending":false,"nodes":[{"name":"It","text":"focused","start":342,"end":370,"spec":true,"focused":true,"pending":false}]},{"name":"FIt","text":"focused","start":377,"end":405,"spec":true,"focused":true,"pending":false},{"name":"FSpecify","text":"focused","start":408,"end":441,"spec":true,"focused":true,"pending":false},{"name":"FMeasure","text":"focused","start":444,"end":493,"spec":true,"focused":true,"pending":false}]}]
[{"name":"Describe","text":"unfocused","start":116,"end":624,"spec":false,"focused":false,"pending":false,"nodes":[{"name":"FDescribe","text":"focused","start":148,"end":245,"spec":false,"focused":true,"pending":false,"nodes":[{"name":"It","text":"focused","start":180,"end":241,"spec":true,"focused":true,"pending":false,"nodes":[{"name":"By","text":"focused","start":206,"end":219,"spec":false,"focused":true,"pending":false},{"name":"By","text":"focused","start":223,"end":236,"spec":false,"focused":true,"pending":false}]}]},{"name":"FContext","text":"focused","start":248,"end":311,"spec":false,"focused":true,"pending":false,"nodes":[{"name":"It","text":"focused","start":279,"end":307,"spec":true,"focused":true,"pending":false}]},{"name":"FWhen","text":"focused","start":314,"end":374,"spec":false,"focused":true,"pending":false,"nodes":[{"name":"It","text":"focused","start":342,"end":370,"spec":true,"focused":true,"pending":false}]},{"name":"FIt","text":"focused","start":377,"end":405,"spec":true,"focused":true,"pending":false},{"name":"FSpecify","text":"focused","start":408,"end":441,"spec":true,"focused":true,"pending":false},{"name":"FMeasure","text":"focused","start":444,"end":493,"spec":true,"focused":true,"pending":false},{"name":"FDescribeTable","text":"focused","start":496,"end":557,"spec":false,"focused":true,"pending":false,"nodes":[{"name":"Entry","text":"focused","start":537,"end":553,"spec":true,"focused":true,"pending":false}]},{"name":"DescribeTable","text":"focused","start":560,"end":621,"spec":false,"focused":false,"pending":false,"nodes":[{"name":"FEntry","text":"focused","start":600,"end":617,"spec":true,"focused":true,"pending":false}]}]}]
11 changes: 6 additions & 5 deletions ginkgo/outline/_testdata/nodot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package example_test

import (
"github.com/onsi/ginkgo"
"github.com/onsi/ginkgo/extensions/table"
)

var _ = ginkgo.Describe("NodotFixture", func() {
Expand Down Expand Up @@ -32,17 +33,17 @@ var _ = ginkgo.Describe("NodotFixture", func() {

})

ginkgo.Measure("normal", func(b Benchmarker) {
ginkgo.Measure("normal", func(b ginkgo.Benchmarker) {

}, 2)

ginkgo.DescribeTable("normal",
table.DescribeTable("normal",
func() {},
ginkgo.Entry("normal"),
table.Entry("normal"),
)

ginkgo.DescribeTable("normal",
table.DescribeTable("normal",
func() {},
ginkgo.Entry("normal"),
table.Entry("normal"),
)
})
28 changes: 16 additions & 12 deletions ginkgo/outline/_testdata/nodot_test.go.csv
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
Name,Text,Start,End,Spec,Focused,Pending
Describe,NodotFixture,69,669,false,false,false
Describe,normal,111,231,false,false,false
It,normal,148,227,true,false,false
By,normal,180,199,false,false,false
By,normal,203,222,false,false,false
Context,normal,234,308,false,false,false
It,normal,270,304,true,false,false
When,normal,311,382,false,false,false
It,normal,344,378,true,false,false
It,normal,385,418,true,false,false
Specify,normal,421,459,true,false,false
Measure,normal,462,516,true,false,false
Describe,NodotFixture,112,715,false,false,false
Describe,normal,154,274,false,false,false
It,normal,191,270,true,false,false
By,normal,223,242,false,false,false
By,normal,246,265,false,false,false
Context,normal,277,351,false,false,false
It,normal,313,347,true,false,false
When,normal,354,425,false,false,false
It,normal,387,421,true,false,false
It,normal,428,461,true,false,false
Specify,normal,464,502,true,false,false
Measure,normal,505,566,true,false,false
DescribeTable,normal,569,639,false,false,false
Entry,normal,614,635,true,false,false
DescribeTable,normal,642,712,false,false,false
Entry,normal,687,708,true,false,false
2 changes: 1 addition & 1 deletion ginkgo/outline/_testdata/nodot_test.go.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"name":"Describe","text":"NodotFixture","start":69,"end":669,"spec":false,"focused":false,"pending":false,"nodes":[{"name":"Describe","text":"normal","start":111,"end":231,"spec":false,"focused":false,"pending":false,"nodes":[{"name":"It","text":"normal","start":148,"end":227,"spec":true,"focused":false,"pending":false,"nodes":[{"name":"By","text":"normal","start":180,"end":199,"spec":false,"focused":false,"pending":false},{"name":"By","text":"normal","start":203,"end":222,"spec":false,"focused":false,"pending":false}]}]},{"name":"Context","text":"normal","start":234,"end":308,"spec":false,"focused":false,"pending":false,"nodes":[{"name":"It","text":"normal","start":270,"end":304,"spec":true,"focused":false,"pending":false}]},{"name":"When","text":"normal","start":311,"end":382,"spec":false,"focused":false,"pending":false,"nodes":[{"name":"It","text":"normal","start":344,"end":378,"spec":true,"focused":false,"pending":false}]},{"name":"It","text":"normal","start":385,"end":418,"spec":true,"focused":false,"pending":false},{"name":"Specify","text":"normal","start":421,"end":459,"spec":true,"focused":false,"pending":false},{"name":"Measure","text":"normal","start":462,"end":516,"spec":true,"focused":false,"pending":false}]}]
[{"name":"Describe","text":"NodotFixture","start":112,"end":715,"spec":false,"focused":false,"pending":false,"nodes":[{"name":"Describe","text":"normal","start":154,"end":274,"spec":false,"focused":false,"pending":false,"nodes":[{"name":"It","text":"normal","start":191,"end":270,"spec":true,"focused":false,"pending":false,"nodes":[{"name":"By","text":"normal","start":223,"end":242,"spec":false,"focused":false,"pending":false},{"name":"By","text":"normal","start":246,"end":265,"spec":false,"focused":false,"pending":false}]}]},{"name":"Context","text":"normal","start":277,"end":351,"spec":false,"focused":false,"pending":false,"nodes":[{"name":"It","text":"normal","start":313,"end":347,"spec":true,"focused":false,"pending":false}]},{"name":"When","text":"normal","start":354,"end":425,"spec":false,"focused":false,"pending":false,"nodes":[{"name":"It","text":"normal","start":387,"end":421,"spec":true,"focused":false,"pending":false}]},{"name":"It","text":"normal","start":428,"end":461,"spec":true,"focused":false,"pending":false},{"name":"Specify","text":"normal","start":464,"end":502,"spec":true,"focused":false,"pending":false},{"name":"Measure","text":"normal","start":505,"end":566,"spec":true,"focused":false,"pending":false},{"name":"DescribeTable","text":"normal","start":569,"end":639,"spec":false,"focused":false,"pending":false,"nodes":[{"name":"Entry","text":"normal","start":614,"end":635,"spec":true,"focused":false,"pending":false}]},{"name":"DescribeTable","text":"normal","start":642,"end":712,"spec":false,"focused":false,"pending":false,"nodes":[{"name":"Entry","text":"normal","start":687,"end":708,"spec":true,"focused":false,"pending":false}]}]}]
4 changes: 4 additions & 0 deletions ginkgo/outline/_testdata/normal_test.go.csv
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ It,normal,336,363,true,false,false
It,normal,370,396,true,false,false
Specify,normal,399,430,true,false,false
Measure,normal,433,480,true,false,false
DescribeTable,normal,483,541,false,false,false
Entry,normal,522,537,true,false,false
DescribeTable,normal,544,602,false,false,false
Entry,normal,583,598,true,false,false
2 changes: 1 addition & 1 deletion ginkgo/outline/_testdata/normal_test.go.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"name":"Describe","text":"NormalFixture","start":116,"end":605,"spec":false,"focused":false,"pending":false,"nodes":[{"name":"Describe","text":"normal","start":152,"end":244,"spec":false,"focused":false,"pending":false,"nodes":[{"name":"It","text":"normal","start":182,"end":240,"spec":true,"focused":false,"pending":false,"nodes":[{"name":"By","text":"step 1","start":207,"end":219,"spec":false,"focused":false,"pending":false},{"name":"By","text":"step 2","start":223,"end":235,"spec":false,"focused":false,"pending":false}]}]},{"name":"Context","text":"normal","start":247,"end":307,"spec":false,"focused":false,"pending":false,"nodes":[{"name":"It","text":"normal","start":276,"end":303,"spec":true,"focused":false,"pending":false}]},{"name":"When","text":"normal","start":310,"end":367,"spec":false,"focused":false,"pending":false,"nodes":[{"name":"It","text":"normal","start":336,"end":363,"spec":true,"focused":false,"pending":false}]},{"name":"It","text":"normal","start":370,"end":396,"spec":true,"focused":false,"pending":false},{"name":"Specify","text":"normal","start":399,"end":430,"spec":true,"focused":false,"pending":false},{"name":"Measure","text":"normal","start":433,"end":480,"spec":true,"focused":false,"pending":false}]}]
[{"name":"Describe","text":"NormalFixture","start":116,"end":605,"spec":false,"focused":false,"pending":false,"nodes":[{"name":"Describe","text":"normal","start":152,"end":244,"spec":false,"focused":false,"pending":false,"nodes":[{"name":"It","text":"normal","start":182,"end":240,"spec":true,"focused":false,"pending":false,"nodes":[{"name":"By","text":"step 1","start":207,"end":219,"spec":false,"focused":false,"pending":false},{"name":"By","text":"step 2","start":223,"end":235,"spec":false,"focused":false,"pending":false}]}]},{"name":"Context","text":"normal","start":247,"end":307,"spec":false,"focused":false,"pending":false,"nodes":[{"name":"It","text":"normal","start":276,"end":303,"spec":true,"focused":false,"pending":false}]},{"name":"When","text":"normal","start":310,"end":367,"spec":false,"focused":false,"pending":false,"nodes":[{"name":"It","text":"normal","start":336,"end":363,"spec":true,"focused":false,"pending":false}]},{"name":"It","text":"normal","start":370,"end":396,"spec":true,"focused":false,"pending":false},{"name":"Specify","text":"normal","start":399,"end":430,"spec":true,"focused":false,"pending":false},{"name":"Measure","text":"normal","start":433,"end":480,"spec":true,"focused":false,"pending":false},{"name":"DescribeTable","text":"normal","start":483,"end":541,"spec":false,"focused":false,"pending":false,"nodes":[{"name":"Entry","text":"normal","start":522,"end":537,"spec":true,"focused":false,"pending":false}]},{"name":"DescribeTable","text":"normal","start":544,"end":602,"spec":false,"focused":false,"pending":false,"nodes":[{"name":"Entry","text":"normal","start":583,"end":598,"spec":true,"focused":false,"pending":false}]}]}]
4 changes: 4 additions & 0 deletions ginkgo/outline/_testdata/pending_test.go.csv
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ It,pending,347,375,true,false,true
PIt,pending,382,410,true,false,true
PSpecify,pending,413,446,true,false,true
PMeasure,pending,449,498,true,false,true
PDescribeTable,pending,501,562,false,false,true
Entry,pending,542,558,true,false,true
DescribeTable,pending,565,626,false,false,false
PEntry,pending,605,622,true,false,true
2 changes: 1 addition & 1 deletion ginkgo/outline/_testdata/pending_test.go.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"name":"Describe","text":"PendingFixture","start":116,"end":629,"spec":false,"focused":false,"pending":false,"nodes":[{"name":"PDescribe","text":"pending","start":153,"end":250,"spec":false,"focused":false,"pending":true,"nodes":[{"name":"It","text":"pending","start":185,"end":246,"spec":true,"focused":false,"pending":true,"nodes":[{"name":"By","text":"pending","start":211,"end":224,"spec":false,"focused":false,"pending":true},{"name":"By","text":"pending","start":228,"end":241,"spec":false,"focused":false,"pending":true}]}]},{"name":"PContext","text":"pending","start":253,"end":316,"spec":false,"focused":false,"pending":true,"nodes":[{"name":"It","text":"pending","start":284,"end":312,"spec":true,"focused":false,"pending":true}]},{"name":"PWhen","text":"pending","start":319,"end":379,"spec":false,"focused":false,"pending":true,"nodes":[{"name":"It","text":"pending","start":347,"end":375,"spec":true,"focused":false,"pending":true}]},{"name":"PIt","text":"pending","start":382,"end":410,"spec":true,"focused":false,"pending":true},{"name":"PSpecify","text":"pending","start":413,"end":446,"spec":true,"focused":false,"pending":true},{"name":"PMeasure","text":"pending","start":449,"end":498,"spec":true,"focused":false,"pending":true}]}]
[{"name":"Describe","text":"PendingFixture","start":116,"end":629,"spec":false,"focused":false,"pending":false,"nodes":[{"name":"PDescribe","text":"pending","start":153,"end":250,"spec":false,"focused":false,"pending":true,"nodes":[{"name":"It","text":"pending","start":185,"end":246,"spec":true,"focused":false,"pending":true,"nodes":[{"name":"By","text":"pending","start":211,"end":224,"spec":false,"focused":false,"pending":true},{"name":"By","text":"pending","start":228,"end":241,"spec":false,"focused":false,"pending":true}]}]},{"name":"PContext","text":"pending","start":253,"end":316,"spec":false,"focused":false,"pending":true,"nodes":[{"name":"It","text":"pending","start":284,"end":312,"spec":true,"focused":false,"pending":true}]},{"name":"PWhen","text":"pending","start":319,"end":379,"spec":false,"focused":false,"pending":true,"nodes":[{"name":"It","text":"pending","start":347,"end":375,"spec":true,"focused":false,"pending":true}]},{"name":"PIt","text":"pending","start":382,"end":410,"spec":true,"focused":false,"pending":true},{"name":"PSpecify","text":"pending","start":413,"end":446,"spec":true,"focused":false,"pending":true},{"name":"PMeasure","text":"pending","start":449,"end":498,"spec":true,"focused":false,"pending":true},{"name":"PDescribeTable","text":"pending","start":501,"end":562,"spec":false,"focused":false,"pending":true,"nodes":[{"name":"Entry","text":"pending","start":542,"end":558,"spec":true,"focused":false,"pending":true}]},{"name":"DescribeTable","text":"pending","start":565,"end":626,"spec":false,"focused":false,"pending":false,"nodes":[{"name":"PEntry","text":"pending","start":605,"end":622,"spec":true,"focused":false,"pending":true}]}]}]
Loading

0 comments on commit 6803cc3

Please sign in to comment.