summaryrefslogtreecommitdiff
path: root/vendor/github.com/onsi/ginkgo
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/onsi/ginkgo')
-rw-r--r--vendor/github.com/onsi/ginkgo/.travis.yml8
-rw-r--r--vendor/github.com/onsi/ginkgo/CHANGELOG.md11
-rw-r--r--vendor/github.com/onsi/ginkgo/config/config.go2
-rw-r--r--vendor/github.com/onsi/ginkgo/extensions/table/table_suite_test.go13
-rw-r--r--vendor/github.com/onsi/ginkgo/extensions/table/table_test.go64
-rw-r--r--vendor/github.com/onsi/ginkgo/ginkgo/generate_command.go14
-rw-r--r--vendor/github.com/onsi/ginkgo/ginkgo/nodot/nodot_suite_test.go92
-rw-r--r--vendor/github.com/onsi/ginkgo/ginkgo/nodot/nodot_test.go82
-rw-r--r--vendor/github.com/onsi/ginkgo/ginkgo/run_watch_and_build_command_flags.go2
-rw-r--r--vendor/github.com/onsi/ginkgo/ginkgo/testrunner/test_runner.go2
-rw-r--r--vendor/github.com/onsi/ginkgo/ginkgo/testrunner/test_runner_test.go60
-rw-r--r--vendor/github.com/onsi/ginkgo/ginkgo/testsuite/testsuite_suite_test.go13
-rw-r--r--vendor/github.com/onsi/ginkgo/ginkgo/testsuite/testsuite_test.go212
-rw-r--r--vendor/github.com/onsi/ginkgo/ginkgo/testsuite/vendor_check_go15_test.go201
-rw-r--r--vendor/github.com/onsi/ginkgo/ginkgo_dsl.go4
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/first_package/coverage.go21
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/first_package/coverage_fixture_suite_test.go13
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/first_package/coverage_fixture_test.go31
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/first_package/external_coverage_fixture/external_coverage.go9
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/second_package/coverage.go21
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/second_package/coverage_fixture_suite_test.go13
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/second_package/coverage_fixture_test.go29
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_fixtures/extra_functions_test.go14
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_fixtures/nested/nested_test.go10
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_fixtures/nested_without_gofiles/subpackage/nested_subpackage_test.go9
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_fixtures/outside_package_test.go16
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_fixtures/xunit_test.go41
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/extra_functions_test.go17
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/fixtures_suite_test.go13
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/nested_subpackage_test.go11
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/nested_suite_test.go13
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/nested_test.go13
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/outside_package_test.go19
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/suite_test.go13
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/xunit_test.go44
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/coverage_fixture/coverage.go25
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/coverage_fixture/coverage_fixture_suite_test.go13
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/coverage_fixture/coverage_fixture_test.go31
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/coverage_fixture/external_coverage_fixture/external_coverage.go9
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/debug_parallel_fixture/debug_parallel_fixture_suite_test.go13
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/debug_parallel_fixture/debug_parallel_fixture_test.go18
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/does_not_compile/does_not_compile_suite_test.go13
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/does_not_compile/does_not_compile_test.go11
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/eventually_failing/eventually_failing_suite_test.go13
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/eventually_failing/eventually_failing_test.go29
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/exiting_synchronized_setup_tests/exiting_synchronized_setup_tests_suite_test.go35
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/fail_fixture/fail_fixture_suite_test.go13
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/fail_fixture/fail_fixture_test.go103
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_after_suite/failing_after_suite_suite_test.go22
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_after_suite/failing_after_suite_test.go15
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_before_suite/failing_before_suite_suite_test.go22
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_before_suite/failing_before_suite_test.go15
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_ginkgo_tests/failing_ginkgo_tests.go5
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_ginkgo_tests/failing_ginkgo_tests_suite_test.go13
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_ginkgo_tests/failing_ginkgo_tests_test.go17
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/flags_tests/flags.go9
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/flags_tests/flags_suite_test.go13
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/flags_tests/flags_test.go97
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/focused_fixture/README.md1
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/focused_fixture/focused_fixture_suite_test.go13
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/focused_fixture/focused_fixture_test.go73
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/focused_fixture_with_vendor/focused_fixture_suite_test.go13
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/focused_fixture_with_vendor/focused_fixture_test.go73
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/hanging_suite/hanging_suite_suite_test.go13
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/hanging_suite/hanging_suite_test.go30
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/more_ginkgo_tests/more_ginkgo_tests.go5
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/more_ginkgo_tests/more_ginkgo_tests_suite_test.go13
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/more_ginkgo_tests/more_ginkgo_tests_test.go17
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/no_test_fn/no_test_fn.go5
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/no_test_fn/no_test_fn_test.go13
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/no_tests/no_tests.go4
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/passing_ginkgo_tests/passing_ginkgo_tests.go9
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/passing_ginkgo_tests/passing_ginkgo_tests_suite_test.go13
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/passing_ginkgo_tests/passing_ginkgo_tests_test.go30
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/passing_suite_setup/passing_suite_setup_suite_test.go26
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/passing_suite_setup/passing_suite_test.go28
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/progress_fixture/progress_fixture_suite_test.go13
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/progress_fixture/progress_fixture_test.go49
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/skip_fixture/skip_fixture_suite_test.go13
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/skip_fixture/skip_fixture_test.go71
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/suite_command_tests/suite_command.go9
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/suite_command_tests/suite_command_suite_test.go13
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/suite_command_tests/suite_command_test.go18
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/synchronized_setup_tests/synchronized_setup_tests_suite_test.go43
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/tags_tests/ignored_test.go17
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/tags_tests/tags_tests_suite_test.go13
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/tags_tests/tags_tests_test.go11
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/test_description/test_description_suite_test.go13
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/test_description/test_description_test.go23
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/A/A.go7
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/A/A_suite_test.go13
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/A/A_test.go14
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/B/B.go7
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/B/B_suite_test.go13
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/B/B_test.go14
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/C/C.go5
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/C/C.json3
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/C/C_suite_test.go13
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/C/C_test.go14
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/D/D.go7
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/D/D_suite_test.go13
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/D/D_test.go14
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/xunit_tests/xunit_tests.go5
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/_fixtures/xunit_tests/xunit_tests_test.go11
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/convert_test.go121
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/coverage_test.go147
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/fail_test.go55
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/flags_test.go237
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/integration.go1
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/integration_suite_test.go129
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/interrupt_test.go51
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/precompiled_test.go53
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/progress_test.go94
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/run_test.go483
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/skip_test.go43
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/subcommand_test.go419
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/suite_command_test.go63
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/suite_setup_test.go178
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/tags_test.go27
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/test_description_test.go25
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/verbose_and_succinct_test.go90
-rw-r--r--vendor/github.com/onsi/ginkgo/integration/watch_test.go275
-rw-r--r--vendor/github.com/onsi/ginkgo/internal/codelocation/code_location_suite_test.go13
-rw-r--r--vendor/github.com/onsi/ginkgo/internal/codelocation/code_location_test.go80
-rw-r--r--vendor/github.com/onsi/ginkgo/internal/containernode/container_node_suite_test.go13
-rw-r--r--vendor/github.com/onsi/ginkgo/internal/containernode/container_node_test.go213
-rw-r--r--vendor/github.com/onsi/ginkgo/internal/failer/failer_suite_test.go13
-rw-r--r--vendor/github.com/onsi/ginkgo/internal/failer/failer_test.go141
-rw-r--r--vendor/github.com/onsi/ginkgo/internal/leafnodes/it_node_test.go22
-rw-r--r--vendor/github.com/onsi/ginkgo/internal/leafnodes/leaf_node_suite_test.go13
-rw-r--r--vendor/github.com/onsi/ginkgo/internal/leafnodes/measure_node_test.go155
-rw-r--r--vendor/github.com/onsi/ginkgo/internal/leafnodes/setup_nodes_test.go48
-rw-r--r--vendor/github.com/onsi/ginkgo/internal/leafnodes/shared_runner_test.go353
-rw-r--r--vendor/github.com/onsi/ginkgo/internal/leafnodes/suite_nodes_test.go230
-rw-r--r--vendor/github.com/onsi/ginkgo/internal/leafnodes/synchronized_after_suite_node_test.go199
-rw-r--r--vendor/github.com/onsi/ginkgo/internal/leafnodes/synchronized_before_suite_node_test.go446
-rw-r--r--vendor/github.com/onsi/ginkgo/internal/remote/aggregator_test.go315
-rw-r--r--vendor/github.com/onsi/ginkgo/internal/remote/fake_output_interceptor_test.go22
-rw-r--r--vendor/github.com/onsi/ginkgo/internal/remote/fake_poster_test.go33
-rw-r--r--vendor/github.com/onsi/ginkgo/internal/remote/forwarding_reporter_test.go181
-rw-r--r--vendor/github.com/onsi/ginkgo/internal/remote/remote_suite_test.go13
-rw-r--r--vendor/github.com/onsi/ginkgo/internal/remote/server_test.go269
-rw-r--r--vendor/github.com/onsi/ginkgo/internal/spec/spec_suite_test.go13
-rw-r--r--vendor/github.com/onsi/ginkgo/internal/spec/spec_test.go739
-rw-r--r--vendor/github.com/onsi/ginkgo/internal/spec/specs.go45
-rw-r--r--vendor/github.com/onsi/ginkgo/internal/spec/specs_test.go287
-rw-r--r--vendor/github.com/onsi/ginkgo/internal/spec_iterator/index_computer_test.go149
-rw-r--r--vendor/github.com/onsi/ginkgo/internal/spec_iterator/parallel_spec_iterator_test.go112
-rw-r--r--vendor/github.com/onsi/ginkgo/internal/spec_iterator/serial_spec_iterator_test.go64
-rw-r--r--vendor/github.com/onsi/ginkgo/internal/spec_iterator/sharded_parallel_spec_iterator_test.go62
-rw-r--r--vendor/github.com/onsi/ginkgo/internal/spec_iterator/spec_iterator_suite_test.go13
-rw-r--r--vendor/github.com/onsi/ginkgo/internal/specrunner/spec_runner_suite_test.go13
-rw-r--r--vendor/github.com/onsi/ginkgo/internal/specrunner/spec_runner_test.go785
-rw-r--r--vendor/github.com/onsi/ginkgo/internal/suite/suite_suite_test.go35
-rw-r--r--vendor/github.com/onsi/ginkgo/internal/suite/suite_test.go385
-rw-r--r--vendor/github.com/onsi/ginkgo/internal/writer/writer_suite_test.go13
-rw-r--r--vendor/github.com/onsi/ginkgo/internal/writer/writer_test.go75
-rw-r--r--vendor/github.com/onsi/ginkgo/reporters/default_reporter_test.go433
-rw-r--r--vendor/github.com/onsi/ginkgo/reporters/junit_reporter_test.go258
-rw-r--r--vendor/github.com/onsi/ginkgo/reporters/reporters_suite_test.go13
-rw-r--r--vendor/github.com/onsi/ginkgo/reporters/stenographer/support/README.md6
-rw-r--r--vendor/github.com/onsi/ginkgo/reporters/teamcity_reporter_test.go214
-rw-r--r--vendor/github.com/onsi/ginkgo/types/types_suite_test.go13
-rw-r--r--vendor/github.com/onsi/ginkgo/types/types_test.go99
164 files changed, 64 insertions, 11567 deletions
diff --git a/vendor/github.com/onsi/ginkgo/.travis.yml b/vendor/github.com/onsi/ginkgo/.travis.yml
index 3900878bd..72e8ccf0b 100644
--- a/vendor/github.com/onsi/ginkgo/.travis.yml
+++ b/vendor/github.com/onsi/ginkgo/.travis.yml
@@ -1,11 +1,9 @@
language: go
go:
- - 1.6.x
- - 1.7.x
- - 1.8.x
- - 1.9.x
- 1.10.x
- 1.11.x
+ - 1.12.x
+ - tip
install:
- go get -v -t ./...
@@ -14,4 +12,4 @@ install:
- go install github.com/onsi/ginkgo/ginkgo
- export PATH=$PATH:$HOME/gopath/bin
-script: $HOME/gopath/bin/ginkgo -r --randomizeAllSpecs --randomizeSuites --race --trace && go vet
+script: $HOME/gopath/bin/ginkgo -r --randomizeAllSpecs --randomizeSuites --race --trace && go vet
diff --git a/vendor/github.com/onsi/ginkgo/CHANGELOG.md b/vendor/github.com/onsi/ginkgo/CHANGELOG.md
index d7d797017..4920406ae 100644
--- a/vendor/github.com/onsi/ginkgo/CHANGELOG.md
+++ b/vendor/github.com/onsi/ginkgo/CHANGELOG.md
@@ -1,3 +1,14 @@
+## 1.8.0
+
+### New Features
+- allow config of the vet flag for `go test` (#562) [3cd45fa]
+- Support projects using go modules [d56ee76]
+
+### Fixes and Minor Improvements
+- chore(godoc): fixes typos in Measurement funcs [dbaca8e]
+- Optimize focus to avoid allocations [f493786]
+- Ensure generated test file names are underscored [505cc35]
+
## 1.7.0
### New Features
diff --git a/vendor/github.com/onsi/ginkgo/config/config.go b/vendor/github.com/onsi/ginkgo/config/config.go
index 5e509313c..dab2a2470 100644
--- a/vendor/github.com/onsi/ginkgo/config/config.go
+++ b/vendor/github.com/onsi/ginkgo/config/config.go
@@ -20,7 +20,7 @@ import (
"fmt"
)
-const VERSION = "1.7.0"
+const VERSION = "1.8.0"
type GinkgoConfigType struct {
RandomSeed int64
diff --git a/vendor/github.com/onsi/ginkgo/extensions/table/table_suite_test.go b/vendor/github.com/onsi/ginkgo/extensions/table/table_suite_test.go
deleted file mode 100644
index f482ec3dc..000000000
--- a/vendor/github.com/onsi/ginkgo/extensions/table/table_suite_test.go
+++ /dev/null
@@ -1,13 +0,0 @@
-package table_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-
- "testing"
-)
-
-func TestTable(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "Table Suite")
-}
diff --git a/vendor/github.com/onsi/ginkgo/extensions/table/table_test.go b/vendor/github.com/onsi/ginkgo/extensions/table/table_test.go
deleted file mode 100644
index b008e432b..000000000
--- a/vendor/github.com/onsi/ginkgo/extensions/table/table_test.go
+++ /dev/null
@@ -1,64 +0,0 @@
-package table_test
-
-import (
- "strings"
-
- . "github.com/onsi/ginkgo/extensions/table"
-
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-)
-
-var _ = Describe("Table", func() {
- DescribeTable("a simple table",
- func(x int, y int, expected bool) {
- Ω(x > y).Should(Equal(expected))
- },
- Entry("x > y", 1, 0, true),
- Entry("x == y", 0, 0, false),
- Entry("x < y", 0, 1, false),
- )
-
- type ComplicatedThings struct {
- Superstructure string
- Substructure string
- Count int
- }
-
- DescribeTable("a more complicated table",
- func(c ComplicatedThings) {
- Ω(strings.Count(c.Superstructure, c.Substructure)).Should(BeNumerically("==", c.Count))
- },
- Entry("with no matching substructures", ComplicatedThings{
- Superstructure: "the sixth sheikh's sixth sheep's sick",
- Substructure: "emir",
- Count: 0,
- }),
- Entry("with one matching substructure", ComplicatedThings{
- Superstructure: "the sixth sheikh's sixth sheep's sick",
- Substructure: "sheep",
- Count: 1,
- }),
- Entry("with many matching substructures", ComplicatedThings{
- Superstructure: "the sixth sheikh's sixth sheep's sick",
- Substructure: "si",
- Count: 3,
- }),
- )
-
- PDescribeTable("a failure",
- func(value bool) {
- Ω(value).Should(BeFalse())
- },
- Entry("when true", true),
- Entry("when false", false),
- Entry("when malformed", 2),
- )
-
- DescribeTable("an untyped nil as an entry",
- func(x interface{}) {
- Expect(x).To(BeNil())
- },
- Entry("nil", nil),
- )
-})
diff --git a/vendor/github.com/onsi/ginkgo/ginkgo/generate_command.go b/vendor/github.com/onsi/ginkgo/ginkgo/generate_command.go
index 019fd2337..ad044303b 100644
--- a/vendor/github.com/onsi/ginkgo/ginkgo/generate_command.go
+++ b/vendor/github.com/onsi/ginkgo/ginkgo/generate_command.go
@@ -108,10 +108,8 @@ func generateSpec(args []string, agouti, noDot, internal bool) {
func generateSpecForSubject(subject string, agouti, noDot, internal bool) error {
packageName, specFilePrefix, formattedName := getPackageAndFormattedName()
if subject != "" {
- subject = strings.Split(subject, ".go")[0]
- subject = strings.Split(subject, "_test")[0]
- specFilePrefix = subject
- formattedName = prettifyPackageName(subject)
+ specFilePrefix = formatSubject(subject)
+ formattedName = prettifyPackageName(specFilePrefix)
}
data := specData{
@@ -152,6 +150,14 @@ func generateSpecForSubject(subject string, agouti, noDot, internal bool) error
return nil
}
+func formatSubject(name string) string {
+ name = strings.Replace(name, "-", "_", -1)
+ name = strings.Replace(name, " ", "_", -1)
+ name = strings.Split(name, ".go")[0]
+ name = strings.Split(name, "_test")[0]
+ return name
+}
+
func getPackageImportPath() string {
workingDir, err := os.Getwd()
if err != nil {
diff --git a/vendor/github.com/onsi/ginkgo/ginkgo/nodot/nodot_suite_test.go b/vendor/github.com/onsi/ginkgo/ginkgo/nodot/nodot_suite_test.go
deleted file mode 100644
index 72b733219..000000000
--- a/vendor/github.com/onsi/ginkgo/ginkgo/nodot/nodot_suite_test.go
+++ /dev/null
@@ -1,92 +0,0 @@
-package nodot_test
-
-import (
- "github.com/onsi/ginkgo"
- "github.com/onsi/gomega"
-
- "testing"
-)
-
-func TestNodot(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "Nodot Suite")
-}
-
-// Declarations for Ginkgo DSL
-type Done ginkgo.Done
-type Benchmarker ginkgo.Benchmarker
-
-var GinkgoWriter = ginkgo.GinkgoWriter
-var GinkgoParallelNode = ginkgo.GinkgoParallelNode
-var GinkgoT = ginkgo.GinkgoT
-var CurrentGinkgoTestDescription = ginkgo.CurrentGinkgoTestDescription
-var RunSpecs = ginkgo.RunSpecs
-var RunSpecsWithDefaultAndCustomReporters = ginkgo.RunSpecsWithDefaultAndCustomReporters
-var RunSpecsWithCustomReporters = ginkgo.RunSpecsWithCustomReporters
-var Fail = ginkgo.Fail
-var GinkgoRecover = ginkgo.GinkgoRecover
-var Describe = ginkgo.Describe
-var FDescribe = ginkgo.FDescribe
-var PDescribe = ginkgo.PDescribe
-var XDescribe = ginkgo.XDescribe
-var Context = ginkgo.Context
-var FContext = ginkgo.FContext
-var PContext = ginkgo.PContext
-var XContext = ginkgo.XContext
-var It = ginkgo.It
-var FIt = ginkgo.FIt
-var PIt = ginkgo.PIt
-var XIt = ginkgo.XIt
-var Measure = ginkgo.Measure
-var FMeasure = ginkgo.FMeasure
-var PMeasure = ginkgo.PMeasure
-var XMeasure = ginkgo.XMeasure
-var BeforeSuite = ginkgo.BeforeSuite
-var AfterSuite = ginkgo.AfterSuite
-var SynchronizedBeforeSuite = ginkgo.SynchronizedBeforeSuite
-var SynchronizedAfterSuite = ginkgo.SynchronizedAfterSuite
-var BeforeEach = ginkgo.BeforeEach
-var JustBeforeEach = ginkgo.JustBeforeEach
-var JustAfterEach = ginkgo.JustAfterEach
-var AfterEach = ginkgo.AfterEach
-
-// Declarations for Gomega DSL
-var RegisterFailHandler = gomega.RegisterFailHandler
-var RegisterTestingT = gomega.RegisterTestingT
-var InterceptGomegaFailures = gomega.InterceptGomegaFailures
-var Ω = gomega.Ω
-var Expect = gomega.Expect
-var ExpectWithOffset = gomega.ExpectWithOffset
-var Eventually = gomega.Eventually
-var EventuallyWithOffset = gomega.EventuallyWithOffset
-var Consistently = gomega.Consistently
-var ConsistentlyWithOffset = gomega.ConsistentlyWithOffset
-var SetDefaultEventuallyTimeout = gomega.SetDefaultEventuallyTimeout
-var SetDefaultEventuallyPollingInterval = gomega.SetDefaultEventuallyPollingInterval
-var SetDefaultConsistentlyDuration = gomega.SetDefaultConsistentlyDuration
-var SetDefaultConsistentlyPollingInterval = gomega.SetDefaultConsistentlyPollingInterval
-
-// Declarations for Gomega Matchers
-var Equal = gomega.Equal
-var BeEquivalentTo = gomega.BeEquivalentTo
-var BeNil = gomega.BeNil
-var BeTrue = gomega.BeTrue
-var BeFalse = gomega.BeFalse
-var HaveOccurred = gomega.HaveOccurred
-var MatchError = gomega.MatchError
-var BeClosed = gomega.BeClosed
-var Receive = gomega.Receive
-var MatchRegexp = gomega.MatchRegexp
-var ContainSubstring = gomega.ContainSubstring
-var MatchJSON = gomega.MatchJSON
-var BeEmpty = gomega.BeEmpty
-var HaveLen = gomega.HaveLen
-var BeZero = gomega.BeZero
-var ContainElement = gomega.ContainElement
-var ConsistOf = gomega.ConsistOf
-var HaveKey = gomega.HaveKey
-var HaveKeyWithValue = gomega.HaveKeyWithValue
-var BeNumerically = gomega.BeNumerically
-var BeTemporally = gomega.BeTemporally
-var BeAssignableToTypeOf = gomega.BeAssignableToTypeOf
-var Panic = gomega.Panic
diff --git a/vendor/github.com/onsi/ginkgo/ginkgo/nodot/nodot_test.go b/vendor/github.com/onsi/ginkgo/ginkgo/nodot/nodot_test.go
deleted file mode 100644
index 1470b7478..000000000
--- a/vendor/github.com/onsi/ginkgo/ginkgo/nodot/nodot_test.go
+++ /dev/null
@@ -1,82 +0,0 @@
-package nodot_test
-
-import (
- "strings"
-
- . "github.com/onsi/ginkgo/ginkgo/nodot"
-)
-
-var _ = Describe("ApplyNoDot", func() {
- var result string
-
- apply := func(input string) string {
- output, err := ApplyNoDot([]byte(input))
- Ω(err).ShouldNot(HaveOccurred())
- return string(output)
- }
-
- Context("when no declarations have been imported yet", func() {
- BeforeEach(func() {
- result = apply("")
- })
-
- It("should add headings for the various declarations", func() {
- Ω(result).Should(ContainSubstring("// Declarations for Ginkgo DSL"))
- Ω(result).Should(ContainSubstring("// Declarations for Gomega DSL"))
- Ω(result).Should(ContainSubstring("// Declarations for Gomega Matchers"))
- })
-
- It("should import Ginkgo's declarations", func() {
- Ω(result).Should(ContainSubstring("var It = ginkgo.It"))
- Ω(result).Should(ContainSubstring("var XDescribe = ginkgo.XDescribe"))
- })
-
- It("should import Ginkgo's types", func() {
- Ω(result).Should(ContainSubstring("type Done ginkgo.Done"))
- Ω(result).Should(ContainSubstring("type Benchmarker ginkgo.Benchmarker"))
- Ω(strings.Count(result, "type ")).Should(Equal(2))
- })
-
- It("should import Gomega's DSL and matchers", func() {
- Ω(result).Should(ContainSubstring("var Ω = gomega.Ω"))
- Ω(result).Should(ContainSubstring("var ContainSubstring = gomega.ContainSubstring"))
- Ω(result).Should(ContainSubstring("var Equal = gomega.Equal"))
- })
-
- It("should not import blacklisted things", func() {
- Ω(result).ShouldNot(ContainSubstring("GINKGO_VERSION"))
- Ω(result).ShouldNot(ContainSubstring("GINKGO_PANIC"))
- Ω(result).ShouldNot(ContainSubstring("GOMEGA_VERSION"))
- })
- })
-
- It("should be idempotent (module empty lines - go fmt can fix those for us)", func() {
- first := apply("")
- second := apply(first)
- first = strings.Trim(first, "\n")
- second = strings.Trim(second, "\n")
- Ω(first).Should(Equal(second))
- })
-
- It("should not mess with other things in the input", func() {
- result = apply("var MyThing = SomethingThatsMine")
- Ω(result).Should(ContainSubstring("var MyThing = SomethingThatsMine"))
- })
-
- Context("when the user has redefined a name", func() {
- It("should honor the redefinition", func() {
- result = apply(`
-var _ = gomega.Ω
-var When = ginkgo.It
- `)
-
- Ω(result).Should(ContainSubstring("var _ = gomega.Ω"))
- Ω(result).ShouldNot(ContainSubstring("var Ω = gomega.Ω"))
-
- Ω(result).Should(ContainSubstring("var When = ginkgo.It"))
- Ω(result).ShouldNot(ContainSubstring("var It = ginkgo.It"))
-
- Ω(result).Should(ContainSubstring("var Context = ginkgo.Context"))
- })
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/ginkgo/run_watch_and_build_command_flags.go b/vendor/github.com/onsi/ginkgo/ginkgo/run_watch_and_build_command_flags.go
index b7cb7f566..e0994fc3c 100644
--- a/vendor/github.com/onsi/ginkgo/ginkgo/run_watch_and_build_command_flags.go
+++ b/vendor/github.com/onsi/ginkgo/ginkgo/run_watch_and_build_command_flags.go
@@ -126,6 +126,7 @@ func (c *RunWatchAndBuildCommandFlags) flags(mode int) {
c.FlagSet.BoolVar(c.boolSlot("work"), "work", false, "Print the name of the temporary work directory and do not delete it when exiting.")
c.FlagSet.StringVar(c.stringSlot("asmflags"), "asmflags", "", "Arguments to pass on each go tool asm invocation.")
c.FlagSet.StringVar(c.stringSlot("buildmode"), "buildmode", "", "Build mode to use. See 'go help buildmode' for more.")
+ c.FlagSet.StringVar(c.stringSlot("mod"), "mod", "", "Go module control. See 'go help modules' for more.")
c.FlagSet.StringVar(c.stringSlot("compiler"), "compiler", "", "Name of compiler to use, as in runtime.Compiler (gccgo or gc).")
c.FlagSet.StringVar(c.stringSlot("gccgoflags"), "gccgoflags", "", "Arguments to pass on each gccgo compiler/linker invocation.")
c.FlagSet.StringVar(c.stringSlot("installsuffix"), "installsuffix", "", "A suffix to use in the name of the package installation directory.")
@@ -140,6 +141,7 @@ func (c *RunWatchAndBuildCommandFlags) flags(mode int) {
c.FlagSet.IntVar(c.intSlot("memprofilerate"), "memprofilerate", 0, "Enable more precise (and expensive) memory profiles by setting runtime.MemProfileRate.")
c.FlagSet.StringVar(c.stringSlot("outputdir"), "outputdir", "", "Place output files from profiling in the specified directory.")
c.FlagSet.BoolVar(c.boolSlot("requireSuite"), "requireSuite", false, "Fail if there are ginkgo tests in a directory but no test suite (missing RunSpecs)")
+ c.FlagSet.StringVar(c.stringSlot("vet"), "vet", "", "Configure the invocation of 'go vet' to use the comma-separated list of vet checks. If list is 'off', 'go test' does not run 'go vet' at all.")
if mode == runMode || mode == watchMode {
config.Flags(c.FlagSet, "", false)
diff --git a/vendor/github.com/onsi/ginkgo/ginkgo/testrunner/test_runner.go b/vendor/github.com/onsi/ginkgo/ginkgo/testrunner/test_runner.go
index a0113e136..dccb39518 100644
--- a/vendor/github.com/onsi/ginkgo/ginkgo/testrunner/test_runner.go
+++ b/vendor/github.com/onsi/ginkgo/ginkgo/testrunner/test_runner.go
@@ -119,6 +119,8 @@ func (t *TestRunner) BuildArgs(path string) []string {
"coverpkg",
"tags",
"gcflags",
+ "vet",
+ "mod",
}
for _, opt := range stringOpts {
diff --git a/vendor/github.com/onsi/ginkgo/ginkgo/testrunner/test_runner_test.go b/vendor/github.com/onsi/ginkgo/ginkgo/testrunner/test_runner_test.go
deleted file mode 100644
index 691917043..000000000
--- a/vendor/github.com/onsi/ginkgo/ginkgo/testrunner/test_runner_test.go
+++ /dev/null
@@ -1,60 +0,0 @@
-package testrunner_test
-
-import (
- "testing"
-
- . "github.com/onsi/ginkgo"
- "github.com/onsi/ginkgo/ginkgo/testrunner"
- "github.com/onsi/ginkgo/ginkgo/testsuite"
- . "github.com/onsi/gomega"
-)
-
-func strAddr(s string) interface{} {
- return &s
-}
-
-func boolAddr(s bool) interface{} {
- return &s
-}
-
-func intAddr(s int) interface{} {
- return &s
-}
-
-var _ = Describe("TestRunner", func() {
- It("should pass through go opts", func() {
- //var opts map[string]interface{}
- opts := map[string]interface{}{
- "asmflags": strAddr("a"),
- "pkgdir": strAddr("b"),
- "gcflags": strAddr("c"),
- "covermode": strAddr(""),
- "coverpkg": strAddr(""),
- "cover": boolAddr(false),
- "blockprofilerate": intAddr(100),
- }
- tr := testrunner.New(testsuite.TestSuite{}, 1, false, 0, opts, []string{})
-
- args := tr.BuildArgs(".")
- // Remove the "-i" argument; This is discarded in Golang 1.10+.
- if args[2] == "-i" {
- args = append(args[0:2], args[3:]...)
- }
- Ω(args).Should(Equal([]string{
- "test",
- "-c",
- "-o",
- ".",
- "",
- "-blockprofilerate=100",
- "-asmflags=a",
- "-pkgdir=b",
- "-gcflags=c",
- }))
- })
-})
-
-func TestTestRunner(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "Test Runner Suite")
-}
diff --git a/vendor/github.com/onsi/ginkgo/ginkgo/testsuite/testsuite_suite_test.go b/vendor/github.com/onsi/ginkgo/ginkgo/testsuite/testsuite_suite_test.go
deleted file mode 100644
index d1e8b21d3..000000000
--- a/vendor/github.com/onsi/ginkgo/ginkgo/testsuite/testsuite_suite_test.go
+++ /dev/null
@@ -1,13 +0,0 @@
-package testsuite_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-
- "testing"
-)
-
-func TestTestsuite(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "Testsuite Suite")
-}
diff --git a/vendor/github.com/onsi/ginkgo/ginkgo/testsuite/testsuite_test.go b/vendor/github.com/onsi/ginkgo/ginkgo/testsuite/testsuite_test.go
deleted file mode 100644
index 7a0753bf5..000000000
--- a/vendor/github.com/onsi/ginkgo/ginkgo/testsuite/testsuite_test.go
+++ /dev/null
@@ -1,212 +0,0 @@
-// +build go1.6
-
-package testsuite_test
-
-import (
- "io/ioutil"
- "os"
- "path/filepath"
-
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/ginkgo/ginkgo/testsuite"
- . "github.com/onsi/gomega"
-)
-
-var _ = Describe("TestSuite", func() {
- var tmpDir string
- var relTmpDir string
-
- writeFile := func(folder string, filename string, content string, mode os.FileMode) {
- path := filepath.Join(tmpDir, folder)
- err := os.MkdirAll(path, 0700)
- Ω(err).ShouldNot(HaveOccurred())
-
- path = filepath.Join(path, filename)
- ioutil.WriteFile(path, []byte(content), mode)
- }
-
- var origVendor string
-
- BeforeSuite(func() {
- origVendor = os.Getenv("GO15VENDOREXPERIMENT")
- })
-
- AfterSuite(func() {
- os.Setenv("GO15VENDOREXPERIMENT", origVendor)
- })
-
- BeforeEach(func() {
- var err error
- tmpDir, err = ioutil.TempDir("/tmp", "ginkgo")
- Ω(err).ShouldNot(HaveOccurred())
-
- cwd, err := os.Getwd()
- Ω(err).ShouldNot(HaveOccurred())
- relTmpDir, err = filepath.Rel(cwd, tmpDir)
- Ω(err).ShouldNot(HaveOccurred())
-
- //go files in the root directory (no tests)
- writeFile("/", "main.go", "package main", 0666)
-
- //non-go files in a nested directory
- writeFile("/redherring", "big_test.jpg", "package ginkgo", 0666)
-
- //ginkgo tests in ignored go files
- writeFile("/ignored", ".ignore_dot_test.go", `import "github.com/onsi/ginkgo"`, 0666)
- writeFile("/ignored", "_ignore_underscore_test.go", `import "github.com/onsi/ginkgo"`, 0666)
-
- //non-ginkgo tests in a nested directory
- writeFile("/professorplum", "professorplum_test.go", `import "testing"`, 0666)
-
- //ginkgo tests in a nested directory
- writeFile("/colonelmustard", "colonelmustard_test.go", `import "github.com/onsi/ginkgo"`, 0666)
-
- //ginkgo tests in a deeply nested directory
- writeFile("/colonelmustard/library", "library_test.go", `import "github.com/onsi/ginkgo"`, 0666)
-
- //ginkgo tests deeply nested in a vendored dependency
- writeFile("/vendor/mrspeacock/lounge", "lounge_test.go", `import "github.com/onsi/ginkgo"`, 0666)
-
- //a precompiled ginkgo test
- writeFile("/precompiled-dir", "precompiled.test", `fake-binary-file`, 0777)
- writeFile("/precompiled-dir", "some-other-binary", `fake-binary-file`, 0777)
- writeFile("/precompiled-dir", "nonexecutable.test", `fake-binary-file`, 0666)
- })
-
- AfterEach(func() {
- os.RemoveAll(tmpDir)
- })
-
- Describe("Finding precompiled test suites", func() {
- Context("if pointed at an executable file that ends with .test", func() {
- It("should return a precompiled test suite", func() {
- suite, err := PrecompiledTestSuite(filepath.Join(tmpDir, "precompiled-dir", "precompiled.test"))
- Ω(err).ShouldNot(HaveOccurred())
- Ω(suite).Should(Equal(TestSuite{
- Path: relTmpDir + "/precompiled-dir",
- PackageName: "precompiled",
- IsGinkgo: true,
- Precompiled: true,
- }))
- })
- })
-
- Context("if pointed at a directory", func() {
- It("should error", func() {
- suite, err := PrecompiledTestSuite(filepath.Join(tmpDir, "precompiled-dir"))
- Ω(suite).Should(BeZero())
- Ω(err).Should(HaveOccurred())
- })
- })
-
- Context("if pointed at an executable that doesn't have .test", func() {
- It("should error", func() {
- suite, err := PrecompiledTestSuite(filepath.Join(tmpDir, "precompiled-dir", "some-other-binary"))
- Ω(suite).Should(BeZero())
- Ω(err).Should(HaveOccurred())
- })
- })
-
- Context("if pointed at a .test that isn't executable", func() {
- It("should error", func() {
- suite, err := PrecompiledTestSuite(filepath.Join(tmpDir, "precompiled-dir", "nonexecutable.test"))
- Ω(suite).Should(BeZero())
- Ω(err).Should(HaveOccurred())
- })
- })
-
- Context("if pointed at a nonexisting file", func() {
- It("should error", func() {
- suite, err := PrecompiledTestSuite(filepath.Join(tmpDir, "precompiled-dir", "nope-nothing-to-see-here"))
- Ω(suite).Should(BeZero())
- Ω(err).Should(HaveOccurred())
- })
- })
- })
-
- Describe("scanning for suites in a directory", func() {
- Context("when there are no tests in the specified directory", func() {
- It("should come up empty", func() {
- suites := SuitesInDir(tmpDir, false)
- Ω(suites).Should(BeEmpty())
- })
- })
-
- Context("when there are ginkgo tests in the specified directory", func() {
- It("should return an appropriately configured suite", func() {
- suites := SuitesInDir(filepath.Join(tmpDir, "colonelmustard"), false)
- Ω(suites).Should(HaveLen(1))
-
- Ω(suites[0].Path).Should(Equal(relTmpDir + "/colonelmustard"))
- Ω(suites[0].PackageName).Should(Equal("colonelmustard"))
- Ω(suites[0].IsGinkgo).Should(BeTrue())
- Ω(suites[0].Precompiled).Should(BeFalse())
- })
- })
-
- Context("when there are ginkgo tests that are ignored by go in the specified directory ", func() {
- It("should come up empty", func() {
- suites := SuitesInDir(filepath.Join(tmpDir, "ignored"), false)
- Ω(suites).Should(BeEmpty())
- })
- })
-
- Context("when there are non-ginkgo tests in the specified directory", func() {
- It("should return an appropriately configured suite", func() {
- suites := SuitesInDir(filepath.Join(tmpDir, "professorplum"), false)
- Ω(suites).Should(HaveLen(1))
-
- Ω(suites[0].Path).Should(Equal(relTmpDir + "/professorplum"))
- Ω(suites[0].PackageName).Should(Equal("professorplum"))
- Ω(suites[0].IsGinkgo).Should(BeFalse())
- Ω(suites[0].Precompiled).Should(BeFalse())
- })
- })
-
- Context("given GO15VENDOREXPERIMENT disabled", func() {
- BeforeEach(func() {
- os.Setenv("GO15VENDOREXPERIMENT", "0")
- })
-
- AfterEach(func() {
- os.Setenv("GO15VENDOREXPERIMENT", "")
- })
-
- It("should not skip vendor dirs", func() {
- suites := SuitesInDir(filepath.Join(tmpDir+"/vendor"), true)
- Ω(suites).Should(HaveLen(1))
- })
-
- It("should recurse into vendor dirs", func() {
- suites := SuitesInDir(filepath.Join(tmpDir), true)
- Ω(suites).Should(HaveLen(4))
- })
- })
-
- Context("when recursively scanning", func() {
- It("should return suites for corresponding test suites, only", func() {
- suites := SuitesInDir(tmpDir, true)
- Ω(suites).Should(HaveLen(3))
-
- Ω(suites).Should(ContainElement(TestSuite{
- Path: relTmpDir + "/colonelmustard",
- PackageName: "colonelmustard",
- IsGinkgo: true,
- Precompiled: false,
- }))
- Ω(suites).Should(ContainElement(TestSuite{
- Path: relTmpDir + "/professorplum",
- PackageName: "professorplum",
- IsGinkgo: false,
- Precompiled: false,
- }))
- Ω(suites).Should(ContainElement(TestSuite{
- Path: relTmpDir + "/colonelmustard/library",
- PackageName: "library",
- IsGinkgo: true,
- Precompiled: false,
- }))
- })
- })
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/ginkgo/testsuite/vendor_check_go15_test.go b/vendor/github.com/onsi/ginkgo/ginkgo/testsuite/vendor_check_go15_test.go
deleted file mode 100644
index dc3ca2a94..000000000
--- a/vendor/github.com/onsi/ginkgo/ginkgo/testsuite/vendor_check_go15_test.go
+++ /dev/null
@@ -1,201 +0,0 @@
-// +build !go1.6
-
-package testsuite_test
-
-import (
- "io/ioutil"
- "os"
- "path/filepath"
-
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/ginkgo/ginkgo/testsuite"
- . "github.com/onsi/gomega"
-)
-
-var _ = Describe("TestSuite", func() {
- var tmpDir string
- var relTmpDir string
-
- writeFile := func(folder string, filename string, content string, mode os.FileMode) {
- path := filepath.Join(tmpDir, folder)
- err := os.MkdirAll(path, 0700)
- Ω(err).ShouldNot(HaveOccurred())
-
- path = filepath.Join(path, filename)
- ioutil.WriteFile(path, []byte(content), mode)
- }
-
- var origVendor string
-
- BeforeSuite(func() {
- origVendor = os.Getenv("GO15VENDOREXPERIMENT")
- })
-
- AfterSuite(func() {
- os.Setenv("GO15VENDOREXPERIMENT", origVendor)
- })
-
- BeforeEach(func() {
- var err error
- tmpDir, err = ioutil.TempDir("/tmp", "ginkgo")
- Ω(err).ShouldNot(HaveOccurred())
-
- cwd, err := os.Getwd()
- Ω(err).ShouldNot(HaveOccurred())
- relTmpDir, err = filepath.Rel(cwd, tmpDir)
- Ω(err).ShouldNot(HaveOccurred())
-
- //go files in the root directory (no tests)
- writeFile("/", "main.go", "package main", 0666)
-
- //non-go files in a nested directory
- writeFile("/redherring", "big_test.jpg", "package ginkgo", 0666)
-
- //non-ginkgo tests in a nested directory
- writeFile("/professorplum", "professorplum_test.go", `import "testing"`, 0666)
-
- //ginkgo tests in a nested directory
- writeFile("/colonelmustard", "colonelmustard_test.go", `import "github.com/onsi/ginkgo"`, 0666)
-
- //ginkgo tests in a deeply nested directory
- writeFile("/colonelmustard/library", "library_test.go", `import "github.com/onsi/ginkgo"`, 0666)
-
- //ginkgo tests deeply nested in a vendored dependency
- writeFile("/vendor/mrspeacock/lounge", "lounge_test.go", `import "github.com/onsi/ginkgo"`, 0666)
-
- //a precompiled ginkgo test
- writeFile("/precompiled-dir", "precompiled.test", `fake-binary-file`, 0777)
- writeFile("/precompiled-dir", "some-other-binary", `fake-binary-file`, 0777)
- writeFile("/precompiled-dir", "nonexecutable.test", `fake-binary-file`, 0666)
- })
-
- AfterEach(func() {
- os.RemoveAll(tmpDir)
- })
-
- Describe("Finding precompiled test suites", func() {
- Context("if pointed at an executable file that ends with .test", func() {
- It("should return a precompiled test suite", func() {
- suite, err := PrecompiledTestSuite(filepath.Join(tmpDir, "precompiled-dir", "precompiled.test"))
- Ω(err).ShouldNot(HaveOccurred())
- Ω(suite).Should(Equal(TestSuite{
- Path: relTmpDir + "/precompiled-dir",
- PackageName: "precompiled",
- IsGinkgo: true,
- Precompiled: true,
- }))
- })
- })
-
- Context("if pointed at a directory", func() {
- It("should error", func() {
- suite, err := PrecompiledTestSuite(filepath.Join(tmpDir, "precompiled-dir"))
- Ω(suite).Should(BeZero())
- Ω(err).Should(HaveOccurred())
- })
- })
-
- Context("if pointed at an executable that doesn't have .test", func() {
- It("should error", func() {
- suite, err := PrecompiledTestSuite(filepath.Join(tmpDir, "precompiled-dir", "some-other-binary"))
- Ω(suite).Should(BeZero())
- Ω(err).Should(HaveOccurred())
- })
- })
-
- Context("if pointed at a .test that isn't executable", func() {
- It("should error", func() {
- suite, err := PrecompiledTestSuite(filepath.Join(tmpDir, "precompiled-dir", "nonexecutable.test"))
- Ω(suite).Should(BeZero())
- Ω(err).Should(HaveOccurred())
- })
- })
-
- Context("if pointed at a nonexisting file", func() {
- It("should error", func() {
- suite, err := PrecompiledTestSuite(filepath.Join(tmpDir, "precompiled-dir", "nope-nothing-to-see-here"))
- Ω(suite).Should(BeZero())
- Ω(err).Should(HaveOccurred())
- })
- })
- })
-
- Describe("scanning for suites in a directory", func() {
- Context("when there are no tests in the specified directory", func() {
- It("should come up empty", func() {
- suites := SuitesInDir(tmpDir, false)
- Ω(suites).Should(BeEmpty())
- })
- })
-
- Context("when there are ginkgo tests in the specified directory", func() {
- It("should return an appropriately configured suite", func() {
- suites := SuitesInDir(filepath.Join(tmpDir, "colonelmustard"), false)
- Ω(suites).Should(HaveLen(1))
-
- Ω(suites[0].Path).Should(Equal(relTmpDir + "/colonelmustard"))
- Ω(suites[0].PackageName).Should(Equal("colonelmustard"))
- Ω(suites[0].IsGinkgo).Should(BeTrue())
- Ω(suites[0].Precompiled).Should(BeFalse())
- })
- })
-
- Context("when there are non-ginkgo tests in the specified directory", func() {
- It("should return an appropriately configured suite", func() {
- suites := SuitesInDir(filepath.Join(tmpDir, "professorplum"), false)
- Ω(suites).Should(HaveLen(1))
-
- Ω(suites[0].Path).Should(Equal(relTmpDir + "/professorplum"))
- Ω(suites[0].PackageName).Should(Equal("professorplum"))
- Ω(suites[0].IsGinkgo).Should(BeFalse())
- Ω(suites[0].Precompiled).Should(BeFalse())
- })
- })
-
- Context("given GO15VENDOREXPERIMENT", func() {
- BeforeEach(func() {
- os.Setenv("GO15VENDOREXPERIMENT", "1")
- })
-
- AfterEach(func() {
- os.Setenv("GO15VENDOREXPERIMENT", "")
- })
-
- It("should skip vendor dirs", func() {
- suites := SuitesInDir(filepath.Join(tmpDir+"/vendor"), false)
- Ω(suites).Should(HaveLen(0))
- })
-
- It("should not recurse into vendor dirs", func() {
- suites := SuitesInDir(filepath.Join(tmpDir), true)
- Ω(suites).Should(HaveLen(3))
- })
- })
-
- Context("when recursively scanning", func() {
- It("should return suites for corresponding test suites, only", func() {
- suites := SuitesInDir(tmpDir, true)
- Ω(suites).Should(HaveLen(4))
-
- Ω(suites).Should(ContainElement(TestSuite{
- Path: relTmpDir + "/colonelmustard",
- PackageName: "colonelmustard",
- IsGinkgo: true,
- Precompiled: false,
- }))
- Ω(suites).Should(ContainElement(TestSuite{
- Path: relTmpDir + "/professorplum",
- PackageName: "professorplum",
- IsGinkgo: false,
- Precompiled: false,
- }))
- Ω(suites).Should(ContainElement(TestSuite{
- Path: relTmpDir + "/colonelmustard/library",
- PackageName: "library",
- IsGinkgo: true,
- Precompiled: false,
- }))
- })
- })
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/ginkgo_dsl.go b/vendor/github.com/onsi/ginkgo/ginkgo_dsl.go
index 5aa96b4d9..a6b96d88f 100644
--- a/vendor/github.com/onsi/ginkgo/ginkgo_dsl.go
+++ b/vendor/github.com/onsi/ginkgo/ginkgo_dsl.go
@@ -457,13 +457,13 @@ func FMeasure(text string, body interface{}, samples int) bool {
return true
}
-//You can mark Maeasurements as pending using PMeasure
+//You can mark Measurements as pending using PMeasure
func PMeasure(text string, _ ...interface{}) bool {
globalSuite.PushMeasureNode(text, func(b Benchmarker) {}, types.FlagTypePending, codelocation.New(1), 0)
return true
}
-//You can mark Maeasurements as pending using XMeasure
+//You can mark Measurements as pending using XMeasure
func XMeasure(text string, _ ...interface{}) bool {
globalSuite.PushMeasureNode(text, func(b Benchmarker) {}, types.FlagTypePending, codelocation.New(1), 0)
return true
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/first_package/coverage.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/first_package/coverage.go
deleted file mode 100644
index 10c1c1bd1..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/first_package/coverage.go
+++ /dev/null
@@ -1,21 +0,0 @@
-package first_package
-
-func A() string {
- return "A"
-}
-
-func B() string {
- return "B"
-}
-
-func C() string {
- return "C"
-}
-
-func D() string {
- return "D"
-}
-
-func E() string {
- return "untested"
-}
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/first_package/coverage_fixture_suite_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/first_package/coverage_fixture_suite_test.go
deleted file mode 100644
index 4e0976cd5..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/first_package/coverage_fixture_suite_test.go
+++ /dev/null
@@ -1,13 +0,0 @@
-package first_package_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-
- "testing"
-)
-
-func TestCoverageFixture(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "CombinedFixture First Suite")
-}
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/first_package/coverage_fixture_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/first_package/coverage_fixture_test.go
deleted file mode 100644
index dfe3e1127..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/first_package/coverage_fixture_test.go
+++ /dev/null
@@ -1,31 +0,0 @@
-package first_package_test
-
-import (
- . "github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/first_package"
- . "github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/first_package/external_coverage_fixture"
-
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-)
-
-var _ = Describe("CoverageFixture", func() {
- It("should test A", func() {
- Ω(A()).Should(Equal("A"))
- })
-
- It("should test B", func() {
- Ω(B()).Should(Equal("B"))
- })
-
- It("should test C", func() {
- Ω(C()).Should(Equal("C"))
- })
-
- It("should test D", func() {
- Ω(D()).Should(Equal("D"))
- })
-
- It("should test external package", func() {
- Ω(Tested()).Should(Equal("tested"))
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/first_package/external_coverage_fixture/external_coverage.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/first_package/external_coverage_fixture/external_coverage.go
deleted file mode 100644
index 5280d4ddf..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/first_package/external_coverage_fixture/external_coverage.go
+++ /dev/null
@@ -1,9 +0,0 @@
-package external_coverage
-
-func Tested() string {
- return "tested"
-}
-
-func Untested() string {
- return "untested"
-}
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/second_package/coverage.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/second_package/coverage.go
deleted file mode 100644
index 52160989b..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/second_package/coverage.go
+++ /dev/null
@@ -1,21 +0,0 @@
-package second_package
-
-func A() string {
- return "A"
-}
-
-func B() string {
- return "B"
-}
-
-func C() string {
- return "C"
-}
-
-func D() string {
- return "D"
-}
-
-func E() string {
- return "E"
-}
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/second_package/coverage_fixture_suite_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/second_package/coverage_fixture_suite_test.go
deleted file mode 100644
index 583a0af20..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/second_package/coverage_fixture_suite_test.go
+++ /dev/null
@@ -1,13 +0,0 @@
-package second_package_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-
- "testing"
-)
-
-func TestCoverageFixture(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "CombinedFixture Second Suite")
-}
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/second_package/coverage_fixture_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/second_package/coverage_fixture_test.go
deleted file mode 100644
index 2692bec9b..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/second_package/coverage_fixture_test.go
+++ /dev/null
@@ -1,29 +0,0 @@
-package second_package_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/ginkgo/integration/_fixtures/combined_coverage_fixture/second_package"
- . "github.com/onsi/gomega"
-)
-
-var _ = Describe("CoverageFixture", func() {
- It("should test A", func() {
- Ω(A()).Should(Equal("A"))
- })
-
- It("should test B", func() {
- Ω(B()).Should(Equal("B"))
- })
-
- It("should test C", func() {
- Ω(C()).Should(Equal("C"))
- })
-
- It("should test D", func() {
- Ω(D()).Should(Equal("D"))
- })
-
- It("should test E", func() {
- Ω(E()).Should(Equal("E"))
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_fixtures/extra_functions_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_fixtures/extra_functions_test.go
deleted file mode 100644
index ccb3669a5..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_fixtures/extra_functions_test.go
+++ /dev/null
@@ -1,14 +0,0 @@
-package tmp
-
-import (
- "testing"
-)
-
-func TestSomethingLessImportant(t *testing.T) {
- strp := "hello!"
- somethingImportant(t, &strp)
-}
-
-func somethingImportant(t *testing.T, message *string) {
- t.Log("Something important happened in a test: " + *message)
-}
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_fixtures/nested/nested_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_fixtures/nested/nested_test.go
deleted file mode 100644
index cde42e470..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_fixtures/nested/nested_test.go
+++ /dev/null
@@ -1,10 +0,0 @@
-package nested
-
-import (
- "testing"
-)
-
-func TestSomethingLessImportant(t *testing.T) {
- whatever := &UselessStruct{}
- t.Fail(whatever.ImportantField != "SECRET_PASSWORD")
-}
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_fixtures/nested_without_gofiles/subpackage/nested_subpackage_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_fixtures/nested_without_gofiles/subpackage/nested_subpackage_test.go
deleted file mode 100644
index 7cdd326c5..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_fixtures/nested_without_gofiles/subpackage/nested_subpackage_test.go
+++ /dev/null
@@ -1,9 +0,0 @@
-package subpackage
-
-import (
- "testing"
-)
-
-func TestNestedSubPackages(t *testing.T) {
- t.Fail(true)
-}
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_fixtures/outside_package_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_fixtures/outside_package_test.go
deleted file mode 100644
index a682eeaff..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_fixtures/outside_package_test.go
+++ /dev/null
@@ -1,16 +0,0 @@
-package tmp_test
-
-import (
- "testing"
-)
-
-type UselessStruct struct {
- ImportantField string
-}
-
-func TestSomethingImportant(t *testing.T) {
- whatever := &UselessStruct{}
- if whatever.ImportantField != "SECRET_PASSWORD" {
- t.Fail()
- }
-}
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_fixtures/xunit_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_fixtures/xunit_test.go
deleted file mode 100644
index 049829a7d..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_fixtures/xunit_test.go
+++ /dev/null
@@ -1,41 +0,0 @@
-package tmp
-
-import (
- "testing"
-)
-
-type UselessStruct struct {
- ImportantField string
- T *testing.T
-}
-
-var testFunc = func(t *testing.T, arg *string) {}
-
-func assertEqual(t *testing.T, arg1, arg2 interface{}) {
- if arg1 != arg2 {
- t.Fail()
- }
-}
-
-func TestSomethingImportant(t *testing.T) {
- whatever := &UselessStruct{
- T: t,
- ImportantField: "SECRET_PASSWORD",
- }
- something := &UselessStruct{ImportantField: "string value"}
- assertEqual(t, whatever.ImportantField, "SECRET_PASSWORD")
- assertEqual(t, something.ImportantField, "string value")
-
- var foo = func(t *testing.T) {}
- foo(t)
-
- strp := "something"
- testFunc(t, &strp)
- t.Fail()
-}
-
-func Test3Things(t *testing.T) {
- if 3 != 3 {
- t.Fail()
- }
-}
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/extra_functions_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/extra_functions_test.go
deleted file mode 100644
index 1c2c56cea..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/extra_functions_test.go
+++ /dev/null
@@ -1,17 +0,0 @@
-package tmp
-
-import (
- . "github.com/onsi/ginkgo"
-)
-
-var _ = Describe("Testing with Ginkgo", func() {
- It("something less important", func() {
-
- strp := "hello!"
- somethingImportant(GinkgoT(), &strp)
- })
-})
-
-func somethingImportant(t GinkgoTInterface, message *string) {
- t.Log("Something important happened in a test: " + *message)
-}
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/fixtures_suite_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/fixtures_suite_test.go
deleted file mode 100644
index a9a404b5c..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/fixtures_suite_test.go
+++ /dev/null
@@ -1,13 +0,0 @@
-package tmp
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-
- "testing"
-)
-
-func TestTmp(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "Tmp Suite")
-}
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/nested_subpackage_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/nested_subpackage_test.go
deleted file mode 100644
index 3653eae82..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/nested_subpackage_test.go
+++ /dev/null
@@ -1,11 +0,0 @@
-package subpackage
-
-import (
- . "github.com/onsi/ginkgo"
-)
-
-var _ = Describe("Testing with Ginkgo", func() {
- It("nested sub packages", func() {
- GinkgoT().Fail(true)
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/nested_suite_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/nested_suite_test.go
deleted file mode 100644
index 721d0f2c3..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/nested_suite_test.go
+++ /dev/null
@@ -1,13 +0,0 @@
-package nested_test
-
-import (
- "testing"
-
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-)
-
-func TestNested(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "Nested Suite")
-}
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/nested_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/nested_test.go
deleted file mode 100644
index 47364b814..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/nested_test.go
+++ /dev/null
@@ -1,13 +0,0 @@
-package nested
-
-import (
- . "github.com/onsi/ginkgo"
-)
-
-var _ = Describe("Testing with Ginkgo", func() {
- It("something less important", func() {
-
- whatever := &UselessStruct{}
- GinkgoT().Fail(whatever.ImportantField != "SECRET_PASSWORD")
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/outside_package_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/outside_package_test.go
deleted file mode 100644
index 1f2e332c4..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/outside_package_test.go
+++ /dev/null
@@ -1,19 +0,0 @@
-package tmp_test
-
-import (
- . "github.com/onsi/ginkgo"
-)
-
-var _ = Describe("Testing with Ginkgo", func() {
- It("something important", func() {
-
- whatever := &UselessStruct{}
- if whatever.ImportantField != "SECRET_PASSWORD" {
- GinkgoT().Fail()
- }
- })
-})
-
-type UselessStruct struct {
- ImportantField string
-}
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/suite_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/suite_test.go
deleted file mode 100644
index 9ea229135..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/suite_test.go
+++ /dev/null
@@ -1,13 +0,0 @@
-package tmp_test
-
-import (
- "testing"
-
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-)
-
-func TestConvertFixtures(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "ConvertFixtures Suite")
-}
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/xunit_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/xunit_test.go
deleted file mode 100644
index dbe3b419d..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/convert_goldmasters/xunit_test.go
+++ /dev/null
@@ -1,44 +0,0 @@
-package tmp
-
-import (
- . "github.com/onsi/ginkgo"
-)
-
-var _ = Describe("Testing with Ginkgo", func() {
- It("something important", func() {
-
- whatever := &UselessStruct{
- T: GinkgoT(),
- ImportantField: "SECRET_PASSWORD",
- }
- something := &UselessStruct{ImportantField: "string value"}
- assertEqual(GinkgoT(), whatever.ImportantField, "SECRET_PASSWORD")
- assertEqual(GinkgoT(), something.ImportantField, "string value")
-
- var foo = func(t GinkgoTInterface) {}
- foo(GinkgoT())
-
- strp := "something"
- testFunc(GinkgoT(), &strp)
- GinkgoT().Fail()
- })
- It("3 things", func() {
-
- if 3 != 3 {
- GinkgoT().Fail()
- }
- })
-})
-
-type UselessStruct struct {
- ImportantField string
- T GinkgoTInterface
-}
-
-var testFunc = func(t GinkgoTInterface, arg *string) {}
-
-func assertEqual(t GinkgoTInterface, arg1, arg2 interface{}) {
- if arg1 != arg2 {
- t.Fail()
- }
-}
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/coverage_fixture/coverage.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/coverage_fixture/coverage.go
deleted file mode 100644
index e4d7e43b1..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/coverage_fixture/coverage.go
+++ /dev/null
@@ -1,25 +0,0 @@
-package coverage_fixture
-
-import (
- _ "github.com/onsi/ginkgo/integration/_fixtures/coverage_fixture/external_coverage_fixture"
-)
-
-func A() string {
- return "A"
-}
-
-func B() string {
- return "B"
-}
-
-func C() string {
- return "C"
-}
-
-func D() string {
- return "D"
-}
-
-func E() string {
- return "untested"
-}
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/coverage_fixture/coverage_fixture_suite_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/coverage_fixture/coverage_fixture_suite_test.go
deleted file mode 100644
index 2831bf7d2..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/coverage_fixture/coverage_fixture_suite_test.go
+++ /dev/null
@@ -1,13 +0,0 @@
-package coverage_fixture_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-
- "testing"
-)
-
-func TestCoverageFixture(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "CoverageFixture Suite")
-}
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/coverage_fixture/coverage_fixture_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/coverage_fixture/coverage_fixture_test.go
deleted file mode 100644
index 12a72dce8..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/coverage_fixture/coverage_fixture_test.go
+++ /dev/null
@@ -1,31 +0,0 @@
-package coverage_fixture_test
-
-import (
- . "github.com/onsi/ginkgo/integration/_fixtures/coverage_fixture"
- . "github.com/onsi/ginkgo/integration/_fixtures/coverage_fixture/external_coverage_fixture"
-
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-)
-
-var _ = Describe("CoverageFixture", func() {
- It("should test A", func() {
- Ω(A()).Should(Equal("A"))
- })
-
- It("should test B", func() {
- Ω(B()).Should(Equal("B"))
- })
-
- It("should test C", func() {
- Ω(C()).Should(Equal("C"))
- })
-
- It("should test D", func() {
- Ω(D()).Should(Equal("D"))
- })
-
- It("should test external package", func() {
- Ω(Tested()).Should(Equal("tested"))
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/coverage_fixture/external_coverage_fixture/external_coverage.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/coverage_fixture/external_coverage_fixture/external_coverage.go
deleted file mode 100644
index 5280d4ddf..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/coverage_fixture/external_coverage_fixture/external_coverage.go
+++ /dev/null
@@ -1,9 +0,0 @@
-package external_coverage
-
-func Tested() string {
- return "tested"
-}
-
-func Untested() string {
- return "untested"
-}
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/debug_parallel_fixture/debug_parallel_fixture_suite_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/debug_parallel_fixture/debug_parallel_fixture_suite_test.go
deleted file mode 100644
index 429aebc5f..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/debug_parallel_fixture/debug_parallel_fixture_suite_test.go
+++ /dev/null
@@ -1,13 +0,0 @@
-package debug_parallel_fixture_test
-
-import (
- "testing"
-
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-)
-
-func TestDebugParallelFixture(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "DebugParallelFixture Suite")
-}
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/debug_parallel_fixture/debug_parallel_fixture_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/debug_parallel_fixture/debug_parallel_fixture_test.go
deleted file mode 100644
index b609a8bca..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/debug_parallel_fixture/debug_parallel_fixture_test.go
+++ /dev/null
@@ -1,18 +0,0 @@
-package debug_parallel_fixture_test
-
-import (
- "fmt"
- "time"
-
- . "github.com/onsi/ginkgo"
-)
-
-var _ = Describe("DebugParallelFixture", func() {
- It("emits output to a file", func() {
- for i := 0; i < 10; i += 1 {
- fmt.Printf("StdOut %d\n", i)
- GinkgoWriter.Write([]byte(fmt.Sprintf("GinkgoWriter %d\n", i)))
- }
- time.Sleep(time.Second)
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/does_not_compile/does_not_compile_suite_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/does_not_compile/does_not_compile_suite_test.go
deleted file mode 100644
index 01e792696..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/does_not_compile/does_not_compile_suite_test.go
+++ /dev/null
@@ -1,13 +0,0 @@
-package does_not_compile_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-
- "testing"
-)
-
-func TestDoes_not_compile(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "Does_not_compile Suite")
-}
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/does_not_compile/does_not_compile_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/does_not_compile/does_not_compile_test.go
deleted file mode 100644
index e4f22b3cc..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/does_not_compile/does_not_compile_test.go
+++ /dev/null
@@ -1,11 +0,0 @@
-package does_not_compile_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/ginkgo/integration/_fixtures/does_not_compile"
- . "github.com/onsi/gomega"
-)
-
-var _ = Describe("DoesNotCompile", func() {
-
-})
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/eventually_failing/eventually_failing_suite_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/eventually_failing/eventually_failing_suite_test.go
deleted file mode 100644
index 97fa2e775..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/eventually_failing/eventually_failing_suite_test.go
+++ /dev/null
@@ -1,13 +0,0 @@
-package eventually_failing_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-
- "testing"
-)
-
-func TestEventuallyFailing(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "EventuallyFailing Suite")
-}
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/eventually_failing/eventually_failing_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/eventually_failing/eventually_failing_test.go
deleted file mode 100644
index 6c83b4258..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/eventually_failing/eventually_failing_test.go
+++ /dev/null
@@ -1,29 +0,0 @@
-package eventually_failing_test
-
-import (
- "fmt"
- "io/ioutil"
- "strings"
- "time"
-
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-)
-
-var _ = Describe("EventuallyFailing", func() {
- It("should fail on the third try", func() {
- time.Sleep(time.Second)
- files, err := ioutil.ReadDir(".")
- Ω(err).ShouldNot(HaveOccurred())
-
- numRuns := 1
- for _, file := range files {
- if strings.HasPrefix(file.Name(), "counter") {
- numRuns++
- }
- }
-
- Ω(numRuns).Should(BeNumerically("<", 3))
- ioutil.WriteFile(fmt.Sprintf("./counter-%d", numRuns), []byte("foo"), 0777)
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/exiting_synchronized_setup_tests/exiting_synchronized_setup_tests_suite_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/exiting_synchronized_setup_tests/exiting_synchronized_setup_tests_suite_test.go
deleted file mode 100644
index 045ca7c66..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/exiting_synchronized_setup_tests/exiting_synchronized_setup_tests_suite_test.go
+++ /dev/null
@@ -1,35 +0,0 @@
-package synchronized_setup_tests_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-
- "fmt"
- "os"
- "testing"
-)
-
-func TestSynchronized_setup_tests(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "Synchronized_setup_tests Suite")
-}
-
-var beforeData string
-
-var _ = SynchronizedBeforeSuite(func() []byte {
- fmt.Printf("BEFORE_A_%d\n", GinkgoParallelNode())
- os.Exit(1)
- return []byte("WHAT EVZ")
-}, func(data []byte) {
- println("NEVER SEE THIS")
-})
-
-var _ = Describe("Synchronized Setup", func() {
- It("should do nothing", func() {
- Ω(true).Should(BeTrue())
- })
-
- It("should do nothing", func() {
- Ω(true).Should(BeTrue())
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/fail_fixture/fail_fixture_suite_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/fail_fixture/fail_fixture_suite_test.go
deleted file mode 100644
index 6e822643a..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/fail_fixture/fail_fixture_suite_test.go
+++ /dev/null
@@ -1,13 +0,0 @@
-package fail_fixture_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-
- "testing"
-)
-
-func TestFail_fixture(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "Fail_fixture Suite")
-}
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/fail_fixture/fail_fixture_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/fail_fixture/fail_fixture_test.go
deleted file mode 100644
index ea6f71ca9..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/fail_fixture/fail_fixture_test.go
+++ /dev/null
@@ -1,103 +0,0 @@
-package fail_fixture_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-)
-
-var _ = It("handles top level failures", func() {
- Ω("a top level failure on line 9").Should(Equal("nope"))
- println("NEVER SEE THIS")
-})
-
-var _ = It("handles async top level failures", func(done Done) {
- Fail("an async top level failure on line 14")
- println("NEVER SEE THIS")
-}, 0.1)
-
-var _ = It("FAIL in a goroutine", func(done Done) {
- go func() {
- defer GinkgoRecover()
- Fail("a top level goroutine failure on line 21")
- println("NEVER SEE THIS")
- }()
-}, 0.1)
-
-var _ = Describe("Excercising different failure modes", func() {
- It("synchronous failures", func() {
- Ω("a sync failure").Should(Equal("nope"))
- println("NEVER SEE THIS")
- })
-
- It("synchronous panics", func() {
- panic("a sync panic")
- println("NEVER SEE THIS")
- })
-
- It("synchronous failures with FAIL", func() {
- Fail("a sync FAIL failure")
- println("NEVER SEE THIS")
- })
-
- It("async timeout", func(done Done) {
- Ω(true).Should(BeTrue())
- }, 0.1)
-
- It("async failure", func(done Done) {
- Ω("an async failure").Should(Equal("nope"))
- println("NEVER SEE THIS")
- }, 0.1)
-
- It("async panic", func(done Done) {
- panic("an async panic")
- println("NEVER SEE THIS")
- }, 0.1)
-
- It("async failure with FAIL", func(done Done) {
- Fail("an async FAIL failure")
- println("NEVER SEE THIS")
- }, 0.1)
-
- It("FAIL in a goroutine", func(done Done) {
- go func() {
- defer GinkgoRecover()
- Fail("a goroutine FAIL failure")
- println("NEVER SEE THIS")
- }()
- }, 0.1)
-
- It("Gomega in a goroutine", func(done Done) {
- go func() {
- defer GinkgoRecover()
- Ω("a goroutine failure").Should(Equal("nope"))
- println("NEVER SEE THIS")
- }()
- }, 0.1)
-
- It("Panic in a goroutine", func(done Done) {
- go func() {
- defer GinkgoRecover()
- panic("a goroutine panic")
- println("NEVER SEE THIS")
- }()
- }, 0.1)
-
- Measure("a FAIL measure", func(Benchmarker) {
- Fail("a measure FAIL failure")
- println("NEVER SEE THIS")
- }, 1)
-
- Measure("a gomega failed measure", func(Benchmarker) {
- Ω("a measure failure").Should(Equal("nope"))
- println("NEVER SEE THIS")
- }, 1)
-
- Measure("a panicking measure", func(Benchmarker) {
- panic("a measure panic")
- println("NEVER SEE THIS")
- }, 1)
-})
-
-var _ = Specify("a top level specify", func() {
- Fail("fail the test")
-})
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_after_suite/failing_after_suite_suite_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_after_suite/failing_after_suite_suite_test.go
deleted file mode 100644
index 0e410aaea..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_after_suite/failing_after_suite_suite_test.go
+++ /dev/null
@@ -1,22 +0,0 @@
-package failing_before_suite_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-
- "testing"
-)
-
-func TestFailingAfterSuite(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "FailingAfterSuite Suite")
-}
-
-var _ = BeforeSuite(func() {
- println("BEFORE SUITE")
-})
-
-var _ = AfterSuite(func() {
- println("AFTER SUITE")
- panic("BAM!")
-})
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_after_suite/failing_after_suite_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_after_suite/failing_after_suite_test.go
deleted file mode 100644
index 3902ec6c5..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_after_suite/failing_after_suite_test.go
+++ /dev/null
@@ -1,15 +0,0 @@
-package failing_before_suite_test
-
-import (
- . "github.com/onsi/ginkgo"
-)
-
-var _ = Describe("FailingBeforeSuite", func() {
- It("should run", func() {
- println("A TEST")
- })
-
- It("should run", func() {
- println("A TEST")
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_before_suite/failing_before_suite_suite_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_before_suite/failing_before_suite_suite_test.go
deleted file mode 100644
index 109ea3608..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_before_suite/failing_before_suite_suite_test.go
+++ /dev/null
@@ -1,22 +0,0 @@
-package failing_before_suite_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-
- "testing"
-)
-
-func TestFailing_before_suite(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "Failing_before_suite Suite")
-}
-
-var _ = BeforeSuite(func() {
- println("BEFORE SUITE")
- panic("BAM!")
-})
-
-var _ = AfterSuite(func() {
- println("AFTER SUITE")
-})
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_before_suite/failing_before_suite_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_before_suite/failing_before_suite_test.go
deleted file mode 100644
index e8697c64a..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_before_suite/failing_before_suite_test.go
+++ /dev/null
@@ -1,15 +0,0 @@
-package failing_before_suite_test
-
-import (
- . "github.com/onsi/ginkgo"
-)
-
-var _ = Describe("FailingBeforeSuite", func() {
- It("should never run", func() {
- println("NEVER SEE THIS")
- })
-
- It("should never run", func() {
- println("NEVER SEE THIS")
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_ginkgo_tests/failing_ginkgo_tests.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_ginkgo_tests/failing_ginkgo_tests.go
deleted file mode 100644
index e32cd619e..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_ginkgo_tests/failing_ginkgo_tests.go
+++ /dev/null
@@ -1,5 +0,0 @@
-package failing_ginkgo_tests
-
-func AlwaysFalse() bool {
- return false
-}
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_ginkgo_tests/failing_ginkgo_tests_suite_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_ginkgo_tests/failing_ginkgo_tests_suite_test.go
deleted file mode 100644
index 49939bda5..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_ginkgo_tests/failing_ginkgo_tests_suite_test.go
+++ /dev/null
@@ -1,13 +0,0 @@
-package failing_ginkgo_tests_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-
- "testing"
-)
-
-func TestFailing_ginkgo_tests(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "Failing_ginkgo_tests Suite")
-}
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_ginkgo_tests/failing_ginkgo_tests_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_ginkgo_tests/failing_ginkgo_tests_test.go
deleted file mode 100644
index d9c01e32c..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/failing_ginkgo_tests/failing_ginkgo_tests_test.go
+++ /dev/null
@@ -1,17 +0,0 @@
-package failing_ginkgo_tests_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/ginkgo/integration/_fixtures/failing_ginkgo_tests"
- . "github.com/onsi/gomega"
-)
-
-var _ = Describe("FailingGinkgoTests", func() {
- It("should fail", func() {
- Ω(AlwaysFalse()).Should(BeTrue())
- })
-
- It("should pass", func() {
- Ω(AlwaysFalse()).Should(BeFalse())
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/flags_tests/flags.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/flags_tests/flags.go
deleted file mode 100644
index a440abdaa..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/flags_tests/flags.go
+++ /dev/null
@@ -1,9 +0,0 @@
-package flags
-
-func Tested() string {
- return "tested"
-}
-
-func Untested() string {
- return "untested"
-}
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/flags_tests/flags_suite_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/flags_tests/flags_suite_test.go
deleted file mode 100644
index 0b3071f62..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/flags_tests/flags_suite_test.go
+++ /dev/null
@@ -1,13 +0,0 @@
-package flags_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-
- "testing"
-)
-
-func TestFlags(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "Flags Suite")
-}
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/flags_tests/flags_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/flags_tests/flags_test.go
deleted file mode 100644
index 27dadf19c..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/flags_tests/flags_test.go
+++ /dev/null
@@ -1,97 +0,0 @@
-package flags_test
-
-import (
- "flag"
- "fmt"
- remapped "math"
- _ "math/cmplx"
- "time"
-
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/ginkgo/integration/_fixtures/flags_tests"
- . "github.com/onsi/gomega"
-)
-
-var customFlag string
-
-func init() {
- flag.StringVar(&customFlag, "customFlag", "default", "custom flag!")
-}
-
-var _ = Describe("Testing various flags", func() {
- FDescribe("the focused set", func() {
- Measure("a measurement", func(b Benchmarker) {
- b.RecordValue("a value", 3)
- }, 3)
-
- It("should honor -cover", func() {
- Ω(Tested()).Should(Equal("tested"))
- })
-
- It("should allow gcflags", func() {
- fmt.Printf("NaN returns %T\n", remapped.NaN())
- })
-
- PIt("should honor -failOnPending and -noisyPendings")
-
- Describe("smores", func() {
- It("should honor -skip: marshmallow", func() {
- println("marshmallow")
- })
-
- It("should honor -focus: chocolate", func() {
- println("chocolate")
- })
- })
-
- It("should detect races", func(done Done) {
- var a string
- go func() {
- a = "now you don't"
- close(done)
- }()
- a = "now you see me"
- println(a)
- })
-
- It("should randomize A", func() {
- println("RANDOM_A")
- })
-
- It("should randomize B", func() {
- println("RANDOM_B")
- })
-
- It("should randomize C", func() {
- println("RANDOM_C")
- })
-
- It("should honor -slowSpecThreshold", func() {
- time.Sleep(100 * time.Millisecond)
- })
-
- It("should pass in additional arguments after '--' directly to the test process", func() {
- fmt.Printf("CUSTOM_FLAG: %s", customFlag)
- })
- })
-
- Describe("more smores", func() {
- It("should not run these unless -focus is set", func() {
- println("smores")
- })
- })
-
- Describe("a failing test", func() {
- It("should fail", func() {
- Ω(true).Should(Equal(false))
- })
- })
-
- Describe("a flaky test", func() {
- runs := 0
- It("should only pass the second time it's run", func() {
- runs++
- Ω(runs).Should(BeNumerically("==", 2))
- })
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/focused_fixture/README.md b/vendor/github.com/onsi/ginkgo/integration/_fixtures/focused_fixture/README.md
deleted file mode 100644
index 2b501a25d..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/focused_fixture/README.md
+++ /dev/null
@@ -1 +0,0 @@
-This file should remain the same, regardless the fact that contains FIt, FDescribe, or FWhen.
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/focused_fixture/focused_fixture_suite_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/focused_fixture/focused_fixture_suite_test.go
deleted file mode 100644
index 92d0c6e48..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/focused_fixture/focused_fixture_suite_test.go
+++ /dev/null
@@ -1,13 +0,0 @@
-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")
-}
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/focused_fixture/focused_fixture_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/focused_fixture/focused_fixture_test.go
deleted file mode 100644
index ea500eaf0..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/focused_fixture/focused_fixture_test.go
+++ /dev/null
@@ -1,73 +0,0 @@
-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"),
- )
-})
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/focused_fixture_with_vendor/focused_fixture_suite_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/focused_fixture_with_vendor/focused_fixture_suite_test.go
deleted file mode 100644
index 92d0c6e48..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/focused_fixture_with_vendor/focused_fixture_suite_test.go
+++ /dev/null
@@ -1,13 +0,0 @@
-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")
-}
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/focused_fixture_with_vendor/focused_fixture_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/focused_fixture_with_vendor/focused_fixture_test.go
deleted file mode 100644
index ea500eaf0..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/focused_fixture_with_vendor/focused_fixture_test.go
+++ /dev/null
@@ -1,73 +0,0 @@
-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"),
- )
-})
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/hanging_suite/hanging_suite_suite_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/hanging_suite/hanging_suite_suite_test.go
deleted file mode 100644
index e8dd54b52..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/hanging_suite/hanging_suite_suite_test.go
+++ /dev/null
@@ -1,13 +0,0 @@
-package hanging_suite_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-
- "testing"
-)
-
-func TestHangingSuite(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "HangingSuite Suite")
-}
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/hanging_suite/hanging_suite_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/hanging_suite/hanging_suite_test.go
deleted file mode 100644
index 6a5a070e1..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/hanging_suite/hanging_suite_test.go
+++ /dev/null
@@ -1,30 +0,0 @@
-package hanging_suite_test
-
-import (
- "fmt"
- "time"
-
- . "github.com/onsi/ginkgo"
-)
-
-var _ = AfterSuite(func() {
- fmt.Println("Heading Out After Suite")
-})
-
-var _ = Describe("HangingSuite", func() {
- BeforeEach(func() {
- fmt.Fprintln(GinkgoWriter, "Just beginning")
- })
-
- Context("inner context", func() {
- BeforeEach(func() {
- fmt.Fprintln(GinkgoWriter, "Almost there...")
- })
-
- It("should hang out for a while", func() {
- fmt.Fprintln(GinkgoWriter, "Hanging Out")
- fmt.Println("Sleeping...")
- time.Sleep(time.Hour)
- })
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/more_ginkgo_tests/more_ginkgo_tests.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/more_ginkgo_tests/more_ginkgo_tests.go
deleted file mode 100644
index ca12c0d93..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/more_ginkgo_tests/more_ginkgo_tests.go
+++ /dev/null
@@ -1,5 +0,0 @@
-package more_ginkgo_tests
-
-func AlwaysTrue() bool {
- return true
-}
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/more_ginkgo_tests/more_ginkgo_tests_suite_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/more_ginkgo_tests/more_ginkgo_tests_suite_test.go
deleted file mode 100644
index 1e15c8857..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/more_ginkgo_tests/more_ginkgo_tests_suite_test.go
+++ /dev/null
@@ -1,13 +0,0 @@
-package more_ginkgo_tests_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-
- "testing"
-)
-
-func TestMore_ginkgo_tests(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "More_ginkgo_tests Suite")
-}
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/more_ginkgo_tests/more_ginkgo_tests_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/more_ginkgo_tests/more_ginkgo_tests_test.go
deleted file mode 100644
index 0549f62fb..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/more_ginkgo_tests/more_ginkgo_tests_test.go
+++ /dev/null
@@ -1,17 +0,0 @@
-package more_ginkgo_tests_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/ginkgo/integration/_fixtures/more_ginkgo_tests"
- . "github.com/onsi/gomega"
-)
-
-var _ = Describe("MoreGinkgoTests", func() {
- It("should pass", func() {
- Ω(AlwaysTrue()).Should(BeTrue())
- })
-
- It("should always pass", func() {
- Ω(AlwaysTrue()).Should(BeTrue())
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/no_test_fn/no_test_fn.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/no_test_fn/no_test_fn.go
deleted file mode 100644
index bdf1b54b5..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/no_test_fn/no_test_fn.go
+++ /dev/null
@@ -1,5 +0,0 @@
-package no_test_fn
-
-func StringIdentity(a string) string {
- return a
-}
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/no_test_fn/no_test_fn_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/no_test_fn/no_test_fn_test.go
deleted file mode 100644
index 6c38b1e43..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/no_test_fn/no_test_fn_test.go
+++ /dev/null
@@ -1,13 +0,0 @@
-package no_test_fn_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/ginkgo/integration/_fixtures/no_test_fn"
- . "github.com/onsi/gomega"
-)
-
-var _ = Describe("NoTestFn", func() {
- It("should proxy strings", func() {
- Ω(StringIdentity("foo")).Should(Equal("foo"))
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/no_tests/no_tests.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/no_tests/no_tests.go
deleted file mode 100644
index da29a2cad..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/no_tests/no_tests.go
+++ /dev/null
@@ -1,4 +0,0 @@
-package main
-
-func main() {
-}
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/passing_ginkgo_tests/passing_ginkgo_tests.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/passing_ginkgo_tests/passing_ginkgo_tests.go
deleted file mode 100644
index b710dd129..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/passing_ginkgo_tests/passing_ginkgo_tests.go
+++ /dev/null
@@ -1,9 +0,0 @@
-package passing_ginkgo_tests
-
-func StringIdentity(a string) string {
- return a
-}
-
-func IntegerIdentity(a int) int {
- return a
-}
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/passing_ginkgo_tests/passing_ginkgo_tests_suite_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/passing_ginkgo_tests/passing_ginkgo_tests_suite_test.go
deleted file mode 100644
index 31a3f7d0c..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/passing_ginkgo_tests/passing_ginkgo_tests_suite_test.go
+++ /dev/null
@@ -1,13 +0,0 @@
-package passing_ginkgo_tests_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-
- "testing"
-)
-
-func TestPassing_ginkgo_tests(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "Passing_ginkgo_tests Suite")
-}
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/passing_ginkgo_tests/passing_ginkgo_tests_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/passing_ginkgo_tests/passing_ginkgo_tests_test.go
deleted file mode 100644
index a5822fdd7..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/passing_ginkgo_tests/passing_ginkgo_tests_test.go
+++ /dev/null
@@ -1,30 +0,0 @@
-package passing_ginkgo_tests_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/ginkgo/integration/_fixtures/passing_ginkgo_tests"
- . "github.com/onsi/gomega"
-)
-
-var _ = Describe("PassingGinkgoTests", func() {
- It("should proxy strings", func() {
- Ω(StringIdentity("foo")).Should(Equal("foo"))
- })
-
- It("should proxy integers", func() {
- Ω(IntegerIdentity(3)).Should(Equal(3))
- })
-
- It("should do it again", func() {
- Ω(StringIdentity("foo")).Should(Equal("foo"))
- Ω(IntegerIdentity(3)).Should(Equal(3))
- })
-
- It("should be able to run Bys", func() {
- By("emitting one By")
- Ω(3).Should(Equal(3))
-
- By("emitting another By")
- Ω(4).Should(Equal(4))
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/passing_suite_setup/passing_suite_setup_suite_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/passing_suite_setup/passing_suite_setup_suite_test.go
deleted file mode 100644
index 86c9aa2ab..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/passing_suite_setup/passing_suite_setup_suite_test.go
+++ /dev/null
@@ -1,26 +0,0 @@
-package passing_before_suite_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-
- "testing"
-)
-
-func TestPassingSuiteSetup(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "PassingSuiteSetup Suite")
-}
-
-var a string
-var b string
-
-var _ = BeforeSuite(func() {
- a = "ran before suite"
- println("BEFORE SUITE")
-})
-
-var _ = AfterSuite(func() {
- b = "ran after suite"
- println("AFTER SUITE")
-})
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/passing_suite_setup/passing_suite_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/passing_suite_setup/passing_suite_test.go
deleted file mode 100644
index f139e1d22..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/passing_suite_setup/passing_suite_test.go
+++ /dev/null
@@ -1,28 +0,0 @@
-package passing_before_suite_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-)
-
-var _ = Describe("PassingSuiteSetup", func() {
- It("should pass", func() {
- Ω(a).Should(Equal("ran before suite"))
- Ω(b).Should(BeEmpty())
- })
-
- It("should pass", func() {
- Ω(a).Should(Equal("ran before suite"))
- Ω(b).Should(BeEmpty())
- })
-
- It("should pass", func() {
- Ω(a).Should(Equal("ran before suite"))
- Ω(b).Should(BeEmpty())
- })
-
- It("should pass", func() {
- Ω(a).Should(Equal("ran before suite"))
- Ω(b).Should(BeEmpty())
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/progress_fixture/progress_fixture_suite_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/progress_fixture/progress_fixture_suite_test.go
deleted file mode 100644
index 74262bbc1..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/progress_fixture/progress_fixture_suite_test.go
+++ /dev/null
@@ -1,13 +0,0 @@
-package progress_fixture_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-
- "testing"
-)
-
-func TestProgressFixture(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "ProgressFixture Suite")
-}
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/progress_fixture/progress_fixture_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/progress_fixture/progress_fixture_test.go
deleted file mode 100644
index b7f26c25b..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/progress_fixture/progress_fixture_test.go
+++ /dev/null
@@ -1,49 +0,0 @@
-package progress_fixture_test
-
-import (
- "fmt"
-
- . "github.com/onsi/ginkgo"
-)
-
-var _ = Describe("ProgressFixture", func() {
- BeforeEach(func() {
- fmt.Fprintln(GinkgoWriter, ">outer before<")
- })
-
- JustBeforeEach(func() {
- fmt.Fprintln(GinkgoWriter, ">outer just before<")
- })
-
- AfterEach(func() {
- fmt.Fprintln(GinkgoWriter, ">outer after<")
- })
-
- Context("Inner Context", func() {
- BeforeEach(func() {
- fmt.Fprintln(GinkgoWriter, ">inner before<")
- })
-
- JustBeforeEach(func() {
- fmt.Fprintln(GinkgoWriter, ">inner just before<")
- })
-
- AfterEach(func() {
- fmt.Fprintln(GinkgoWriter, ">inner after<")
- })
-
- When("Inner When", func() {
- BeforeEach(func() {
- fmt.Fprintln(GinkgoWriter, ">inner before<")
- })
-
- It("should emit progress as it goes", func() {
- fmt.Fprintln(GinkgoWriter, ">it<")
- })
- })
- })
-
- Specify("should emit progress as it goes", func() {
- fmt.Fprintln(GinkgoWriter, ">specify<")
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/skip_fixture/skip_fixture_suite_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/skip_fixture/skip_fixture_suite_test.go
deleted file mode 100644
index b2028cf55..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/skip_fixture/skip_fixture_suite_test.go
+++ /dev/null
@@ -1,13 +0,0 @@
-package fail_fixture_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-
- "testing"
-)
-
-func TestFail_fixture(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "Skip_fixture Suite")
-}
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/skip_fixture/skip_fixture_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/skip_fixture/skip_fixture_test.go
deleted file mode 100644
index e406aeb46..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/skip_fixture/skip_fixture_test.go
+++ /dev/null
@@ -1,71 +0,0 @@
-package fail_fixture_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-)
-
-var _ = It("handles top level skips", func() {
- Skip("a top level skip on line 9")
- println("NEVER SEE THIS")
-})
-
-var _ = It("handles async top level skips", func(done Done) {
- Skip("an async top level skip on line 14")
- println("NEVER SEE THIS")
-}, 0.1)
-
-var _ = It("SKIP in a goroutine", func(done Done) {
- go func() {
- defer GinkgoRecover()
- Skip("a top level goroutine skip on line 21")
- println("NEVER SEE THIS")
- }()
-}, 0.1)
-
-var _ = Describe("Excercising different skip modes", func() {
- It("synchronous skip", func() {
- Skip("a sync SKIP")
- println("NEVER SEE THIS")
- })
-
- It("async skip", func(done Done) {
- Skip("an async SKIP")
- println("NEVER SEE THIS")
- }, 0.1)
-
- It("SKIP in a goroutine", func(done Done) {
- go func() {
- defer GinkgoRecover()
- Skip("a goroutine SKIP")
- println("NEVER SEE THIS")
- }()
- }, 0.1)
-
- Measure("a SKIP measure", func(Benchmarker) {
- Skip("a measure SKIP")
- println("NEVER SEE THIS")
- }, 1)
-})
-
-var _ = Describe("SKIP in a BeforeEach", func() {
- BeforeEach(func() {
- Skip("a BeforeEach SKIP")
- println("NEVER SEE THIS")
- })
-
- It("a SKIP BeforeEach", func() {
- println("NEVER SEE THIS")
- })
-})
-
-var _ = Describe("SKIP in an AfterEach", func() {
- AfterEach(func() {
- Skip("an AfterEach SKIP")
- println("NEVER SEE THIS")
- })
-
- It("a SKIP AfterEach", func() {
- Expect(true).To(BeTrue())
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/suite_command_tests/suite_command.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/suite_command_tests/suite_command.go
deleted file mode 100644
index 1d6704881..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/suite_command_tests/suite_command.go
+++ /dev/null
@@ -1,9 +0,0 @@
-package suite_command
-
-func Tested() string {
- return "tested"
-}
-
-func Untested() string {
- return "untested"
-}
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/suite_command_tests/suite_command_suite_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/suite_command_tests/suite_command_suite_test.go
deleted file mode 100644
index 7f76d8b8f..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/suite_command_tests/suite_command_suite_test.go
+++ /dev/null
@@ -1,13 +0,0 @@
-package suite_command_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-
- "testing"
-)
-
-func TestSuiteCommand(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "Suite Command Suite")
-}
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/suite_command_tests/suite_command_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/suite_command_tests/suite_command_test.go
deleted file mode 100644
index e083d27a2..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/suite_command_tests/suite_command_test.go
+++ /dev/null
@@ -1,18 +0,0 @@
-package suite_command_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-)
-
-var _ = Describe("Testing suite command", func() {
- It("it should succeed", func() {
- Ω(true).Should(Equal(true))
- })
-
- PIt("a failing test", func() {
- It("should fail", func() {
- Ω(true).Should(Equal(false))
- })
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/synchronized_setup_tests/synchronized_setup_tests_suite_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/synchronized_setup_tests/synchronized_setup_tests_suite_test.go
deleted file mode 100644
index b734854ee..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/synchronized_setup_tests/synchronized_setup_tests_suite_test.go
+++ /dev/null
@@ -1,43 +0,0 @@
-package synchronized_setup_tests_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-
- "fmt"
- "testing"
- "time"
-)
-
-func TestSynchronized_setup_tests(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "Synchronized_setup_tests Suite")
-}
-
-var beforeData string
-
-var _ = SynchronizedBeforeSuite(func() []byte {
- fmt.Printf("BEFORE_A_%d\n", GinkgoParallelNode())
- time.Sleep(100 * time.Millisecond)
- return []byte("DATA")
-}, func(data []byte) {
- fmt.Printf("BEFORE_B_%d: %s\n", GinkgoParallelNode(), string(data))
- beforeData += string(data) + "OTHER"
-})
-
-var _ = SynchronizedAfterSuite(func() {
- fmt.Printf("\nAFTER_A_%d\n", GinkgoParallelNode())
- time.Sleep(100 * time.Millisecond)
-}, func() {
- fmt.Printf("AFTER_B_%d\n", GinkgoParallelNode())
-})
-
-var _ = Describe("Synchronized Setup", func() {
- It("should run the before suite once", func() {
- Ω(beforeData).Should(Equal("DATAOTHER"))
- })
-
- It("should run the before suite once", func() {
- Ω(beforeData).Should(Equal("DATAOTHER"))
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/tags_tests/ignored_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/tags_tests/ignored_test.go
deleted file mode 100644
index 517623536..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/tags_tests/ignored_test.go
+++ /dev/null
@@ -1,17 +0,0 @@
-// +build complex_tests
-
-package tags_tests_test
-
-import (
- . "github.com/onsi/ginkgo"
-)
-
-var _ = Describe("Ignored", func() {
- It("should not have these tests", func() {
-
- })
-
- It("should not have these tests", func() {
-
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/tags_tests/tags_tests_suite_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/tags_tests/tags_tests_suite_test.go
deleted file mode 100644
index dcb11bb1b..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/tags_tests/tags_tests_suite_test.go
+++ /dev/null
@@ -1,13 +0,0 @@
-package tags_tests_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-
- "testing"
-)
-
-func TestTagsTests(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "TagsTests Suite")
-}
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/tags_tests/tags_tests_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/tags_tests/tags_tests_test.go
deleted file mode 100644
index b91a8923a..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/tags_tests/tags_tests_test.go
+++ /dev/null
@@ -1,11 +0,0 @@
-package tags_tests_test
-
-import (
- . "github.com/onsi/ginkgo"
-)
-
-var _ = Describe("TagsTests", func() {
- It("should have a test", func() {
-
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/test_description/test_description_suite_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/test_description/test_description_suite_test.go
deleted file mode 100644
index 8976370d3..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/test_description/test_description_suite_test.go
+++ /dev/null
@@ -1,13 +0,0 @@
-package test_description_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-
- "testing"
-)
-
-func TestTestDescription(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "TestDescription Suite")
-}
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/test_description/test_description_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/test_description/test_description_test.go
deleted file mode 100644
index 53c2779ea..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/test_description/test_description_test.go
+++ /dev/null
@@ -1,23 +0,0 @@
-package test_description_test
-
-import (
- "fmt"
-
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-)
-
-var _ = Describe("TestDescription", func() {
- It("should pass", func() {
- Ω(true).Should(BeTrue())
- })
-
- It("should fail", func() {
- Ω(true).Should(BeFalse())
- })
-
- AfterEach(func() {
- description := CurrentGinkgoTestDescription()
- fmt.Printf("%s:%t\n", description.FullTestText, description.Failed)
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/A/A.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/A/A.go
deleted file mode 100644
index de2c6bbb7..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/A/A.go
+++ /dev/null
@@ -1,7 +0,0 @@
-package A
-
-import "github.com/onsi/B"
-
-func DoIt() string {
- return B.DoIt()
-}
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/A/A_suite_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/A/A_suite_test.go
deleted file mode 100644
index 1b6cff4c7..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/A/A_suite_test.go
+++ /dev/null
@@ -1,13 +0,0 @@
-package A_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-
- "testing"
-)
-
-func TestA(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "A Suite")
-}
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/A/A_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/A/A_test.go
deleted file mode 100644
index 003530aae..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/A/A_test.go
+++ /dev/null
@@ -1,14 +0,0 @@
-package A_test
-
-import (
- . "github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/A"
-
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-)
-
-var _ = Describe("A", func() {
- It("should do it", func() {
- Ω(DoIt()).Should(Equal("done!"))
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/B/B.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/B/B.go
deleted file mode 100644
index 990bab365..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/B/B.go
+++ /dev/null
@@ -1,7 +0,0 @@
-package B
-
-import "github.com/onsi/C"
-
-func DoIt() string {
- return C.DoIt()
-}
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/B/B_suite_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/B/B_suite_test.go
deleted file mode 100644
index e54fce668..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/B/B_suite_test.go
+++ /dev/null
@@ -1,13 +0,0 @@
-package B_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-
- "testing"
-)
-
-func TestB(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "B Suite")
-}
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/B/B_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/B/B_test.go
deleted file mode 100644
index b147913c0..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/B/B_test.go
+++ /dev/null
@@ -1,14 +0,0 @@
-package B_test
-
-import (
- . "github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/B"
-
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-)
-
-var _ = Describe("B", func() {
- It("should do it", func() {
- Ω(DoIt()).Should(Equal("done!"))
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/C/C.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/C/C.go
deleted file mode 100644
index 205b68886..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/C/C.go
+++ /dev/null
@@ -1,5 +0,0 @@
-package C
-
-func DoIt() string {
- return "done!"
-}
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/C/C.json b/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/C/C.json
deleted file mode 100644
index 421d025e0..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/C/C.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "fixture": "data"
-} \ No newline at end of file
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/C/C_suite_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/C/C_suite_test.go
deleted file mode 100644
index 57a7a96ba..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/C/C_suite_test.go
+++ /dev/null
@@ -1,13 +0,0 @@
-package C_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-
- "testing"
-)
-
-func TestC(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "C Suite")
-}
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/C/C_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/C/C_test.go
deleted file mode 100644
index 7703fefa3..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/C/C_test.go
+++ /dev/null
@@ -1,14 +0,0 @@
-package C_test
-
-import (
- . "github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/C"
-
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-)
-
-var _ = Describe("C", func() {
- It("should do it", func() {
- Ω(DoIt()).Should(Equal("done!"))
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/D/D.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/D/D.go
deleted file mode 100644
index 4371b852f..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/D/D.go
+++ /dev/null
@@ -1,7 +0,0 @@
-package D
-
-import "github.com/onsi/C"
-
-func DoIt() string {
- return C.DoIt()
-}
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/D/D_suite_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/D/D_suite_test.go
deleted file mode 100644
index 0ebefe6b7..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/D/D_suite_test.go
+++ /dev/null
@@ -1,13 +0,0 @@
-package D_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-
- "testing"
-)
-
-func TestD(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "D Suite")
-}
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/D/D_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/D/D_test.go
deleted file mode 100644
index 097945bf9..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/D/D_test.go
+++ /dev/null
@@ -1,14 +0,0 @@
-package D_test
-
-import (
- . "github.com/onsi/ginkgo/integration/_fixtures/watch_fixtures/C"
-
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-)
-
-var _ = Describe("D", func() {
- It("should do it", func() {
- Ω(DoIt()).Should(Equal("done!"))
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/xunit_tests/xunit_tests.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/xunit_tests/xunit_tests.go
deleted file mode 100644
index cb8fc8bc2..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/xunit_tests/xunit_tests.go
+++ /dev/null
@@ -1,5 +0,0 @@
-package xunit_tests
-
-func AlwaysTrue() bool {
- return true
-}
diff --git a/vendor/github.com/onsi/ginkgo/integration/_fixtures/xunit_tests/xunit_tests_test.go b/vendor/github.com/onsi/ginkgo/integration/_fixtures/xunit_tests/xunit_tests_test.go
deleted file mode 100644
index a6ebbe147..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/_fixtures/xunit_tests/xunit_tests_test.go
+++ /dev/null
@@ -1,11 +0,0 @@
-package xunit_tests
-
-import (
- "testing"
-)
-
-func TestAlwaysTrue(t *testing.T) {
- if AlwaysTrue() != true {
- t.Errorf("Expected true, got false")
- }
-}
diff --git a/vendor/github.com/onsi/ginkgo/integration/convert_test.go b/vendor/github.com/onsi/ginkgo/integration/convert_test.go
deleted file mode 100644
index f4fd678c5..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/convert_test.go
+++ /dev/null
@@ -1,121 +0,0 @@
-package integration_test
-
-import (
- "io/ioutil"
- "os"
- "os/exec"
- "path/filepath"
- "strings"
-
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-)
-
-var _ = Describe("ginkgo convert", func() {
- var tmpDir string
-
- readConvertedFileNamed := func(pathComponents ...string) string {
- pathToFile := filepath.Join(tmpDir, "convert_fixtures", filepath.Join(pathComponents...))
- bytes, err := ioutil.ReadFile(pathToFile)
- ExpectWithOffset(1, err).NotTo(HaveOccurred())
-
- return string(bytes)
- }
-
- readGoldMasterNamed := func(filename string) string {
- bytes, err := ioutil.ReadFile(filepath.Join("_fixtures", "convert_goldmasters", filename))
- Ω(err).ShouldNot(HaveOccurred())
-
- return string(bytes)
- }
-
- BeforeEach(func() {
- var err error
-
- tmpDir, err = ioutil.TempDir("", "ginkgo-convert")
- Ω(err).ShouldNot(HaveOccurred())
-
- err = exec.Command("cp", "-r", filepath.Join("_fixtures", "convert_fixtures"), tmpDir).Run()
- Ω(err).ShouldNot(HaveOccurred())
- })
-
- JustBeforeEach(func() {
- cwd, err := os.Getwd()
- Ω(err).ShouldNot(HaveOccurred())
-
- relPath, err := filepath.Rel(cwd, filepath.Join(tmpDir, "convert_fixtures"))
- Ω(err).ShouldNot(HaveOccurred())
-
- cmd := exec.Command(pathToGinkgo, "convert", relPath)
- cmd.Env = os.Environ()
- for i, env := range cmd.Env {
- if strings.HasPrefix(env, "PATH") {
- cmd.Env[i] = cmd.Env[i] + ":" + filepath.Dir(pathToGinkgo)
- break
- }
- }
- err = cmd.Run()
- Ω(err).ShouldNot(HaveOccurred())
- })
-
- AfterEach(func() {
- err := os.RemoveAll(tmpDir)
- Ω(err).ShouldNot(HaveOccurred())
- })
-
- It("rewrites xunit tests as ginkgo tests", func() {
- convertedFile := readConvertedFileNamed("xunit_test.go")
- goldMaster := readGoldMasterNamed("xunit_test.go")
- Ω(convertedFile).Should(Equal(goldMaster))
- })
-
- It("rewrites all usages of *testing.T as mr.T()", func() {
- convertedFile := readConvertedFileNamed("extra_functions_test.go")
- goldMaster := readGoldMasterNamed("extra_functions_test.go")
- Ω(convertedFile).Should(Equal(goldMaster))
- })
-
- It("rewrites tests in the package dir that belong to other packages", func() {
- convertedFile := readConvertedFileNamed("outside_package_test.go")
- goldMaster := readGoldMasterNamed("outside_package_test.go")
- Ω(convertedFile).Should(Equal(goldMaster))
- })
-
- It("rewrites tests in nested packages", func() {
- convertedFile := readConvertedFileNamed("nested", "nested_test.go")
- goldMaster := readGoldMasterNamed("nested_test.go")
- Ω(convertedFile).Should(Equal(goldMaster))
- })
-
- Context("ginkgo test suite files", func() {
- It("creates a ginkgo test suite file for the package you specified", func() {
- testsuite := readConvertedFileNamed("convert_fixtures_suite_test.go")
- goldMaster := readGoldMasterNamed("suite_test.go")
- Ω(testsuite).Should(Equal(goldMaster))
- })
-
- It("converts go tests in deeply nested packages (some may not contain go files)", func() {
- testsuite := readConvertedFileNamed("nested_without_gofiles", "subpackage", "nested_subpackage_test.go")
- goldMaster := readGoldMasterNamed("nested_subpackage_test.go")
- Ω(testsuite).Should(Equal(goldMaster))
- })
-
- It("creates ginkgo test suites for all nested packages", func() {
- testsuite := readConvertedFileNamed("nested", "nested_suite_test.go")
- goldMaster := readGoldMasterNamed("nested_suite_test.go")
- Ω(testsuite).Should(Equal(goldMaster))
- })
- })
-
- Context("with an existing test suite file", func() {
- BeforeEach(func() {
- goldMaster := readGoldMasterNamed("fixtures_suite_test.go")
- err := ioutil.WriteFile(filepath.Join(tmpDir, "convert_fixtures", "tmp_suite_test.go"), []byte(goldMaster), 0600)
- Ω(err).ShouldNot(HaveOccurred())
- })
-
- It("gracefully handles existing test suite files", func() {
- //nothing should have gone wrong!
- })
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/integration/coverage_test.go b/vendor/github.com/onsi/ginkgo/integration/coverage_test.go
deleted file mode 100644
index a1d24bfed..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/coverage_test.go
+++ /dev/null
@@ -1,147 +0,0 @@
-package integration_test
-
-import (
- "os/exec"
-
- "fmt"
-
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
- "github.com/onsi/gomega/gbytes"
- "github.com/onsi/gomega/gexec"
-)
-
-var _ = Describe("Coverage Specs", func() {
- Context("when it runs coverage analysis in series and in parallel", func() {
- AfterEach(func() {
- removeSuccessfully("./_fixtures/coverage_fixture/coverage_fixture.coverprofile")
- })
- It("works", func() {
- session := startGinkgo("./_fixtures/coverage_fixture", "-cover")
- Eventually(session).Should(gexec.Exit(0))
-
- Ω(session.Out).Should(gbytes.Say(("coverage: 80.0% of statements")))
-
- coverFile := "./_fixtures/coverage_fixture/coverage_fixture.coverprofile"
- serialCoverProfileOutput, err := exec.Command("go", "tool", "cover", fmt.Sprintf("-func=%s", coverFile)).CombinedOutput()
- Ω(err).ShouldNot(HaveOccurred())
-
- removeSuccessfully(coverFile)
-
- Eventually(startGinkgo("./_fixtures/coverage_fixture", "-cover", "-nodes=4")).Should(gexec.Exit(0))
-
- parallelCoverProfileOutput, err := exec.Command("go", "tool", "cover", fmt.Sprintf("-func=%s", coverFile)).CombinedOutput()
- Ω(err).ShouldNot(HaveOccurred())
-
- Ω(parallelCoverProfileOutput).Should(Equal(serialCoverProfileOutput))
-
- By("handling external packages", func() {
- session = startGinkgo("./_fixtures/coverage_fixture", "-coverpkg=github.com/onsi/ginkgo/integration/_fixtures/coverage_fixture,github.com/onsi/ginkgo/integration/_fixtures/coverage_fixture/external_coverage_fixture")
- Eventually(session).Should(gexec.Exit(0))
-
- Ω(session.Out).Should(gbytes.Say("coverage: 71.4% of statements in github.com/onsi/ginkgo/integration/_fixtures/coverage_fixture, github.com/onsi/ginkgo/integration/_fixtures/coverage_fixture/external_coverage_fixture"))
-
- serialCoverProfileOutput, err = exec.Command("go", "tool", "cover", fmt.Sprintf("-func=%s", coverFile)).CombinedOutput()
- Ω(err).ShouldNot(HaveOccurred())
-
- removeSuccessfully("./_fixtures/coverage_fixture/coverage_fixture.coverprofile")
-
- Eventually(startGinkgo("./_fixtures/coverage_fixture", "-coverpkg=github.com/onsi/ginkgo/integration/_fixtures/coverage_fixture,github.com/onsi/ginkgo/integration/_fixtures/coverage_fixture/external_coverage_fixture", "-nodes=4")).Should(gexec.Exit(0))
-
- parallelCoverProfileOutput, err = exec.Command("go", "tool", "cover", fmt.Sprintf("-func=%s", coverFile)).CombinedOutput()
- Ω(err).ShouldNot(HaveOccurred())
-
- Ω(parallelCoverProfileOutput).Should(Equal(serialCoverProfileOutput))
- })
- })
- })
-
- Context("when a custom profile name is specified", func() {
- AfterEach(func() {
- removeSuccessfully("./_fixtures/coverage_fixture/coverage.txt")
- })
-
- It("generates cover profiles with the specified name", func() {
- session := startGinkgo("./_fixtures/coverage_fixture", "-cover", "-coverprofile=coverage.txt")
- Eventually(session).Should(gexec.Exit(0))
-
- Ω("./_fixtures/coverage_fixture/coverage.txt").Should(BeARegularFile())
- })
- })
-
- Context("when run in recursive mode", func() {
- AfterEach(func() {
- removeSuccessfully("./_fixtures/combined_coverage_fixture/coverage-recursive.txt")
- removeSuccessfully("./_fixtures/combined_coverage_fixture/first_package/coverage-recursive.txt")
- removeSuccessfully("./_fixtures/combined_coverage_fixture/second_package/coverage-recursive.txt")
- })
-
- It("generates a coverage file per package", func() {
- session := startGinkgo("./_fixtures/combined_coverage_fixture", "-r", "-cover", "-coverprofile=coverage-recursive.txt")
- Eventually(session).Should(gexec.Exit(0))
-
- Ω("./_fixtures/combined_coverage_fixture/first_package/coverage-recursive.txt").Should(BeARegularFile())
- Ω("./_fixtures/combined_coverage_fixture/second_package/coverage-recursive.txt").Should(BeARegularFile())
- })
- })
-
- Context("when run in parallel mode", func() {
- AfterEach(func() {
- removeSuccessfully("./_fixtures/coverage_fixture/coverage-parallel.txt")
- })
-
- It("works", func() {
- session := startGinkgo("./_fixtures/coverage_fixture", "-p", "-cover", "-coverprofile=coverage-parallel.txt")
-
- Eventually(session).Should(gexec.Exit(0))
-
- Ω("./_fixtures/coverage_fixture/coverage-parallel.txt").Should(BeARegularFile())
- })
- })
-
- Context("when run in recursive mode specifying a coverprofile", func() {
- AfterEach(func() {
- removeSuccessfully("./_fixtures/combined_coverage_fixture/coverprofile-recursive.txt")
- removeSuccessfully("./_fixtures/combined_coverage_fixture/first_package/coverprofile-recursive.txt")
- removeSuccessfully("./_fixtures/combined_coverage_fixture/second_package/coverprofile-recursive.txt")
- })
-
- It("combines the coverages", func() {
- session := startGinkgo("./_fixtures/combined_coverage_fixture", "-outputdir=./", "-r", "-cover", "-coverprofile=coverprofile-recursive.txt")
- Eventually(session).Should(gexec.Exit(0))
-
- By("generating a combined coverage file", func() {
- Ω("./_fixtures/combined_coverage_fixture/coverprofile-recursive.txt").Should(BeARegularFile())
- })
-
- By("also generating the single package coverage files", func() {
- Ω("./_fixtures/combined_coverage_fixture/first_package/coverprofile-recursive.txt").Should(BeARegularFile())
- Ω("./_fixtures/combined_coverage_fixture/second_package/coverprofile-recursive.txt").Should(BeARegularFile())
- })
- })
- })
-
- It("Fails with an error if output dir and coverprofile were set, but the output dir did not exist", func() {
- session := startGinkgo("./_fixtures/combined_coverage_fixture", "-outputdir=./all/profiles/here", "-r", "-cover", "-coverprofile=coverage.txt")
-
- Eventually(session).Should(gexec.Exit(1))
- output := session.Out.Contents()
- Ω(string(output)).Should(ContainSubstring("Unable to create combined profile, outputdir does not exist: ./all/profiles/here"))
- })
-
- Context("when only output dir was set", func() {
- AfterEach(func() {
- removeSuccessfully("./_fixtures/combined_coverage_fixture/first_package.coverprofile")
- removeSuccessfully("./_fixtures/combined_coverage_fixture/first_package/coverage.txt")
- removeSuccessfully("./_fixtures/combined_coverage_fixture/second_package.coverprofile")
- removeSuccessfully("./_fixtures/combined_coverage_fixture/second_package/coverage.txt")
- })
- It("moves coverages", func() {
- session := startGinkgo("./_fixtures/combined_coverage_fixture", "-outputdir=./", "-r", "-cover")
- Eventually(session).Should(gexec.Exit(0))
-
- Ω("./_fixtures/combined_coverage_fixture/first_package.coverprofile").Should(BeARegularFile())
- Ω("./_fixtures/combined_coverage_fixture/second_package.coverprofile").Should(BeARegularFile())
- })
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/integration/fail_test.go b/vendor/github.com/onsi/ginkgo/integration/fail_test.go
deleted file mode 100644
index 53b2a67b4..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/fail_test.go
+++ /dev/null
@@ -1,55 +0,0 @@
-package integration_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
- "github.com/onsi/gomega/gexec"
-)
-
-var _ = Describe("Failing Specs", func() {
- var pathToTest string
-
- BeforeEach(func() {
- pathToTest = tmpPath("failing")
- copyIn(fixturePath("fail_fixture"), pathToTest, false)
- })
-
- It("should fail in all the possible ways", func() {
- session := startGinkgo(pathToTest, "--noColor")
- Eventually(session).Should(gexec.Exit(1))
- output := string(session.Out.Contents())
-
- Ω(output).ShouldNot(ContainSubstring("NEVER SEE THIS"))
-
- Ω(output).Should(ContainSubstring("a top level failure on line 9"))
- Ω(output).Should(ContainSubstring("fail_fixture_test.go:9"))
- Ω(output).Should(ContainSubstring("an async top level failure on line 14"))
- Ω(output).Should(ContainSubstring("fail_fixture_test.go:14"))
- Ω(output).Should(ContainSubstring("a top level goroutine failure on line 21"))
- Ω(output).Should(ContainSubstring("fail_fixture_test.go:21"))
-
- Ω(output).Should(ContainSubstring("a sync failure"))
- Ω(output).Should(MatchRegexp(`Test Panicked\n\s+a sync panic`))
- Ω(output).Should(ContainSubstring("a sync FAIL failure"))
- Ω(output).Should(ContainSubstring("async timeout [It]"))
- Ω(output).Should(ContainSubstring("Timed out"))
- Ω(output).Should(ContainSubstring("an async failure"))
- Ω(output).Should(MatchRegexp(`Test Panicked\n\s+an async panic`))
- Ω(output).Should(ContainSubstring("an async FAIL failure"))
- Ω(output).Should(ContainSubstring("a goroutine FAIL failure"))
- Ω(output).Should(ContainSubstring("a goroutine failure"))
- Ω(output).Should(MatchRegexp(`Test Panicked\n\s+a goroutine panic`))
- Ω(output).Should(ContainSubstring("a measure failure"))
- Ω(output).Should(ContainSubstring("a measure FAIL failure"))
- Ω(output).Should(MatchRegexp(`Test Panicked\n\s+a measure panic`))
-
- Ω(output).Should(ContainSubstring("a top level specify"))
- Ω(output).ShouldNot(ContainSubstring("ginkgo_dsl.go"))
- // depending on the go version this could be the first line of the Specify
- // block (>= go1.9) or the last line of the Specify block (< go1.9)
- Ω(output).Should(Or(ContainSubstring("fail_fixture_test.go:101"), ContainSubstring("fail_fixture_test.go:103")))
- Ω(output).Should(ContainSubstring("fail_fixture_test.go:102"))
-
- Ω(output).Should(ContainSubstring("0 Passed | 17 Failed"))
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/integration/flags_test.go b/vendor/github.com/onsi/ginkgo/integration/flags_test.go
deleted file mode 100644
index d84eb46cc..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/flags_test.go
+++ /dev/null
@@ -1,237 +0,0 @@
-package integration_test
-
-import (
- "io/ioutil"
- "os"
- "path/filepath"
- "strings"
-
- . "github.com/onsi/ginkgo"
- "github.com/onsi/ginkgo/types"
- . "github.com/onsi/gomega"
- "github.com/onsi/gomega/gexec"
-)
-
-var _ = Describe("Flags Specs", func() {
- var pathToTest string
-
- BeforeEach(func() {
- pathToTest = tmpPath("flags")
- copyIn(fixturePath("flags_tests"), pathToTest, false)
- })
-
- getRandomOrders := func(output string) []int {
- return []int{strings.Index(output, "RANDOM_A"), strings.Index(output, "RANDOM_B"), strings.Index(output, "RANDOM_C")}
- }
-
- It("normally passes, runs measurements, prints out noisy pendings, does not randomize tests, and honors the programmatic focus", func() {
- session := startGinkgo(pathToTest, "--noColor")
- Eventually(session).Should(gexec.Exit(types.GINKGO_FOCUS_EXIT_CODE))
- output := string(session.Out.Contents())
-
- Ω(output).Should(ContainSubstring("Ran 3 samples:"), "has a measurement")
- Ω(output).Should(ContainSubstring("11 Passed"))
- Ω(output).Should(ContainSubstring("0 Failed"))
- Ω(output).Should(ContainSubstring("1 Pending"))
- Ω(output).Should(ContainSubstring("3 Skipped"))
- Ω(output).Should(ContainSubstring("[PENDING]"))
- Ω(output).Should(ContainSubstring("marshmallow"))
- Ω(output).Should(ContainSubstring("chocolate"))
- Ω(output).Should(ContainSubstring("CUSTOM_FLAG: default"))
- Ω(output).Should(ContainSubstring("Detected Programmatic Focus - setting exit status to %d", types.GINKGO_FOCUS_EXIT_CODE))
- Ω(output).ShouldNot(ContainSubstring("smores"))
- Ω(output).ShouldNot(ContainSubstring("SLOW TEST"))
- Ω(output).ShouldNot(ContainSubstring("should honor -slowSpecThreshold"))
-
- orders := getRandomOrders(output)
- Ω(orders[0]).Should(BeNumerically("<", orders[1]))
- Ω(orders[1]).Should(BeNumerically("<", orders[2]))
- })
-
- It("should run a coverprofile when passed -cover", func() {
- session := startGinkgo(pathToTest, "--noColor", "--cover", "--focus=the focused set")
- Eventually(session).Should(gexec.Exit(0))
- output := string(session.Out.Contents())
-
- _, err := os.Stat(filepath.Join(pathToTest, "flags.coverprofile"))
- Ω(err).ShouldNot(HaveOccurred())
- Ω(output).Should(ContainSubstring("coverage: "))
- })
-
- It("should fail when there are pending tests and it is passed --failOnPending", func() {
- session := startGinkgo(pathToTest, "--noColor", "--failOnPending")
- Eventually(session).Should(gexec.Exit(1))
- })
-
- It("should fail if the test suite takes longer than the timeout", func() {
- session := startGinkgo(pathToTest, "--noColor", "--timeout=1ms")
- Eventually(session).Should(gexec.Exit(1))
- })
-
- It("should not print out pendings when --noisyPendings=false", func() {
- session := startGinkgo(pathToTest, "--noColor", "--noisyPendings=false")
- Eventually(session).Should(gexec.Exit(types.GINKGO_FOCUS_EXIT_CODE))
- output := string(session.Out.Contents())
-
- Ω(output).ShouldNot(ContainSubstring("[PENDING]"))
- Ω(output).Should(ContainSubstring("1 Pending"))
- })
-
- It("should override the programmatic focus when told to focus", func() {
- session := startGinkgo(pathToTest, "--noColor", "--focus=smores")
- Eventually(session).Should(gexec.Exit(0))
- output := string(session.Out.Contents())
-
- Ω(output).Should(ContainSubstring("marshmallow"))
- Ω(output).Should(ContainSubstring("chocolate"))
- Ω(output).Should(ContainSubstring("smores"))
- Ω(output).Should(ContainSubstring("3 Passed"))
- Ω(output).Should(ContainSubstring("0 Failed"))
- Ω(output).Should(ContainSubstring("0 Pending"))
- Ω(output).Should(ContainSubstring("12 Skipped"))
- })
-
- It("should override the programmatic focus when told to skip", func() {
- session := startGinkgo(pathToTest, "--noColor", "--skip=marshmallow|failing|flaky")
- Eventually(session).Should(gexec.Exit(0))
- output := string(session.Out.Contents())
-
- Ω(output).ShouldNot(ContainSubstring("marshmallow"))
- Ω(output).Should(ContainSubstring("chocolate"))
- Ω(output).Should(ContainSubstring("smores"))
- Ω(output).Should(ContainSubstring("11 Passed"))
- Ω(output).Should(ContainSubstring("0 Failed"))
- Ω(output).Should(ContainSubstring("1 Pending"))
- Ω(output).Should(ContainSubstring("3 Skipped"))
- })
-
- It("should run the race detector when told to", func() {
- session := startGinkgo(pathToTest, "--noColor", "--race")
- Eventually(session).Should(gexec.Exit(types.GINKGO_FOCUS_EXIT_CODE))
- output := string(session.Out.Contents())
-
- Ω(output).Should(ContainSubstring("WARNING: DATA RACE"))
- })
-
- It("should randomize tests when told to", func() {
- session := startGinkgo(pathToTest, "--noColor", "--randomizeAllSpecs", "--seed=17")
- Eventually(session).Should(gexec.Exit(types.GINKGO_FOCUS_EXIT_CODE))
- output := string(session.Out.Contents())
-
- orders := getRandomOrders(output)
- Ω(orders[0]).ShouldNot(BeNumerically("<", orders[1]))
- })
-
- It("should skip measurements when told to", func() {
- session := startGinkgo(pathToTest, "--skipMeasurements")
- Eventually(session).Should(gexec.Exit(types.GINKGO_FOCUS_EXIT_CODE))
- output := string(session.Out.Contents())
-
- Ω(output).ShouldNot(ContainSubstring("Ran 3 samples:"), "has a measurement")
- Ω(output).Should(ContainSubstring("4 Skipped"))
- })
-
- It("should watch for slow specs", func() {
- session := startGinkgo(pathToTest, "--slowSpecThreshold=0.05")
- Eventually(session).Should(gexec.Exit(types.GINKGO_FOCUS_EXIT_CODE))
- output := string(session.Out.Contents())
-
- Ω(output).Should(ContainSubstring("SLOW TEST"))
- Ω(output).Should(ContainSubstring("should honor -slowSpecThreshold"))
- })
-
- It("should pass additional arguments in", func() {
- session := startGinkgo(pathToTest, "--", "--customFlag=madagascar")
- Eventually(session).Should(gexec.Exit(types.GINKGO_FOCUS_EXIT_CODE))
- output := string(session.Out.Contents())
-
- Ω(output).Should(ContainSubstring("CUSTOM_FLAG: madagascar"))
- })
-
- It("should print out full stack traces for failures when told to", func() {
- session := startGinkgo(pathToTest, "--focus=a failing test", "--trace")
- Eventually(session).Should(gexec.Exit(1))
- output := string(session.Out.Contents())
-
- Ω(output).Should(ContainSubstring("Full Stack Trace"))
- })
-
- It("should fail fast when told to", func() {
- pathToTest = tmpPath("fail")
- copyIn(fixturePath("fail_fixture"), pathToTest, false)
- session := startGinkgo(pathToTest, "--failFast")
- Eventually(session).Should(gexec.Exit(1))
- output := string(session.Out.Contents())
-
- Ω(output).Should(ContainSubstring("1 Failed"))
- Ω(output).Should(ContainSubstring("16 Skipped"))
- })
-
- Context("with a flaky test", func() {
- It("should normally fail", func() {
- session := startGinkgo(pathToTest, "--focus=flaky")
- Eventually(session).Should(gexec.Exit(1))
- })
-
- It("should pass if retries are requested", func() {
- session := startGinkgo(pathToTest, "--focus=flaky --flakeAttempts=2")
- Eventually(session).Should(gexec.Exit(0))
- })
- })
-
- It("should perform a dry run when told to", func() {
- pathToTest = tmpPath("fail")
- copyIn(fixturePath("fail_fixture"), pathToTest, false)
- session := startGinkgo(pathToTest, "--dryRun", "-v")
- Eventually(session).Should(gexec.Exit(0))
- output := string(session.Out.Contents())
-
- Ω(output).Should(ContainSubstring("synchronous failures"))
- Ω(output).Should(ContainSubstring("17 Specs"))
- Ω(output).Should(ContainSubstring("0 Passed"))
- Ω(output).Should(ContainSubstring("0 Failed"))
- })
-
- regextest := func(regexOption string, skipOrFocus string) string {
- pathToTest = tmpPath("passing")
- copyIn(fixturePath("passing_ginkgo_tests"), pathToTest, false)
- session := startGinkgo(pathToTest, regexOption, "--dryRun", "-v", skipOrFocus)
- Eventually(session).Should(gexec.Exit(0))
- return string(session.Out.Contents())
- }
-
- It("regexScansFilePath (enabled) should skip and focus on file names", func() {
- output := regextest("-regexScansFilePath=true", "-skip=/passing/") // everything gets skipped (nothing runs)
- Ω(output).Should(ContainSubstring("0 of 4 Specs"))
- output = regextest("-regexScansFilePath=true", "-focus=/passing/") // everything gets focused (everything runs)
- Ω(output).Should(ContainSubstring("4 of 4 Specs"))
- })
-
- It("regexScansFilePath (disabled) should not effect normal filtering", func() {
- output := regextest("-regexScansFilePath=false", "-skip=/passing/") // nothing gets skipped (everything runs)
- Ω(output).Should(ContainSubstring("4 of 4 Specs"))
- output = regextest("-regexScansFilePath=false", "-focus=/passing/") // nothing gets focused (nothing runs)
- Ω(output).Should(ContainSubstring("0 of 4 Specs"))
- })
-
- It("should honor compiler flags", func() {
- session := startGinkgo(pathToTest, "-gcflags=-importmap 'math=math/cmplx'")
- Eventually(session).Should(gexec.Exit(types.GINKGO_FOCUS_EXIT_CODE))
- output := string(session.Out.Contents())
- Ω(output).Should(ContainSubstring("NaN returns complex128"))
- })
-
- It("should honor covermode flag", func() {
- session := startGinkgo(pathToTest, "--noColor", "--covermode=count", "--focus=the focused set")
- Eventually(session).Should(gexec.Exit(0))
- output := string(session.Out.Contents())
- Ω(output).Should(ContainSubstring("coverage: "))
-
- coverageFile := filepath.Join(pathToTest, "flags.coverprofile")
- _, err := os.Stat(coverageFile)
- Ω(err).ShouldNot(HaveOccurred())
- contents, err := ioutil.ReadFile(coverageFile)
- Ω(err).ShouldNot(HaveOccurred())
- Ω(contents).Should(ContainSubstring("mode: count"))
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/integration/integration.go b/vendor/github.com/onsi/ginkgo/integration/integration.go
deleted file mode 100644
index 76ab1b728..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/integration.go
+++ /dev/null
@@ -1 +0,0 @@
-package integration
diff --git a/vendor/github.com/onsi/ginkgo/integration/integration_suite_test.go b/vendor/github.com/onsi/ginkgo/integration/integration_suite_test.go
deleted file mode 100644
index 32ec741c9..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/integration_suite_test.go
+++ /dev/null
@@ -1,129 +0,0 @@
-package integration_test
-
-import (
- "io"
- "io/ioutil"
- "os"
- "os/exec"
- "path/filepath"
-
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
- "github.com/onsi/gomega/gexec"
-
- "testing"
- "time"
-)
-
-var tmpDir string
-var pathToGinkgo string
-
-func TestIntegration(t *testing.T) {
- SetDefaultEventuallyTimeout(30 * time.Second)
- RegisterFailHandler(Fail)
- RunSpecs(t, "Integration Suite")
-}
-
-var _ = SynchronizedBeforeSuite(func() []byte {
- pathToGinkgo, err := gexec.Build("github.com/onsi/ginkgo/ginkgo")
- Ω(err).ShouldNot(HaveOccurred())
- return []byte(pathToGinkgo)
-}, func(computedPathToGinkgo []byte) {
- pathToGinkgo = string(computedPathToGinkgo)
-})
-
-var _ = BeforeEach(func() {
- var err error
- tmpDir, err = ioutil.TempDir("", "ginkgo-run")
- Ω(err).ShouldNot(HaveOccurred())
-})
-
-var _ = AfterEach(func() {
- err := os.RemoveAll(tmpDir)
- Ω(err).ShouldNot(HaveOccurred())
-})
-
-var _ = SynchronizedAfterSuite(func() {}, func() {
- gexec.CleanupBuildArtifacts()
-})
-
-func tmpPath(destination string) string {
- return filepath.Join(tmpDir, destination)
-}
-
-func fixturePath(name string) string {
- return filepath.Join("_fixtures", name)
-}
-
-func copyIn(sourcePath, destinationPath string, recursive bool) {
- err := os.MkdirAll(destinationPath, 0777)
- Expect(err).NotTo(HaveOccurred())
-
- files, err := ioutil.ReadDir(sourcePath)
- Expect(err).NotTo(HaveOccurred())
- for _, f := range files {
- srcPath := filepath.Join(sourcePath, f.Name())
- dstPath := filepath.Join(destinationPath, f.Name())
- if f.IsDir() {
- if recursive {
- copyIn(srcPath, dstPath, recursive)
- }
- continue
- }
-
- src, err := os.Open(srcPath)
-
- Expect(err).NotTo(HaveOccurred())
- defer src.Close()
-
- dst, err := os.Create(dstPath)
- Expect(err).NotTo(HaveOccurred())
- defer dst.Close()
-
- _, err = io.Copy(dst, src)
- Expect(err).NotTo(HaveOccurred())
- }
-}
-
-func sameFile(filePath, otherFilePath string) bool {
- content, readErr := ioutil.ReadFile(filePath)
- Expect(readErr).NotTo(HaveOccurred())
- otherContent, readErr := ioutil.ReadFile(otherFilePath)
- Expect(readErr).NotTo(HaveOccurred())
- Expect(string(content)).To(Equal(string(otherContent)))
- return true
-}
-
-func sameFolder(sourcePath, destinationPath string) bool {
- files, err := ioutil.ReadDir(sourcePath)
- Expect(err).NotTo(HaveOccurred())
- for _, f := range files {
- srcPath := filepath.Join(sourcePath, f.Name())
- dstPath := filepath.Join(destinationPath, f.Name())
- if f.IsDir() {
- sameFolder(srcPath, dstPath)
- continue
- }
- Expect(sameFile(srcPath, dstPath)).To(BeTrue())
- }
- return true
-}
-
-func ginkgoCommand(dir string, args ...string) *exec.Cmd {
- cmd := exec.Command(pathToGinkgo, args...)
- cmd.Dir = dir
-
- return cmd
-}
-
-func startGinkgo(dir string, args ...string) *gexec.Session {
- cmd := ginkgoCommand(dir, args...)
- session, err := gexec.Start(cmd, GinkgoWriter, GinkgoWriter)
- Ω(err).ShouldNot(HaveOccurred())
- return session
-}
-
-func removeSuccessfully(path string) {
- err := os.RemoveAll(path)
- Expect(err).NotTo(HaveOccurred())
-}
diff --git a/vendor/github.com/onsi/ginkgo/integration/interrupt_test.go b/vendor/github.com/onsi/ginkgo/integration/interrupt_test.go
deleted file mode 100644
index d4158b806..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/interrupt_test.go
+++ /dev/null
@@ -1,51 +0,0 @@
-package integration_test
-
-import (
- "os/exec"
-
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
- "github.com/onsi/gomega/gbytes"
- "github.com/onsi/gomega/gexec"
-)
-
-var _ = Describe("Interrupt", func() {
- var pathToTest string
- BeforeEach(func() {
- pathToTest = tmpPath("hanging")
- copyIn(fixturePath("hanging_suite"), pathToTest, false)
- })
-
- Context("when interrupting a suite", func() {
- var session *gexec.Session
- BeforeEach(func() {
- //we need to signal the actual process, so we must compile the test first
- var err error
- cmd := exec.Command("go", "test", "-c")
- cmd.Dir = pathToTest
- session, err = gexec.Start(cmd, GinkgoWriter, GinkgoWriter)
- Ω(err).ShouldNot(HaveOccurred())
- Eventually(session).Should(gexec.Exit(0))
-
- //then run the compiled test directly
- cmd = exec.Command("./hanging.test", "--test.v=true", "--ginkgo.noColor")
- cmd.Dir = pathToTest
- session, err = gexec.Start(cmd, GinkgoWriter, GinkgoWriter)
- Ω(err).ShouldNot(HaveOccurred())
-
- Eventually(session).Should(gbytes.Say("Sleeping..."))
- session.Interrupt()
- Eventually(session, 1000).Should(gexec.Exit(1))
- })
-
- It("should emit the contents of the GinkgoWriter", func() {
- Ω(session).Should(gbytes.Say("Just beginning"))
- Ω(session).Should(gbytes.Say("Almost there..."))
- Ω(session).Should(gbytes.Say("Hanging Out"))
- })
-
- It("should run the AfterSuite", func() {
- Ω(session).Should(gbytes.Say("Heading Out After Suite"))
- })
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/integration/precompiled_test.go b/vendor/github.com/onsi/ginkgo/integration/precompiled_test.go
deleted file mode 100644
index 55724a9b8..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/precompiled_test.go
+++ /dev/null
@@ -1,53 +0,0 @@
-package integration_test
-
-import (
- "os"
- "os/exec"
- "path/filepath"
-
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
- "github.com/onsi/gomega/gbytes"
- "github.com/onsi/gomega/gexec"
-)
-
-var _ = Describe("ginkgo build", func() {
- var pathToTest string
-
- BeforeEach(func() {
- pathToTest = tmpPath("passing_ginkgo_tests")
- copyIn(fixturePath("passing_ginkgo_tests"), pathToTest, false)
- session := startGinkgo(pathToTest, "build")
- Eventually(session).Should(gexec.Exit(0))
- output := string(session.Out.Contents())
- Ω(output).Should(ContainSubstring("Compiling passing_ginkgo_tests"))
- Ω(output).Should(ContainSubstring("compiled passing_ginkgo_tests.test"))
- })
-
- It("should build a test binary", func() {
- _, err := os.Stat(filepath.Join(pathToTest, "passing_ginkgo_tests.test"))
- Ω(err).ShouldNot(HaveOccurred())
- })
-
- It("should be possible to run the test binary directly", func() {
- cmd := exec.Command("./passing_ginkgo_tests.test")
- cmd.Dir = pathToTest
- session, err := gexec.Start(cmd, GinkgoWriter, GinkgoWriter)
- Ω(err).ShouldNot(HaveOccurred())
- Eventually(session).Should(gexec.Exit(0))
- Ω(session).Should(gbytes.Say("Running Suite: Passing_ginkgo_tests Suite"))
- })
-
- It("should be possible to run the test binary via ginkgo", func() {
- session := startGinkgo(pathToTest, "./passing_ginkgo_tests.test")
- Eventually(session).Should(gexec.Exit(0))
- Ω(session).Should(gbytes.Say("Running Suite: Passing_ginkgo_tests Suite"))
- })
-
- It("should be possible to run the test binary in parallel", func() {
- session := startGinkgo(pathToTest, "--nodes=4", "--noColor", "./passing_ginkgo_tests.test")
- Eventually(session).Should(gexec.Exit(0))
- Ω(session).Should(gbytes.Say("Running Suite: Passing_ginkgo_tests Suite"))
- Ω(session).Should(gbytes.Say("Running in parallel across 4 nodes"))
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/integration/progress_test.go b/vendor/github.com/onsi/ginkgo/integration/progress_test.go
deleted file mode 100644
index cda86b6ea..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/progress_test.go
+++ /dev/null
@@ -1,94 +0,0 @@
-package integration_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
- "github.com/onsi/gomega/gbytes"
- "github.com/onsi/gomega/gexec"
-)
-
-var _ = Describe("Emitting progress", func() {
- var pathToTest string
- var session *gexec.Session
- var args []string
-
- BeforeEach(func() {
- args = []string{"--noColor"}
- pathToTest = tmpPath("progress")
- copyIn(fixturePath("progress_fixture"), pathToTest, false)
- })
-
- JustBeforeEach(func() {
- session = startGinkgo(pathToTest, args...)
- Eventually(session).Should(gexec.Exit(0))
- })
-
- Context("with the -progress flag, but no -v flag", func() {
- BeforeEach(func() {
- args = append(args, "-progress")
- })
-
- It("should not emit progress", func() {
- Ω(session).ShouldNot(gbytes.Say("[bB]efore"))
- })
- })
-
- Context("with the -v flag", func() {
- BeforeEach(func() {
- args = append(args, "-v")
- })
-
- It("should not emit progress", func() {
- Ω(session).ShouldNot(gbytes.Say(`\[BeforeEach\]`))
- Ω(session).Should(gbytes.Say(`>outer before<`))
- })
- })
-
- Context("with the -progress flag and the -v flag", func() {
- BeforeEach(func() {
- args = append(args, "-progress", "-v")
- })
-
- It("should emit progress (by writing to the GinkgoWriter)", func() {
- // First spec
-
- Ω(session).Should(gbytes.Say(`\[BeforeEach\] ProgressFixture`))
- Ω(session).Should(gbytes.Say(`>outer before<`))
-
- Ω(session).Should(gbytes.Say(`\[BeforeEach\] Inner Context`))
- Ω(session).Should(gbytes.Say(`>inner before<`))
-
- Ω(session).Should(gbytes.Say(`\[BeforeEach\] when Inner When`))
- Ω(session).Should(gbytes.Say(`>inner before<`))
-
- Ω(session).Should(gbytes.Say(`\[JustBeforeEach\] ProgressFixture`))
- Ω(session).Should(gbytes.Say(`>outer just before<`))
-
- Ω(session).Should(gbytes.Say(`\[JustBeforeEach\] Inner Context`))
- Ω(session).Should(gbytes.Say(`>inner just before<`))
-
- Ω(session).Should(gbytes.Say(`\[It\] should emit progress as it goes`))
- Ω(session).Should(gbytes.Say(`>it<`))
-
- Ω(session).Should(gbytes.Say(`\[AfterEach\] Inner Context`))
- Ω(session).Should(gbytes.Say(`>inner after<`))
-
- Ω(session).Should(gbytes.Say(`\[AfterEach\] ProgressFixture`))
- Ω(session).Should(gbytes.Say(`>outer after<`))
-
- // Second spec
-
- Ω(session).Should(gbytes.Say(`\[BeforeEach\] ProgressFixture`))
- Ω(session).Should(gbytes.Say(`>outer before<`))
-
- Ω(session).Should(gbytes.Say(`\[JustBeforeEach\] ProgressFixture`))
- Ω(session).Should(gbytes.Say(`>outer just before<`))
-
- Ω(session).Should(gbytes.Say(`\[It\] should emit progress as it goes`))
- Ω(session).Should(gbytes.Say(`>specify<`))
-
- Ω(session).Should(gbytes.Say(`\[AfterEach\] ProgressFixture`))
- Ω(session).Should(gbytes.Say(`>outer after<`))
- })
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/integration/run_test.go b/vendor/github.com/onsi/ginkgo/integration/run_test.go
deleted file mode 100644
index 6c270b61b..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/run_test.go
+++ /dev/null
@@ -1,483 +0,0 @@
-package integration_test
-
-import (
- "fmt"
- "io/ioutil"
- "os"
- "regexp"
- "runtime"
- "strings"
-
- . "github.com/onsi/ginkgo"
- "github.com/onsi/ginkgo/types"
- . "github.com/onsi/gomega"
- "github.com/onsi/gomega/gbytes"
- "github.com/onsi/gomega/gexec"
-)
-
-var _ = Describe("Running Specs", func() {
- var pathToTest string
-
- isWindows := (runtime.GOOS == "windows")
- denoter := "•"
-
- if isWindows {
- denoter = "+"
- }
-
- Context("when pointed at the current directory", func() {
- BeforeEach(func() {
- pathToTest = tmpPath("ginkgo")
- copyIn(fixturePath("passing_ginkgo_tests"), pathToTest, false)
- })
-
- It("should run the tests in the working directory", func() {
- session := startGinkgo(pathToTest, "--noColor")
- Eventually(session).Should(gexec.Exit(0))
- output := string(session.Out.Contents())
-
- Ω(output).Should(ContainSubstring("Running Suite: Passing_ginkgo_tests Suite"))
- Ω(output).Should(ContainSubstring(strings.Repeat(denoter, 4)))
- Ω(output).Should(ContainSubstring("SUCCESS! -- 4 Passed"))
- Ω(output).Should(ContainSubstring("Test Suite Passed"))
- })
- })
-
- Context("when passed an explicit package to run", func() {
- BeforeEach(func() {
- pathToTest = tmpPath("ginkgo")
- copyIn(fixturePath("passing_ginkgo_tests"), pathToTest, false)
- })
-
- It("should run the ginkgo style tests", func() {
- session := startGinkgo(tmpDir, "--noColor", pathToTest)
- Eventually(session).Should(gexec.Exit(0))
- output := string(session.Out.Contents())
-
- Ω(output).Should(ContainSubstring("Running Suite: Passing_ginkgo_tests Suite"))
- Ω(output).Should(ContainSubstring(strings.Repeat(denoter, 4)))
- Ω(output).Should(ContainSubstring("SUCCESS! -- 4 Passed"))
- Ω(output).Should(ContainSubstring("Test Suite Passed"))
- })
- })
-
- Context("when passed a number of packages to run", func() {
- BeforeEach(func() {
- pathToTest = tmpPath("ginkgo")
- otherPathToTest := tmpPath("other")
- copyIn(fixturePath("passing_ginkgo_tests"), pathToTest, false)
- copyIn(fixturePath("more_ginkgo_tests"), otherPathToTest, false)
- })
-
- It("should run the ginkgo style tests", func() {
- session := startGinkgo(tmpDir, "--noColor", "--succinct=false", "ginkgo", "./other")
- Eventually(session).Should(gexec.Exit(0))
- output := string(session.Out.Contents())
-
- Ω(output).Should(ContainSubstring("Running Suite: Passing_ginkgo_tests Suite"))
- Ω(output).Should(ContainSubstring("Running Suite: More_ginkgo_tests Suite"))
- Ω(output).Should(ContainSubstring("Test Suite Passed"))
- })
- })
-
- Context("when passed a number of packages to run, some of which have focused tests", func() {
- BeforeEach(func() {
- pathToTest = tmpPath("ginkgo")
- otherPathToTest := tmpPath("other")
- focusedPathToTest := tmpPath("focused")
- copyIn(fixturePath("passing_ginkgo_tests"), pathToTest, false)
- copyIn(fixturePath("more_ginkgo_tests"), otherPathToTest, false)
- copyIn(fixturePath("focused_fixture"), focusedPathToTest, false)
- })
-
- It("should exit with a status code of 2 and explain why", func() {
- session := startGinkgo(tmpDir, "--noColor", "--succinct=false", "-r")
- Eventually(session).Should(gexec.Exit(types.GINKGO_FOCUS_EXIT_CODE))
- output := string(session.Out.Contents())
-
- Ω(output).Should(ContainSubstring("Running Suite: Passing_ginkgo_tests Suite"))
- Ω(output).Should(ContainSubstring("Running Suite: More_ginkgo_tests Suite"))
- Ω(output).Should(ContainSubstring("Test Suite Passed"))
- Ω(output).Should(ContainSubstring("Detected Programmatic Focus - setting exit status to %d", types.GINKGO_FOCUS_EXIT_CODE))
- })
-
- Context("when the GINKGO_EDITOR_INTEGRATION environment variable is set", func() {
- BeforeEach(func() {
- os.Setenv("GINKGO_EDITOR_INTEGRATION", "true")
- })
- AfterEach(func() {
- os.Setenv("GINKGO_EDITOR_INTEGRATION", "")
- })
- It("should exit with a status code of 0 to allow a coverage file to be generated", func() {
- session := startGinkgo(tmpDir, "--noColor", "--succinct=false", "-r")
- Eventually(session).Should(gexec.Exit(0))
- output := string(session.Out.Contents())
-
- Ω(output).Should(ContainSubstring("Running Suite: Passing_ginkgo_tests Suite"))
- Ω(output).Should(ContainSubstring("Running Suite: More_ginkgo_tests Suite"))
- Ω(output).Should(ContainSubstring("Test Suite Passed"))
- })
- })
- })
-
- Context("when told to skipPackages", func() {
- BeforeEach(func() {
- pathToTest = tmpPath("ginkgo")
- otherPathToTest := tmpPath("other")
- focusedPathToTest := tmpPath("focused")
- copyIn(fixturePath("passing_ginkgo_tests"), pathToTest, false)
- copyIn(fixturePath("more_ginkgo_tests"), otherPathToTest, false)
- copyIn(fixturePath("focused_fixture"), focusedPathToTest, false)
- })
-
- It("should skip packages that match the list", func() {
- session := startGinkgo(tmpDir, "--noColor", "--skipPackage=other,focused", "-r")
- Eventually(session).Should(gexec.Exit(0))
- output := string(session.Out.Contents())
-
- Ω(output).Should(ContainSubstring("Passing_ginkgo_tests Suite"))
- Ω(output).ShouldNot(ContainSubstring("More_ginkgo_tests Suite"))
- Ω(output).ShouldNot(ContainSubstring("Focused_fixture Suite"))
- Ω(output).Should(ContainSubstring("Test Suite Passed"))
- })
-
- Context("when all packages are skipped", func() {
- It("should not run anything, but still exit 0", func() {
- session := startGinkgo(tmpDir, "--noColor", "--skipPackage=other,focused,ginkgo", "-r")
- Eventually(session).Should(gexec.Exit(0))
- output := string(session.Out.Contents())
-
- Ω(output).Should(ContainSubstring("All tests skipped!"))
- Ω(output).ShouldNot(ContainSubstring("Passing_ginkgo_tests Suite"))
- Ω(output).ShouldNot(ContainSubstring("More_ginkgo_tests Suite"))
- Ω(output).ShouldNot(ContainSubstring("Focused_fixture Suite"))
- Ω(output).ShouldNot(ContainSubstring("Test Suite Passed"))
- })
- })
- })
-
- Context("when there are no tests to run", func() {
- It("should exit 1", func() {
- session := startGinkgo(tmpDir, "--noColor", "--skipPackage=other,focused", "-r")
- Eventually(session).Should(gexec.Exit(1))
- output := string(session.Err.Contents())
-
- Ω(output).Should(ContainSubstring("Found no test suites"))
- })
- })
-
- Context("when there are test files but `go test` reports there are no tests to run", func() {
- BeforeEach(func() {
- pathToTest = tmpPath("ginkgo")
- copyIn(fixturePath("no_test_fn"), pathToTest, false)
- })
-
- It("suggests running ginkgo bootstrap", func() {
- session := startGinkgo(tmpDir, "--noColor", "--skipPackage=other,focused", "-r")
- Eventually(session).Should(gexec.Exit(0))
- output := string(session.Err.Contents())
-
- Ω(output).Should(ContainSubstring(`Found no test suites, did you forget to run "ginkgo bootstrap"?`))
- })
-
- It("fails if told to requireSuite", func() {
- session := startGinkgo(tmpDir, "--noColor", "--skipPackage=other,focused", "-r", "-requireSuite")
- Eventually(session).Should(gexec.Exit(1))
- output := string(session.Err.Contents())
-
- Ω(output).Should(ContainSubstring(`Found no test suites, did you forget to run "ginkgo bootstrap"?`))
- })
- })
-
- Context("when told to randomizeSuites", func() {
- BeforeEach(func() {
- pathToTest = tmpPath("ginkgo")
- otherPathToTest := tmpPath("other")
- copyIn(fixturePath("passing_ginkgo_tests"), pathToTest, false)
- copyIn(fixturePath("more_ginkgo_tests"), otherPathToTest, false)
- })
-
- It("should skip packages that match the regexp", func() {
- session := startGinkgo(tmpDir, "--noColor", "--randomizeSuites", "-r", "--seed=2")
- Eventually(session).Should(gexec.Exit(0))
-
- Ω(session).Should(gbytes.Say("More_ginkgo_tests Suite"))
- Ω(session).Should(gbytes.Say("Passing_ginkgo_tests Suite"))
-
- session = startGinkgo(tmpDir, "--noColor", "--randomizeSuites", "-r", "--seed=3")
- Eventually(session).Should(gexec.Exit(0))
-
- Ω(session).Should(gbytes.Say("Passing_ginkgo_tests Suite"))
- Ω(session).Should(gbytes.Say("More_ginkgo_tests Suite"))
- })
- })
-
- Context("when pointed at a package with xunit style tests", func() {
- BeforeEach(func() {
- pathToTest = tmpPath("xunit")
- copyIn(fixturePath("xunit_tests"), pathToTest, false)
- })
-
- It("should run the xunit style tests", func() {
- session := startGinkgo(pathToTest)
- Eventually(session).Should(gexec.Exit(0))
- output := string(session.Out.Contents())
-
- Ω(output).Should(ContainSubstring("--- PASS: TestAlwaysTrue"))
- Ω(output).Should(ContainSubstring("Test Suite Passed"))
- })
- })
-
- Context("when pointed at a package with no tests", func() {
- BeforeEach(func() {
- pathToTest = tmpPath("no_tests")
- copyIn(fixturePath("no_tests"), pathToTest, false)
- })
-
- It("should fail", func() {
- session := startGinkgo(pathToTest, "--noColor")
- Eventually(session).Should(gexec.Exit(1))
-
- Ω(session.Err.Contents()).Should(ContainSubstring("Found no test suites"))
- })
- })
-
- Context("when pointed at a package that fails to compile", func() {
- BeforeEach(func() {
- pathToTest = tmpPath("does_not_compile")
- copyIn(fixturePath("does_not_compile"), pathToTest, false)
- })
-
- It("should fail", func() {
- session := startGinkgo(pathToTest, "--noColor")
- Eventually(session).Should(gexec.Exit(1))
- output := string(session.Out.Contents())
-
- Ω(output).Should(ContainSubstring("Failed to compile"))
- })
- })
-
- Context("when running in parallel", func() {
- BeforeEach(func() {
- pathToTest = tmpPath("ginkgo")
- copyIn(fixturePath("passing_ginkgo_tests"), pathToTest, false)
- })
-
- Context("with a specific number of -nodes", func() {
- It("should use the specified number of nodes", func() {
- session := startGinkgo(pathToTest, "--noColor", "-succinct", "-nodes=2")
- Eventually(session).Should(gexec.Exit(0))
- output := string(session.Out.Contents())
-
- Ω(output).Should(MatchRegexp(`\[\d+\] Passing_ginkgo_tests Suite - 4 specs - 2 nodes [%s]{4} SUCCESS! \d+(\.\d+)?[muµ]s`, regexp.QuoteMeta(denoter)))
- Ω(output).Should(ContainSubstring("Test Suite Passed"))
- })
- })
-
- Context("with -p", func() {
- It("it should autocompute the number of nodes", func() {
- session := startGinkgo(pathToTest, "--noColor", "-succinct", "-p")
- Eventually(session).Should(gexec.Exit(0))
- output := string(session.Out.Contents())
-
- nodes := runtime.NumCPU()
- if nodes == 1 {
- Skip("Can't test parallel testings with 1 CPU")
- }
- if nodes > 4 {
- nodes = nodes - 1
- }
- Ω(output).Should(MatchRegexp(`\[\d+\] Passing_ginkgo_tests Suite - 4 specs - %d nodes [%s]{4} SUCCESS! \d+(\.\d+)?[muµ]?s`, nodes, regexp.QuoteMeta(denoter)))
- Ω(output).Should(ContainSubstring("Test Suite Passed"))
- })
- })
- })
-
- Context("when running in parallel with -debug", func() {
- BeforeEach(func() {
- pathToTest = tmpPath("ginkgo")
- copyIn(fixturePath("debug_parallel_fixture"), pathToTest, false)
- })
-
- Context("without -v", func() {
- It("should emit node output to files on disk", func() {
- session := startGinkgo(pathToTest, "--nodes=2", "--debug")
- Eventually(session).Should(gexec.Exit(0))
-
- f0, err := ioutil.ReadFile(pathToTest + "/ginkgo-node-1.log")
- Ω(err).ShouldNot(HaveOccurred())
- f1, err := ioutil.ReadFile(pathToTest + "/ginkgo-node-2.log")
- Ω(err).ShouldNot(HaveOccurred())
- content := string(append(f0, f1...))
-
- for i := 0; i < 10; i += 1 {
- Ω(content).Should(ContainSubstring("StdOut %d\n", i))
- Ω(content).Should(ContainSubstring("GinkgoWriter %d\n", i))
- }
- })
- })
-
- Context("without -v", func() {
- It("should emit node output to files on disk, without duplicating the GinkgoWriter output", func() {
- session := startGinkgo(pathToTest, "--nodes=2", "--debug", "-v")
- Eventually(session).Should(gexec.Exit(0))
-
- f0, err := ioutil.ReadFile(pathToTest + "/ginkgo-node-1.log")
- Ω(err).ShouldNot(HaveOccurred())
- f1, err := ioutil.ReadFile(pathToTest + "/ginkgo-node-2.log")
- Ω(err).ShouldNot(HaveOccurred())
- content := string(append(f0, f1...))
-
- out := strings.Split(content, "GinkgoWriter 2")
- Ω(out).Should(HaveLen(2))
- })
- })
- })
-
- Context("when streaming in parallel", func() {
- BeforeEach(func() {
- pathToTest = tmpPath("ginkgo")
- copyIn(fixturePath("passing_ginkgo_tests"), pathToTest, false)
- })
-
- It("should print output in realtime", func() {
- session := startGinkgo(pathToTest, "--noColor", "-stream", "-nodes=2")
- Eventually(session).Should(gexec.Exit(0))
- output := string(session.Out.Contents())
-
- Ω(output).Should(ContainSubstring(`[1] Parallel test node 1/2.`))
- Ω(output).Should(ContainSubstring(`[2] Parallel test node 2/2.`))
- Ω(output).Should(ContainSubstring(`[1] SUCCESS!`))
- Ω(output).Should(ContainSubstring(`[2] SUCCESS!`))
- Ω(output).Should(ContainSubstring("Test Suite Passed"))
- })
- })
-
- Context("when running recursively", func() {
- BeforeEach(func() {
- passingTest := tmpPath("A")
- otherPassingTest := tmpPath("E")
- copyIn(fixturePath("passing_ginkgo_tests"), passingTest, false)
- copyIn(fixturePath("more_ginkgo_tests"), otherPassingTest, false)
- })
-
- Context("when all the tests pass", func() {
- Context("with the -r flag", func() {
- It("should run all the tests (in succinct mode) and succeed", func() {
- session := startGinkgo(tmpDir, "--noColor", "-r", ".")
- Eventually(session).Should(gexec.Exit(0))
- output := string(session.Out.Contents())
-
- outputLines := strings.Split(output, "\n")
- Ω(outputLines[0]).Should(MatchRegexp(`\[\d+\] Passing_ginkgo_tests Suite - 4/4 specs [%s]{4} SUCCESS! \d+(\.\d+)?[muµ]s PASS`, regexp.QuoteMeta(denoter)))
- Ω(outputLines[1]).Should(MatchRegexp(`\[\d+\] More_ginkgo_tests Suite - 2/2 specs [%s]{2} SUCCESS! \d+(\.\d+)?[muµ]s PASS`, regexp.QuoteMeta(denoter)))
- Ω(output).Should(ContainSubstring("Test Suite Passed"))
- })
- })
- Context("with a trailing /...", func() {
- It("should run all the tests (in succinct mode) and succeed", func() {
- session := startGinkgo(tmpDir, "--noColor", "./...")
- Eventually(session).Should(gexec.Exit(0))
- output := string(session.Out.Contents())
-
- outputLines := strings.Split(output, "\n")
- Ω(outputLines[0]).Should(MatchRegexp(`\[\d+\] Passing_ginkgo_tests Suite - 4/4 specs [%s]{4} SUCCESS! \d+(\.\d+)?[muµ]s PASS`, regexp.QuoteMeta(denoter)))
- Ω(outputLines[1]).Should(MatchRegexp(`\[\d+\] More_ginkgo_tests Suite - 2/2 specs [%s]{2} SUCCESS! \d+(\.\d+)?[muµ]s PASS`, regexp.QuoteMeta(denoter)))
- Ω(output).Should(ContainSubstring("Test Suite Passed"))
- })
- })
- })
-
- Context("when one of the packages has a failing tests", func() {
- BeforeEach(func() {
- failingTest := tmpPath("C")
- copyIn(fixturePath("failing_ginkgo_tests"), failingTest, false)
- })
-
- It("should fail and stop running tests", func() {
- session := startGinkgo(tmpDir, "--noColor", "-r")
- Eventually(session).Should(gexec.Exit(1))
- output := string(session.Out.Contents())
-
- outputLines := strings.Split(output, "\n")
- Ω(outputLines[0]).Should(MatchRegexp(`\[\d+\] Passing_ginkgo_tests Suite - 4/4 specs [%s]{4} SUCCESS! \d+(\.\d+)?[muµ]s PASS`, regexp.QuoteMeta(denoter)))
- Ω(outputLines[1]).Should(MatchRegexp(`\[\d+\] Failing_ginkgo_tests Suite - 2/2 specs`))
- Ω(output).Should(ContainSubstring(fmt.Sprintf("%s Failure", denoter)))
- Ω(output).ShouldNot(ContainSubstring("More_ginkgo_tests Suite"))
- Ω(output).Should(ContainSubstring("Test Suite Failed"))
-
- Ω(output).Should(ContainSubstring("Summarizing 1 Failure:"))
- Ω(output).Should(ContainSubstring("[Fail] FailingGinkgoTests [It] should fail"))
- })
- })
-
- Context("when one of the packages fails to compile", func() {
- BeforeEach(func() {
- doesNotCompileTest := tmpPath("C")
- copyIn(fixturePath("does_not_compile"), doesNotCompileTest, false)
- })
-
- It("should fail and stop running tests", func() {
- session := startGinkgo(tmpDir, "--noColor", "-r")
- Eventually(session).Should(gexec.Exit(1))
- output := string(session.Out.Contents())
-
- outputLines := strings.Split(output, "\n")
- Ω(outputLines[0]).Should(MatchRegexp(`\[\d+\] Passing_ginkgo_tests Suite - 4/4 specs [%s]{4} SUCCESS! \d+(\.\d+)?[muµ]s PASS`, regexp.QuoteMeta(denoter)))
- Ω(outputLines[1]).Should(ContainSubstring("Failed to compile C:"))
- Ω(output).ShouldNot(ContainSubstring("More_ginkgo_tests Suite"))
- Ω(output).Should(ContainSubstring("Test Suite Failed"))
- })
- })
-
- Context("when either is the case, but the keepGoing flag is set", func() {
- BeforeEach(func() {
- doesNotCompileTest := tmpPath("B")
- copyIn(fixturePath("does_not_compile"), doesNotCompileTest, false)
-
- failingTest := tmpPath("C")
- copyIn(fixturePath("failing_ginkgo_tests"), failingTest, false)
- })
-
- It("should soldier on", func() {
- session := startGinkgo(tmpDir, "--noColor", "-r", "-keepGoing")
- Eventually(session).Should(gexec.Exit(1))
- output := string(session.Out.Contents())
-
- outputLines := strings.Split(output, "\n")
- Ω(outputLines[0]).Should(MatchRegexp(`\[\d+\] Passing_ginkgo_tests Suite - 4/4 specs [%s]{4} SUCCESS! \d+(\.\d+)?[muµ]s PASS`, regexp.QuoteMeta(denoter)))
- Ω(outputLines[1]).Should(ContainSubstring("Failed to compile B:"))
- Ω(output).Should(MatchRegexp(`\[\d+\] Failing_ginkgo_tests Suite - 2/2 specs`))
- Ω(output).Should(ContainSubstring(fmt.Sprintf("%s Failure", denoter)))
- Ω(output).Should(MatchRegexp(`\[\d+\] More_ginkgo_tests Suite - 2/2 specs [%s]{2} SUCCESS! \d+(\.\d+)?[muµ]s PASS`, regexp.QuoteMeta(denoter)))
- Ω(output).Should(ContainSubstring("Test Suite Failed"))
- })
- })
- })
-
- Context("when told to keep going --untilItFails", func() {
- BeforeEach(func() {
- copyIn(fixturePath("eventually_failing"), tmpDir, false)
- })
-
- It("should keep rerunning the tests, until a failure occurs", func() {
- session := startGinkgo(tmpDir, "--untilItFails", "--noColor")
- Eventually(session).Should(gexec.Exit(1))
- Ω(session).Should(gbytes.Say("This was attempt #1"))
- Ω(session).Should(gbytes.Say("This was attempt #2"))
- Ω(session).Should(gbytes.Say("Tests failed on attempt #3"))
-
- //it should change the random seed between each test
- lines := strings.Split(string(session.Out.Contents()), "\n")
- randomSeeds := []string{}
- for _, line := range lines {
- if strings.Contains(line, "Random Seed:") {
- randomSeeds = append(randomSeeds, strings.Split(line, ": ")[1])
- }
- }
- Ω(randomSeeds[0]).ShouldNot(Equal(randomSeeds[1]))
- Ω(randomSeeds[1]).ShouldNot(Equal(randomSeeds[2]))
- Ω(randomSeeds[0]).ShouldNot(Equal(randomSeeds[2]))
- })
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/integration/skip_test.go b/vendor/github.com/onsi/ginkgo/integration/skip_test.go
deleted file mode 100644
index f0fc9d5ee..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/skip_test.go
+++ /dev/null
@@ -1,43 +0,0 @@
-package integration_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
- "github.com/onsi/gomega/gexec"
-)
-
-var _ = Describe("Skipping Specs", func() {
- var pathToTest string
-
- BeforeEach(func() {
- pathToTest = tmpPath("skipping")
- copyIn(fixturePath("skip_fixture"), pathToTest, false)
- })
-
- It("should skip in all the possible ways", func() {
- session := startGinkgo(pathToTest, "--noColor")
- Eventually(session).Should(gexec.Exit(0))
- output := string(session.Out.Contents())
-
- Ω(output).ShouldNot(ContainSubstring("NEVER SEE THIS"))
-
- Ω(output).Should(ContainSubstring("a top level skip on line 9"))
- Ω(output).Should(ContainSubstring("skip_fixture_test.go:9"))
- Ω(output).Should(ContainSubstring("an async top level skip on line 14"))
- Ω(output).Should(ContainSubstring("skip_fixture_test.go:14"))
- Ω(output).Should(ContainSubstring("a top level goroutine skip on line 21"))
- Ω(output).Should(ContainSubstring("skip_fixture_test.go:21"))
-
- Ω(output).Should(ContainSubstring("a sync SKIP"))
- Ω(output).Should(ContainSubstring("an async SKIP"))
- Ω(output).Should(ContainSubstring("a goroutine SKIP"))
- Ω(output).Should(ContainSubstring("a measure SKIP"))
-
- Ω(output).Should(ContainSubstring("S [SKIPPING] in Spec Setup (BeforeEach) ["))
- Ω(output).Should(ContainSubstring("a BeforeEach SKIP"))
- Ω(output).Should(ContainSubstring("S [SKIPPING] in Spec Teardown (AfterEach) ["))
- Ω(output).Should(ContainSubstring("an AfterEach SKIP"))
-
- Ω(output).Should(ContainSubstring("0 Passed | 0 Failed | 0 Pending | 9 Skipped"))
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/integration/subcommand_test.go b/vendor/github.com/onsi/ginkgo/integration/subcommand_test.go
deleted file mode 100644
index fec197f56..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/subcommand_test.go
+++ /dev/null
@@ -1,419 +0,0 @@
-package integration_test
-
-import (
- "io/ioutil"
- "os"
- "path/filepath"
- "strings"
-
- . "github.com/onsi/ginkgo"
- "github.com/onsi/ginkgo/types"
- . "github.com/onsi/gomega"
- "github.com/onsi/gomega/gexec"
-)
-
-var _ = Describe("Subcommand", func() {
- Describe("ginkgo bootstrap", func() {
- var pkgPath string
- BeforeEach(func() {
- pkgPath = tmpPath("foo")
- os.Mkdir(pkgPath, 0777)
- })
-
- It("should generate a bootstrap file, as long as one does not exist", func() {
- session := startGinkgo(pkgPath, "bootstrap")
- Eventually(session).Should(gexec.Exit(0))
- output := session.Out.Contents()
-
- Ω(output).Should(ContainSubstring("foo_suite_test.go"))
-
- content, err := ioutil.ReadFile(filepath.Join(pkgPath, "foo_suite_test.go"))
- Ω(err).ShouldNot(HaveOccurred())
- Ω(content).Should(ContainSubstring("package foo_test"))
- Ω(content).Should(ContainSubstring("func TestFoo(t *testing.T) {"))
- Ω(content).Should(ContainSubstring("RegisterFailHandler"))
- Ω(content).Should(ContainSubstring("RunSpecs"))
-
- Ω(content).Should(ContainSubstring("\t" + `. "github.com/onsi/ginkgo"`))
- Ω(content).Should(ContainSubstring("\t" + `. "github.com/onsi/gomega"`))
-
- session = startGinkgo(pkgPath, "bootstrap")
- Eventually(session).Should(gexec.Exit(1))
- output = session.Out.Contents()
- Ω(output).Should(ContainSubstring("foo_suite_test.go already exists"))
- })
-
- It("should import nodot declarations when told to", func() {
- session := startGinkgo(pkgPath, "bootstrap", "--nodot")
- Eventually(session).Should(gexec.Exit(0))
- output := session.Out.Contents()
-
- Ω(output).Should(ContainSubstring("foo_suite_test.go"))
-
- content, err := ioutil.ReadFile(filepath.Join(pkgPath, "foo_suite_test.go"))
- Ω(err).ShouldNot(HaveOccurred())
- Ω(content).Should(ContainSubstring("package foo_test"))
- Ω(content).Should(ContainSubstring("func TestFoo(t *testing.T) {"))
- Ω(content).Should(ContainSubstring("RegisterFailHandler"))
- Ω(content).Should(ContainSubstring("RunSpecs"))
-
- Ω(content).Should(ContainSubstring("var It = ginkgo.It"))
- Ω(content).Should(ContainSubstring("var Ω = gomega.Ω"))
-
- Ω(content).Should(ContainSubstring("\t" + `"github.com/onsi/ginkgo"`))
- Ω(content).Should(ContainSubstring("\t" + `"github.com/onsi/gomega"`))
- })
-
- It("should generate an agouti bootstrap file when told to", func() {
- session := startGinkgo(pkgPath, "bootstrap", "--agouti")
- Eventually(session).Should(gexec.Exit(0))
- output := session.Out.Contents()
-
- Ω(output).Should(ContainSubstring("foo_suite_test.go"))
-
- content, err := ioutil.ReadFile(filepath.Join(pkgPath, "foo_suite_test.go"))
- Ω(err).ShouldNot(HaveOccurred())
- Ω(content).Should(ContainSubstring("package foo_test"))
- Ω(content).Should(ContainSubstring("func TestFoo(t *testing.T) {"))
- Ω(content).Should(ContainSubstring("RegisterFailHandler"))
- Ω(content).Should(ContainSubstring("RunSpecs"))
-
- Ω(content).Should(ContainSubstring("\t" + `. "github.com/onsi/ginkgo"`))
- Ω(content).Should(ContainSubstring("\t" + `. "github.com/onsi/gomega"`))
- Ω(content).Should(ContainSubstring("\t" + `"github.com/sclevine/agouti"`))
- })
-
- It("should generate a bootstrap file using a template when told to", func() {
- templateFile := filepath.Join(pkgPath, ".bootstrap")
- ioutil.WriteFile(templateFile, []byte(`package {{.Package}}
-
- import (
- {{.GinkgoImport}}
- {{.GomegaImport}}
-
- "testing"
- "binary"
- )
-
- func Test{{.FormattedName}}(t *testing.T) {
- // This is a {{.Package}} test
- }`), 0666)
- session := startGinkgo(pkgPath, "bootstrap", "--template", templateFile)
- Eventually(session).Should(gexec.Exit(0))
- output := session.Out.Contents()
-
- Ω(output).Should(ContainSubstring("foo_suite_test.go"))
-
- content, err := ioutil.ReadFile(filepath.Join(pkgPath, "foo_suite_test.go"))
- Ω(err).ShouldNot(HaveOccurred())
- Ω(content).Should(ContainSubstring("package foo_test"))
- Ω(content).Should(ContainSubstring(`. "github.com/onsi/ginkgo"`))
- Ω(content).Should(ContainSubstring(`. "github.com/onsi/gomega"`))
- Ω(content).Should(ContainSubstring(`"binary"`))
- Ω(content).Should(ContainSubstring("// This is a foo_test test"))
- })
- })
-
- Describe("nodot", func() {
- It("should update the declarations in the bootstrap file", func() {
- pkgPath := tmpPath("foo")
- os.Mkdir(pkgPath, 0777)
-
- session := startGinkgo(pkgPath, "bootstrap", "--nodot")
- Eventually(session).Should(gexec.Exit(0))
-
- byteContent, err := ioutil.ReadFile(filepath.Join(pkgPath, "foo_suite_test.go"))
- Ω(err).ShouldNot(HaveOccurred())
-
- content := string(byteContent)
- content = strings.Replace(content, "var It =", "var MyIt =", -1)
- content = strings.Replace(content, "var Ω = gomega.Ω\n", "", -1)
-
- err = ioutil.WriteFile(filepath.Join(pkgPath, "foo_suite_test.go"), []byte(content), os.ModePerm)
- Ω(err).ShouldNot(HaveOccurred())
-
- session = startGinkgo(pkgPath, "nodot")
- Eventually(session).Should(gexec.Exit(0))
-
- byteContent, err = ioutil.ReadFile(filepath.Join(pkgPath, "foo_suite_test.go"))
- Ω(err).ShouldNot(HaveOccurred())
-
- Ω(byteContent).Should(ContainSubstring("var MyIt = ginkgo.It"))
- Ω(byteContent).ShouldNot(ContainSubstring("var It = ginkgo.It"))
- Ω(byteContent).Should(ContainSubstring("var Ω = gomega.Ω"))
- })
- })
-
- Describe("ginkgo generate", func() {
- var pkgPath string
-
- BeforeEach(func() {
- pkgPath = tmpPath("foo_bar")
- os.Mkdir(pkgPath, 0777)
- })
-
- Context("with no arguments", func() {
- It("should generate a test file named after the package", func() {
- session := startGinkgo(pkgPath, "generate")
- Eventually(session).Should(gexec.Exit(0))
- output := session.Out.Contents()
-
- Ω(output).Should(ContainSubstring("foo_bar_test.go"))
-
- content, err := ioutil.ReadFile(filepath.Join(pkgPath, "foo_bar_test.go"))
- Ω(err).ShouldNot(HaveOccurred())
- Ω(content).Should(ContainSubstring("package foo_bar_test"))
- Ω(content).Should(ContainSubstring(`var _ = Describe("FooBar", func() {`))
- Ω(content).Should(ContainSubstring("\t" + `. "github.com/onsi/ginkgo"`))
- Ω(content).Should(ContainSubstring("\t" + `. "github.com/onsi/gomega"`))
-
- session = startGinkgo(pkgPath, "generate")
- Eventually(session).Should(gexec.Exit(1))
- output = session.Out.Contents()
-
- Ω(output).Should(ContainSubstring("foo_bar_test.go already exists"))
- })
- })
-
- Context("with an argument of the form: foo", func() {
- It("should generate a test file named after the argument", func() {
- session := startGinkgo(pkgPath, "generate", "baz_buzz")
- Eventually(session).Should(gexec.Exit(0))
- output := session.Out.Contents()
-
- Ω(output).Should(ContainSubstring("baz_buzz_test.go"))
-
- content, err := ioutil.ReadFile(filepath.Join(pkgPath, "baz_buzz_test.go"))
- Ω(err).ShouldNot(HaveOccurred())
- Ω(content).Should(ContainSubstring("package foo_bar_test"))
- Ω(content).Should(ContainSubstring(`var _ = Describe("BazBuzz", func() {`))
- })
- })
-
- Context("with an argument of the form: foo.go", func() {
- It("should generate a test file named after the argument", func() {
- session := startGinkgo(pkgPath, "generate", "baz_buzz.go")
- Eventually(session).Should(gexec.Exit(0))
- output := session.Out.Contents()
-
- Ω(output).Should(ContainSubstring("baz_buzz_test.go"))
-
- content, err := ioutil.ReadFile(filepath.Join(pkgPath, "baz_buzz_test.go"))
- Ω(err).ShouldNot(HaveOccurred())
- Ω(content).Should(ContainSubstring("package foo_bar_test"))
- Ω(content).Should(ContainSubstring(`var _ = Describe("BazBuzz", func() {`))
-
- })
- })
-
- Context("with an argument of the form: foo_test", func() {
- It("should generate a test file named after the argument", func() {
- session := startGinkgo(pkgPath, "generate", "baz_buzz_test")
- Eventually(session).Should(gexec.Exit(0))
- output := session.Out.Contents()
-
- Ω(output).Should(ContainSubstring("baz_buzz_test.go"))
-
- content, err := ioutil.ReadFile(filepath.Join(pkgPath, "baz_buzz_test.go"))
- Ω(err).ShouldNot(HaveOccurred())
- Ω(content).Should(ContainSubstring("package foo_bar_test"))
- Ω(content).Should(ContainSubstring(`var _ = Describe("BazBuzz", func() {`))
- })
- })
-
- Context("with an argument of the form: foo_test.go", func() {
- It("should generate a test file named after the argument", func() {
- session := startGinkgo(pkgPath, "generate", "baz_buzz_test.go")
- Eventually(session).Should(gexec.Exit(0))
- output := session.Out.Contents()
-
- Ω(output).Should(ContainSubstring("baz_buzz_test.go"))
-
- content, err := ioutil.ReadFile(filepath.Join(pkgPath, "baz_buzz_test.go"))
- Ω(err).ShouldNot(HaveOccurred())
- Ω(content).Should(ContainSubstring("package foo_bar_test"))
- Ω(content).Should(ContainSubstring(`var _ = Describe("BazBuzz", func() {`))
- })
- })
-
- Context("with multiple arguments", func() {
- It("should generate a test file named after the argument", func() {
- session := startGinkgo(pkgPath, "generate", "baz", "buzz")
- Eventually(session).Should(gexec.Exit(0))
- output := session.Out.Contents()
-
- Ω(output).Should(ContainSubstring("baz_test.go"))
- Ω(output).Should(ContainSubstring("buzz_test.go"))
-
- content, err := ioutil.ReadFile(filepath.Join(pkgPath, "baz_test.go"))
- Ω(err).ShouldNot(HaveOccurred())
- Ω(content).Should(ContainSubstring("package foo_bar_test"))
- Ω(content).Should(ContainSubstring(`var _ = Describe("Baz", func() {`))
-
- content, err = ioutil.ReadFile(filepath.Join(pkgPath, "buzz_test.go"))
- Ω(err).ShouldNot(HaveOccurred())
- Ω(content).Should(ContainSubstring("package foo_bar_test"))
- Ω(content).Should(ContainSubstring(`var _ = Describe("Buzz", func() {`))
- })
- })
-
- Context("with nodot", func() {
- It("should not import ginkgo or gomega", func() {
- session := startGinkgo(pkgPath, "generate", "--nodot")
- Eventually(session).Should(gexec.Exit(0))
- output := session.Out.Contents()
-
- Ω(output).Should(ContainSubstring("foo_bar_test.go"))
-
- content, err := ioutil.ReadFile(filepath.Join(pkgPath, "foo_bar_test.go"))
- Ω(err).ShouldNot(HaveOccurred())
- Ω(content).Should(ContainSubstring("package foo_bar_test"))
- Ω(content).ShouldNot(ContainSubstring("\t" + `. "github.com/onsi/ginkgo"`))
- Ω(content).ShouldNot(ContainSubstring("\t" + `. "github.com/onsi/gomega"`))
- })
- })
-
- Context("with agouti", func() {
- It("should generate an agouti test file", func() {
- session := startGinkgo(pkgPath, "generate", "--agouti")
- Eventually(session).Should(gexec.Exit(0))
- output := session.Out.Contents()
-
- Ω(output).Should(ContainSubstring("foo_bar_test.go"))
-
- content, err := ioutil.ReadFile(filepath.Join(pkgPath, "foo_bar_test.go"))
- Ω(err).ShouldNot(HaveOccurred())
- Ω(content).Should(ContainSubstring("package foo_bar_test"))
- Ω(content).Should(ContainSubstring("\t" + `. "github.com/onsi/ginkgo"`))
- Ω(content).Should(ContainSubstring("\t" + `. "github.com/onsi/gomega"`))
- Ω(content).Should(ContainSubstring("\t" + `. "github.com/sclevine/agouti/matchers"`))
- Ω(content).Should(ContainSubstring("\t" + `"github.com/sclevine/agouti"`))
- Ω(content).Should(ContainSubstring("page, err = agoutiDriver.NewPage()"))
- })
- })
- })
-
- Describe("ginkgo bootstrap/generate", func() {
- var pkgPath string
- BeforeEach(func() {
- pkgPath = tmpPath("some crazy-thing")
- os.Mkdir(pkgPath, 0777)
- })
-
- Context("when the working directory is empty", func() {
- It("generates correctly named bootstrap and generate files with a package name derived from the directory", func() {
- session := startGinkgo(pkgPath, "bootstrap")
- Eventually(session).Should(gexec.Exit(0))
-
- content, err := ioutil.ReadFile(filepath.Join(pkgPath, "some_crazy_thing_suite_test.go"))
- Ω(err).ShouldNot(HaveOccurred())
- Ω(content).Should(ContainSubstring("package some_crazy_thing_test"))
- Ω(content).Should(ContainSubstring("SomeCrazyThing Suite"))
-
- session = startGinkgo(pkgPath, "generate")
- Eventually(session).Should(gexec.Exit(0))
-
- content, err = ioutil.ReadFile(filepath.Join(pkgPath, "some_crazy_thing_test.go"))
- Ω(err).ShouldNot(HaveOccurred())
- Ω(content).Should(ContainSubstring("package some_crazy_thing_test"))
- Ω(content).Should(ContainSubstring("SomeCrazyThing"))
- })
- })
-
- Context("when the working directory contains a file with a package name", func() {
- BeforeEach(func() {
- Ω(ioutil.WriteFile(filepath.Join(pkgPath, "foo.go"), []byte("package main\n\nfunc main() {}"), 0777)).Should(Succeed())
- })
-
- It("generates correctly named bootstrap and generate files with the package name", func() {
- session := startGinkgo(pkgPath, "bootstrap")
- Eventually(session).Should(gexec.Exit(0))
-
- content, err := ioutil.ReadFile(filepath.Join(pkgPath, "some_crazy_thing_suite_test.go"))
- Ω(err).ShouldNot(HaveOccurred())
- Ω(content).Should(ContainSubstring("package main_test"))
- Ω(content).Should(ContainSubstring("SomeCrazyThing Suite"))
-
- session = startGinkgo(pkgPath, "generate")
- Eventually(session).Should(gexec.Exit(0))
-
- content, err = ioutil.ReadFile(filepath.Join(pkgPath, "some_crazy_thing_test.go"))
- Ω(err).ShouldNot(HaveOccurred())
- Ω(content).Should(ContainSubstring("package main_test"))
- Ω(content).Should(ContainSubstring("SomeCrazyThing"))
- })
- })
- })
-
- Describe("ginkgo blur", func() {
- It("should unfocus tests", func() {
- pathToTest := tmpPath("focused")
- fixture := fixturePath("focused_fixture")
- copyIn(fixture, pathToTest, false)
-
- session := startGinkgo(pathToTest, "--noColor")
- Eventually(session).Should(gexec.Exit(types.GINKGO_FOCUS_EXIT_CODE))
- output := session.Out.Contents()
-
- Ω(string(output)).Should(ContainSubstring("8 Passed"))
- Ω(string(output)).Should(ContainSubstring("5 Skipped"))
-
- session = startGinkgo(pathToTest, "blur")
- Eventually(session).Should(gexec.Exit(0))
- output = session.Out.Contents()
- Ω(string(output)).ShouldNot(ContainSubstring("expected 'package'"))
-
- session = startGinkgo(pathToTest, "--noColor")
- Eventually(session).Should(gexec.Exit(0))
- output = session.Out.Contents()
- Ω(string(output)).Should(ContainSubstring("13 Passed"))
- Ω(string(output)).Should(ContainSubstring("0 Skipped"))
-
- Expect(sameFile(filepath.Join(pathToTest, "README.md"), filepath.Join(fixture, "README.md"))).To(BeTrue())
- })
-
- It("should ignore the 'vendor' folder", func() {
- pathToTest := tmpPath("focused_fixture_with_vendor")
- copyIn(fixturePath("focused_fixture_with_vendor"), pathToTest, true)
-
- session := startGinkgo(pathToTest, "blur")
- Eventually(session).Should(gexec.Exit(0))
-
- session = startGinkgo(pathToTest, "--noColor")
- Eventually(session).Should(gexec.Exit(0))
- output := session.Out.Contents()
- Expect(string(output)).To(ContainSubstring("13 Passed"))
- Expect(string(output)).To(ContainSubstring("0 Skipped"))
-
- vendorPath := fixturePath("focused_fixture_with_vendor/vendor")
- otherVendorPath := filepath.Join(pathToTest, "vendor")
-
- Expect(sameFolder(vendorPath, otherVendorPath)).To(BeTrue())
- })
- })
-
- Describe("ginkgo version", func() {
- It("should print out the version info", func() {
- session := startGinkgo("", "version")
- Eventually(session).Should(gexec.Exit(0))
- output := session.Out.Contents()
-
- Ω(output).Should(MatchRegexp(`Ginkgo Version \d+\.\d+\.\d+`))
- })
- })
-
- Describe("ginkgo help", func() {
- It("should print out usage information", func() {
- session := startGinkgo("", "help")
- Eventually(session).Should(gexec.Exit(0))
- output := string(session.Err.Contents())
-
- Ω(output).Should(MatchRegexp(`Ginkgo Version \d+\.\d+\.\d+`))
- Ω(output).Should(ContainSubstring("ginkgo watch"))
- Ω(output).Should(ContainSubstring("-succinct"))
- Ω(output).Should(ContainSubstring("-nodes"))
- Ω(output).Should(ContainSubstring("ginkgo generate"))
- Ω(output).Should(ContainSubstring("ginkgo help <COMMAND>"))
- })
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/integration/suite_command_test.go b/vendor/github.com/onsi/ginkgo/integration/suite_command_test.go
deleted file mode 100644
index 4aec1bc41..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/suite_command_test.go
+++ /dev/null
@@ -1,63 +0,0 @@
-package integration_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
- "github.com/onsi/gomega/gexec"
-)
-
-var _ = Describe("Suite Command Specs", func() {
- var pathToTest string
-
- BeforeEach(func() {
- pathToTest = tmpPath("suite_command")
- copyIn(fixturePath("suite_command_tests"), pathToTest, false)
- })
-
- It("Runs command after suite echoing out suite data, properly reporting suite name and passing status in successful command output", func() {
- command := "-afterSuiteHook=echo THIS IS A (ginkgo-suite-passed) TEST OF THE (ginkgo-suite-name) SYSTEM, THIS IS ONLY A TEST"
- expected := "THIS IS A [PASS] TEST OF THE suite_command SYSTEM, THIS IS ONLY A TEST"
- session := startGinkgo(pathToTest, command)
- Eventually(session).Should(gexec.Exit(0))
- output := string(session.Out.Contents())
-
- Ω(output).Should(ContainSubstring("1 Passed"))
- Ω(output).Should(ContainSubstring("0 Failed"))
- Ω(output).Should(ContainSubstring("1 Pending"))
- Ω(output).Should(ContainSubstring("0 Skipped"))
- Ω(output).Should(ContainSubstring("Test Suite Passed"))
- Ω(output).Should(ContainSubstring("Post-suite command succeeded:"))
- Ω(output).Should(ContainSubstring(expected))
- })
-
- It("Runs command after suite reporting that command failed", func() {
- command := "-afterSuiteHook=exit 1"
- session := startGinkgo(pathToTest, command)
- Eventually(session).Should(gexec.Exit(0))
- output := string(session.Out.Contents())
-
- Ω(output).Should(ContainSubstring("1 Passed"))
- Ω(output).Should(ContainSubstring("0 Failed"))
- Ω(output).Should(ContainSubstring("1 Pending"))
- Ω(output).Should(ContainSubstring("0 Skipped"))
- Ω(output).Should(ContainSubstring("Test Suite Passed"))
- Ω(output).Should(ContainSubstring("Post-suite command failed:"))
- })
-
- It("Runs command after suite echoing out suite data, properly reporting suite name and failing status in successful command output", func() {
- command := "-afterSuiteHook=echo THIS IS A (ginkgo-suite-passed) TEST OF THE (ginkgo-suite-name) SYSTEM, THIS IS ONLY A TEST"
- expected := "THIS IS A [FAIL] TEST OF THE suite_command SYSTEM, THIS IS ONLY A TEST"
- session := startGinkgo(pathToTest, "-failOnPending=true", command)
- Eventually(session).Should(gexec.Exit(1))
- output := string(session.Out.Contents())
-
- Ω(output).Should(ContainSubstring("1 Passed"))
- Ω(output).Should(ContainSubstring("0 Failed"))
- Ω(output).Should(ContainSubstring("1 Pending"))
- Ω(output).Should(ContainSubstring("0 Skipped"))
- Ω(output).Should(ContainSubstring("Test Suite Failed"))
- Ω(output).Should(ContainSubstring("Post-suite command succeeded:"))
- Ω(output).Should(ContainSubstring(expected))
- })
-
-})
diff --git a/vendor/github.com/onsi/ginkgo/integration/suite_setup_test.go b/vendor/github.com/onsi/ginkgo/integration/suite_setup_test.go
deleted file mode 100644
index 33ff5b983..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/suite_setup_test.go
+++ /dev/null
@@ -1,178 +0,0 @@
-package integration_test
-
-import (
- "strings"
-
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
- "github.com/onsi/gomega/gexec"
-)
-
-var _ = Describe("SuiteSetup", func() {
- var pathToTest string
-
- Context("when the BeforeSuite and AfterSuite pass", func() {
- BeforeEach(func() {
- pathToTest = tmpPath("suite_setup")
- copyIn(fixturePath("passing_suite_setup"), pathToTest, false)
- })
-
- It("should run the BeforeSuite once, then run all the tests", func() {
- session := startGinkgo(pathToTest, "--noColor")
- Eventually(session).Should(gexec.Exit(0))
- output := string(session.Out.Contents())
-
- Ω(strings.Count(output, "BEFORE SUITE")).Should(Equal(1))
- Ω(strings.Count(output, "AFTER SUITE")).Should(Equal(1))
- })
-
- It("should run the BeforeSuite once per parallel node, then run all the tests", func() {
- session := startGinkgo(pathToTest, "--noColor", "--nodes=2")
- Eventually(session).Should(gexec.Exit(0))
- output := string(session.Out.Contents())
-
- Ω(strings.Count(output, "BEFORE SUITE")).Should(Equal(2))
- Ω(strings.Count(output, "AFTER SUITE")).Should(Equal(2))
- })
- })
-
- Context("when the BeforeSuite fails", func() {
- BeforeEach(func() {
- pathToTest = tmpPath("suite_setup")
- copyIn(fixturePath("failing_before_suite"), pathToTest, false)
- })
-
- It("should run the BeforeSuite once, none of the tests, but it should run the AfterSuite", func() {
- session := startGinkgo(pathToTest, "--noColor")
- Eventually(session).Should(gexec.Exit(1))
- output := string(session.Out.Contents())
-
- Ω(strings.Count(output, "BEFORE SUITE")).Should(Equal(1))
- Ω(strings.Count(output, "Test Panicked")).Should(Equal(1))
- Ω(strings.Count(output, "AFTER SUITE")).Should(Equal(1))
- Ω(output).ShouldNot(ContainSubstring("NEVER SEE THIS"))
- })
-
- It("should run the BeforeSuite once per parallel node, none of the tests, but it should run the AfterSuite for each node", func() {
- session := startGinkgo(pathToTest, "--noColor", "--nodes=2")
- Eventually(session).Should(gexec.Exit(1))
- output := string(session.Out.Contents())
-
- Ω(strings.Count(output, "BEFORE SUITE")).Should(Equal(2))
- Ω(strings.Count(output, "Test Panicked")).Should(Equal(2))
- Ω(strings.Count(output, "AFTER SUITE")).Should(Equal(2))
- Ω(output).ShouldNot(ContainSubstring("NEVER SEE THIS"))
- })
- })
-
- Context("when the AfterSuite fails", func() {
- BeforeEach(func() {
- pathToTest = tmpPath("suite_setup")
- copyIn(fixturePath("failing_after_suite"), pathToTest, false)
- })
-
- It("should run the BeforeSuite once, none of the tests, but it should run the AfterSuite", func() {
- session := startGinkgo(pathToTest, "--noColor")
- Eventually(session).Should(gexec.Exit(1))
- output := string(session.Out.Contents())
-
- Ω(strings.Count(output, "BEFORE SUITE")).Should(Equal(1))
- Ω(strings.Count(output, "AFTER SUITE")).Should(Equal(1))
- Ω(strings.Count(output, "Test Panicked")).Should(Equal(1))
- Ω(strings.Count(output, "A TEST")).Should(Equal(2))
- })
-
- It("should run the BeforeSuite once per parallel node, none of the tests, but it should run the AfterSuite for each node", func() {
- session := startGinkgo(pathToTest, "--noColor", "--nodes=2")
- Eventually(session).Should(gexec.Exit(1))
- output := string(session.Out.Contents())
-
- Ω(strings.Count(output, "BEFORE SUITE")).Should(Equal(2))
- Ω(strings.Count(output, "AFTER SUITE")).Should(Equal(2))
- Ω(strings.Count(output, "Test Panicked")).Should(Equal(2))
- Ω(strings.Count(output, "A TEST")).Should(Equal(2))
- })
- })
-
- Context("With passing synchronized before and after suites", func() {
- BeforeEach(func() {
- pathToTest = tmpPath("suite_setup")
- copyIn(fixturePath("synchronized_setup_tests"), pathToTest, false)
- })
-
- Context("when run with one node", func() {
- It("should do all the work on that one node", func() {
- session := startGinkgo(pathToTest, "--noColor")
- Eventually(session).Should(gexec.Exit(0))
- output := string(session.Out.Contents())
-
- Ω(output).Should(ContainSubstring("BEFORE_A_1\nBEFORE_B_1: DATA"))
- Ω(output).Should(ContainSubstring("AFTER_A_1\nAFTER_B_1"))
- })
- })
-
- Context("when run across multiple nodes", func() {
- It("should run the first BeforeSuite function (BEFORE_A) on node 1, the second (BEFORE_B) on all the nodes, the first AfterSuite (AFTER_A) on all the nodes, and then the second (AFTER_B) on Node 1 *after* everything else is finished", func() {
- session := startGinkgo(pathToTest, "--noColor", "--nodes=3")
- Eventually(session).Should(gexec.Exit(0))
- output := string(session.Out.Contents())
-
- Ω(output).Should(ContainSubstring("BEFORE_A_1"))
- Ω(output).Should(ContainSubstring("BEFORE_B_1: DATA"))
- Ω(output).Should(ContainSubstring("BEFORE_B_2: DATA"))
- Ω(output).Should(ContainSubstring("BEFORE_B_3: DATA"))
-
- Ω(output).ShouldNot(ContainSubstring("BEFORE_A_2"))
- Ω(output).ShouldNot(ContainSubstring("BEFORE_A_3"))
-
- Ω(output).Should(ContainSubstring("AFTER_A_1"))
- Ω(output).Should(ContainSubstring("AFTER_A_2"))
- Ω(output).Should(ContainSubstring("AFTER_A_3"))
- Ω(output).Should(ContainSubstring("AFTER_B_1"))
-
- Ω(output).ShouldNot(ContainSubstring("AFTER_B_2"))
- Ω(output).ShouldNot(ContainSubstring("AFTER_B_3"))
- })
- })
-
- Context("when streaming across multiple nodes", func() {
- It("should run the first BeforeSuite function (BEFORE_A) on node 1, the second (BEFORE_B) on all the nodes, the first AfterSuite (AFTER_A) on all the nodes, and then the second (AFTER_B) on Node 1 *after* everything else is finished", func() {
- session := startGinkgo(pathToTest, "--noColor", "--nodes=3", "--stream")
- Eventually(session).Should(gexec.Exit(0))
- output := string(session.Out.Contents())
-
- Ω(output).Should(ContainSubstring("[1] BEFORE_A_1"))
- Ω(output).Should(ContainSubstring("[1] BEFORE_B_1: DATA"))
- Ω(output).Should(ContainSubstring("[2] BEFORE_B_2: DATA"))
- Ω(output).Should(ContainSubstring("[3] BEFORE_B_3: DATA"))
-
- Ω(output).ShouldNot(ContainSubstring("BEFORE_A_2"))
- Ω(output).ShouldNot(ContainSubstring("BEFORE_A_3"))
-
- Ω(output).Should(ContainSubstring("[1] AFTER_A_1"))
- Ω(output).Should(ContainSubstring("[2] AFTER_A_2"))
- Ω(output).Should(ContainSubstring("[3] AFTER_A_3"))
- Ω(output).Should(ContainSubstring("[1] AFTER_B_1"))
-
- Ω(output).ShouldNot(ContainSubstring("AFTER_B_2"))
- Ω(output).ShouldNot(ContainSubstring("AFTER_B_3"))
- })
- })
- })
-
- Context("With a failing synchronized before suite", func() {
- BeforeEach(func() {
- pathToTest = tmpPath("suite_setup")
- copyIn(fixturePath("exiting_synchronized_setup_tests"), pathToTest, false)
- })
-
- It("should fail and let the user know that node 1 disappeared prematurely", func() {
- session := startGinkgo(pathToTest, "--noColor", "--nodes=3")
- Eventually(session).Should(gexec.Exit(1))
- output := string(session.Out.Contents())
-
- Ω(output).Should(ContainSubstring("Node 1 disappeared before completing BeforeSuite"))
- Ω(output).Should(ContainSubstring("Ginkgo timed out waiting for all parallel nodes to report back!"))
- })
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/integration/tags_test.go b/vendor/github.com/onsi/ginkgo/integration/tags_test.go
deleted file mode 100644
index fc2ff5e5c..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/tags_test.go
+++ /dev/null
@@ -1,27 +0,0 @@
-package integration_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
- "github.com/onsi/gomega/gexec"
-)
-
-var _ = Describe("Tags", func() {
- var pathToTest string
- BeforeEach(func() {
- pathToTest = tmpPath("tags")
- copyIn(fixturePath("tags_tests"), pathToTest, false)
- })
-
- It("should honor the passed in -tags flag", func() {
- session := startGinkgo(pathToTest, "--noColor")
- Eventually(session).Should(gexec.Exit(0))
- output := string(session.Out.Contents())
- Ω(output).Should(ContainSubstring("Ran 1 of 1 Specs"))
-
- session = startGinkgo(pathToTest, "--noColor", "-tags=complex_tests")
- Eventually(session).Should(gexec.Exit(0))
- output = string(session.Out.Contents())
- Ω(output).Should(ContainSubstring("Ran 3 of 3 Specs"))
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/integration/test_description_test.go b/vendor/github.com/onsi/ginkgo/integration/test_description_test.go
deleted file mode 100644
index 6739871fb..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/test_description_test.go
+++ /dev/null
@@ -1,25 +0,0 @@
-package integration_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
- "github.com/onsi/gomega/gbytes"
- "github.com/onsi/gomega/gexec"
-)
-
-var _ = Describe("TestDescription", func() {
- var pathToTest string
-
- BeforeEach(func() {
- pathToTest = tmpPath("test_description")
- copyIn(fixturePath("test_description"), pathToTest, false)
- })
-
- It("should capture and emit information about the current test", func() {
- session := startGinkgo(pathToTest, "--noColor")
- Eventually(session).Should(gexec.Exit(1))
-
- Ω(session).Should(gbytes.Say("TestDescription should pass:false"))
- Ω(session).Should(gbytes.Say("TestDescription should fail:true"))
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/integration/verbose_and_succinct_test.go b/vendor/github.com/onsi/ginkgo/integration/verbose_and_succinct_test.go
deleted file mode 100644
index 8238762d1..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/verbose_and_succinct_test.go
+++ /dev/null
@@ -1,90 +0,0 @@
-package integration_test
-
-import (
- "regexp"
- "runtime"
-
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
- "github.com/onsi/gomega/gexec"
-)
-
-var _ = Describe("Verbose And Succinct Mode", func() {
- var pathToTest string
- var otherPathToTest string
-
- isWindows := (runtime.GOOS == "windows")
- denoter := "•"
-
- if isWindows {
- denoter = "+"
- }
-
- Context("when running one package", func() {
- BeforeEach(func() {
- pathToTest = tmpPath("ginkgo")
- copyIn(fixturePath("passing_ginkgo_tests"), pathToTest, false)
- })
-
- It("should default to non-succinct mode", func() {
- session := startGinkgo(pathToTest, "--noColor")
- Eventually(session).Should(gexec.Exit(0))
- output := session.Out.Contents()
-
- Ω(output).Should(ContainSubstring("Running Suite: Passing_ginkgo_tests Suite"))
- })
- })
-
- Context("when running more than one package", func() {
- BeforeEach(func() {
- pathToTest = tmpPath("ginkgo")
- copyIn(fixturePath("passing_ginkgo_tests"), pathToTest, false)
- otherPathToTest = tmpPath("more_ginkgo")
- copyIn(fixturePath("more_ginkgo_tests"), otherPathToTest, false)
- })
-
- Context("with no flags set", func() {
- It("should default to succinct mode", func() {
- session := startGinkgo(pathToTest, "--noColor", pathToTest, otherPathToTest)
- Eventually(session).Should(gexec.Exit(0))
- output := session.Out.Contents()
-
- Ω(output).Should(MatchRegexp(`\] Passing_ginkgo_tests Suite - 4/4 specs [%s]{4} SUCCESS!`, regexp.QuoteMeta(denoter)))
- Ω(output).Should(MatchRegexp(`\] More_ginkgo_tests Suite - 2/2 specs [%s]{2} SUCCESS!`, regexp.QuoteMeta(denoter)))
- })
- })
-
- Context("with --succinct=false", func() {
- It("should not be in succinct mode", func() {
- session := startGinkgo(pathToTest, "--noColor", "--succinct=false", pathToTest, otherPathToTest)
- Eventually(session).Should(gexec.Exit(0))
- output := session.Out.Contents()
-
- Ω(output).Should(ContainSubstring("Running Suite: Passing_ginkgo_tests Suite"))
- Ω(output).Should(ContainSubstring("Running Suite: More_ginkgo_tests Suite"))
- })
- })
-
- Context("with -v", func() {
- It("should not be in succinct mode, but should be verbose", func() {
- session := startGinkgo(pathToTest, "--noColor", "-v", pathToTest, otherPathToTest)
- Eventually(session).Should(gexec.Exit(0))
- output := session.Out.Contents()
-
- Ω(output).Should(ContainSubstring("Running Suite: Passing_ginkgo_tests Suite"))
- Ω(output).Should(ContainSubstring("Running Suite: More_ginkgo_tests Suite"))
- Ω(output).Should(ContainSubstring("should proxy strings"))
- Ω(output).Should(ContainSubstring("should always pass"))
- })
-
- It("should emit output from Bys", func() {
- session := startGinkgo(pathToTest, "--noColor", "-v", pathToTest)
- Eventually(session).Should(gexec.Exit(0))
- output := session.Out.Contents()
-
- Ω(output).Should(ContainSubstring("emitting one By"))
- Ω(output).Should(ContainSubstring("emitting another By"))
- })
- })
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/integration/watch_test.go b/vendor/github.com/onsi/ginkgo/integration/watch_test.go
deleted file mode 100644
index 1d65702a7..000000000
--- a/vendor/github.com/onsi/ginkgo/integration/watch_test.go
+++ /dev/null
@@ -1,275 +0,0 @@
-package integration_test
-
-import (
- "io/ioutil"
- "os"
- "path/filepath"
- "time"
-
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
- "github.com/onsi/gomega/gbytes"
- "github.com/onsi/gomega/gexec"
-)
-
-var _ = Describe("Watch", func() {
- var rootPath string
- var pathA string
- var pathB string
- var pathC string
- var session *gexec.Session
-
- BeforeEach(func() {
- rootPath = tmpPath("root")
- pathA = filepath.Join(rootPath, "src", "github.com", "onsi", "A")
- pathB = filepath.Join(rootPath, "src", "github.com", "onsi", "B")
- pathC = filepath.Join(rootPath, "src", "github.com", "onsi", "C")
-
- err := os.MkdirAll(pathA, 0700)
- Ω(err).ShouldNot(HaveOccurred())
-
- err = os.MkdirAll(pathB, 0700)
- Ω(err).ShouldNot(HaveOccurred())
-
- err = os.MkdirAll(pathC, 0700)
- Ω(err).ShouldNot(HaveOccurred())
-
- copyIn(fixturePath(filepath.Join("watch_fixtures", "A")), pathA, false)
- copyIn(fixturePath(filepath.Join("watch_fixtures", "B")), pathB, false)
- copyIn(fixturePath(filepath.Join("watch_fixtures", "C")), pathC, false)
- })
-
- startGinkgoWithGopath := func(args ...string) *gexec.Session {
- cmd := ginkgoCommand(rootPath, args...)
- os.Setenv("GOPATH", rootPath+":"+os.Getenv("GOPATH"))
- session, err := gexec.Start(cmd, GinkgoWriter, GinkgoWriter)
- Ω(err).ShouldNot(HaveOccurred())
- return session
- }
-
- modifyFile := func(path string) {
- time.Sleep(time.Second)
- content, err := ioutil.ReadFile(path)
- Ω(err).ShouldNot(HaveOccurred())
- content = append(content, []byte("//")...)
- err = ioutil.WriteFile(path, content, 0666)
- Ω(err).ShouldNot(HaveOccurred())
- }
-
- modifyCode := func(pkgToModify string) {
- modifyFile(filepath.Join(rootPath, "src", "github.com", "onsi", pkgToModify, pkgToModify+".go"))
- }
-
- modifyJSON := func(pkgToModify string) {
- modifyFile(filepath.Join(rootPath, "src", "github.com", "onsi", pkgToModify, pkgToModify+".json"))
- }
-
- modifyTest := func(pkgToModify string) {
- modifyFile(filepath.Join(rootPath, "src", "github.com", "onsi", pkgToModify, pkgToModify+"_test.go"))
- }
-
- AfterEach(func() {
- if session != nil {
- session.Kill().Wait()
- }
- })
-
- It("should be set up correctly", func() {
- session = startGinkgoWithGopath("-r")
- Eventually(session).Should(gexec.Exit(0))
- Ω(session.Out.Contents()).Should(ContainSubstring("A Suite"))
- Ω(session.Out.Contents()).Should(ContainSubstring("B Suite"))
- Ω(session.Out.Contents()).Should(ContainSubstring("C Suite"))
- Ω(session.Out.Contents()).Should(ContainSubstring("Ginkgo ran 3 suites"))
- })
-
- Context("when watching just one test suite", func() {
- It("should immediately run, and should rerun when the test suite changes", func() {
- session = startGinkgoWithGopath("watch", "-succinct", pathA)
- Eventually(session).Should(gbytes.Say("A Suite"))
- modifyCode("A")
- Eventually(session).Should(gbytes.Say("Detected changes in"))
- Eventually(session).Should(gbytes.Say("A Suite"))
- session.Kill().Wait()
- })
- })
-
- Context("when watching several test suites", func() {
- It("should not immediately run, but should rerun a test when its code changes", func() {
- session = startGinkgoWithGopath("watch", "-succinct", "-r")
- Eventually(session).Should(gbytes.Say("Identified 3 test suites"))
- Consistently(session).ShouldNot(gbytes.Say("A Suite|B Suite|C Suite"))
- modifyCode("A")
- Eventually(session).Should(gbytes.Say("Detected changes in"))
- Eventually(session).Should(gbytes.Say("A Suite"))
- Consistently(session).ShouldNot(gbytes.Say("B Suite|C Suite"))
- session.Kill().Wait()
- })
- })
-
- Describe("watching dependencies", func() {
- Context("with a depth of 2", func() {
- It("should watch down to that depth", func() {
- session = startGinkgoWithGopath("watch", "-succinct", "-r", "-depth=2")
- Eventually(session).Should(gbytes.Say("Identified 3 test suites"))
- Eventually(session).Should(gbytes.Say(`A \[2 dependencies\]`))
- Eventually(session).Should(gbytes.Say(`B \[1 dependency\]`))
- Eventually(session).Should(gbytes.Say(`C \[0 dependencies\]`))
-
- modifyCode("A")
- Eventually(session).Should(gbytes.Say("Detected changes in"))
- Eventually(session).Should(gbytes.Say("A Suite"))
- Consistently(session).ShouldNot(gbytes.Say("B Suite|C Suite"))
-
- modifyCode("B")
- Eventually(session).Should(gbytes.Say("Detected changes in"))
- Eventually(session).Should(gbytes.Say("B Suite"))
- Eventually(session).Should(gbytes.Say("A Suite"))
- Consistently(session).ShouldNot(gbytes.Say("C Suite"))
-
- modifyCode("C")
- Eventually(session).Should(gbytes.Say("Detected changes in"))
- Eventually(session).Should(gbytes.Say("C Suite"))
- Eventually(session).Should(gbytes.Say("B Suite"))
- Eventually(session).Should(gbytes.Say("A Suite"))
- })
- })
-
- Context("with a depth of 1", func() {
- It("should watch down to that depth", func() {
- session = startGinkgoWithGopath("watch", "-succinct", "-r", "-depth=1")
- Eventually(session).Should(gbytes.Say("Identified 3 test suites"))
- Eventually(session).Should(gbytes.Say(`A \[1 dependency\]`))
- Eventually(session).Should(gbytes.Say(`B \[1 dependency\]`))
- Eventually(session).Should(gbytes.Say(`C \[0 dependencies\]`))
-
- modifyCode("A")
- Eventually(session).Should(gbytes.Say("Detected changes in"))
- Eventually(session).Should(gbytes.Say("A Suite"))
- Consistently(session).ShouldNot(gbytes.Say("B Suite|C Suite"))
-
- modifyCode("B")
- Eventually(session).Should(gbytes.Say("Detected changes in"))
- Eventually(session).Should(gbytes.Say("B Suite"))
- Eventually(session).Should(gbytes.Say("A Suite"))
- Consistently(session).ShouldNot(gbytes.Say("C Suite"))
-
- modifyCode("C")
- Eventually(session).Should(gbytes.Say("Detected changes in"))
- Eventually(session).Should(gbytes.Say("C Suite"))
- Eventually(session).Should(gbytes.Say("B Suite"))
- Consistently(session).ShouldNot(gbytes.Say("A Suite"))
- })
- })
-
- Context("with a depth of 0", func() {
- It("should not watch any dependencies", func() {
- session = startGinkgoWithGopath("watch", "-succinct", "-r", "-depth=0")
- Eventually(session).Should(gbytes.Say("Identified 3 test suites"))
- Eventually(session).Should(gbytes.Say(`A \[0 dependencies\]`))
- Eventually(session).Should(gbytes.Say(`B \[0 dependencies\]`))
- Eventually(session).Should(gbytes.Say(`C \[0 dependencies\]`))
-
- modifyCode("A")
- Eventually(session).Should(gbytes.Say("Detected changes in"))
- Eventually(session).Should(gbytes.Say("A Suite"))
- Consistently(session).ShouldNot(gbytes.Say("B Suite|C Suite"))
-
- modifyCode("B")
- Eventually(session).Should(gbytes.Say("Detected changes in"))
- Eventually(session).Should(gbytes.Say("B Suite"))
- Consistently(session).ShouldNot(gbytes.Say("A Suite|C Suite"))
-
- modifyCode("C")
- Eventually(session).Should(gbytes.Say("Detected changes in"))
- Eventually(session).Should(gbytes.Say("C Suite"))
- Consistently(session).ShouldNot(gbytes.Say("A Suite|B Suite"))
- })
- })
-
- It("should not trigger dependents when tests are changed", func() {
- session = startGinkgoWithGopath("watch", "-succinct", "-r", "-depth=2")
- Eventually(session).Should(gbytes.Say("Identified 3 test suites"))
- Eventually(session).Should(gbytes.Say(`A \[2 dependencies\]`))
- Eventually(session).Should(gbytes.Say(`B \[1 dependency\]`))
- Eventually(session).Should(gbytes.Say(`C \[0 dependencies\]`))
-
- modifyTest("A")
- Eventually(session).Should(gbytes.Say("Detected changes in"))
- Eventually(session).Should(gbytes.Say("A Suite"))
- Consistently(session).ShouldNot(gbytes.Say("B Suite|C Suite"))
-
- modifyTest("B")
- Eventually(session).Should(gbytes.Say("Detected changes in"))
- Eventually(session).Should(gbytes.Say("B Suite"))
- Consistently(session).ShouldNot(gbytes.Say("A Suite|C Suite"))
-
- modifyTest("C")
- Eventually(session).Should(gbytes.Say("Detected changes in"))
- Eventually(session).Should(gbytes.Say("C Suite"))
- Consistently(session).ShouldNot(gbytes.Say("A Suite|B Suite"))
- })
- })
-
- Describe("adjusting the watch regular expression", func() {
- Describe("the default regular expression", func() {
- It("should only trigger when go files are changed", func() {
- session = startGinkgoWithGopath("watch", "-succinct", "-r", "-depth=2")
- Eventually(session).Should(gbytes.Say("Identified 3 test suites"))
- Eventually(session).Should(gbytes.Say(`A \[2 dependencies\]`))
- Eventually(session).Should(gbytes.Say(`B \[1 dependency\]`))
- Eventually(session).Should(gbytes.Say(`C \[0 dependencies\]`))
-
- modifyJSON("C")
- Consistently(session).ShouldNot(gbytes.Say("Detected changes in"))
- Consistently(session).ShouldNot(gbytes.Say("A Suite|B Suite|C Suite"))
- })
- })
-
- Describe("modifying the regular expression", func() {
- It("should trigger if the regexp matches", func() {
- session = startGinkgoWithGopath("watch", "-succinct", "-r", "-depth=2", `-watchRegExp=\.json$`)
- Eventually(session).Should(gbytes.Say("Identified 3 test suites"))
- Eventually(session).Should(gbytes.Say(`A \[2 dependencies\]`))
- Eventually(session).Should(gbytes.Say(`B \[1 dependency\]`))
- Eventually(session).Should(gbytes.Say(`C \[0 dependencies\]`))
-
- modifyJSON("C")
- Eventually(session).Should(gbytes.Say("Detected changes in"))
- Eventually(session).Should(gbytes.Say("C Suite"))
- Eventually(session).Should(gbytes.Say("B Suite"))
- Eventually(session).Should(gbytes.Say("A Suite"))
- })
- })
- })
-
- Describe("when new test suite is added", func() {
- It("should start monitoring that test suite", func() {
- session = startGinkgoWithGopath("watch", "-succinct", "-r")
-
- Eventually(session).Should(gbytes.Say("Watching 3 suites"))
-
- pathD := filepath.Join(rootPath, "src", "github.com", "onsi", "D")
-
- err := os.MkdirAll(pathD, 0700)
- Ω(err).ShouldNot(HaveOccurred())
-
- copyIn(fixturePath(filepath.Join("watch_fixtures", "D")), pathD, false)
-
- Eventually(session).Should(gbytes.Say("Detected 1 new suite"))
- Eventually(session).Should(gbytes.Say(`D \[1 dependency\]`))
- Eventually(session).Should(gbytes.Say("D Suite"))
-
- modifyCode("D")
-
- Eventually(session).Should(gbytes.Say("Detected changes in"))
- Eventually(session).Should(gbytes.Say("D Suite"))
-
- modifyCode("C")
-
- Eventually(session).Should(gbytes.Say("Detected changes in"))
- Eventually(session).Should(gbytes.Say("C Suite"))
- Eventually(session).Should(gbytes.Say("D Suite"))
- })
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/internal/codelocation/code_location_suite_test.go b/vendor/github.com/onsi/ginkgo/internal/codelocation/code_location_suite_test.go
deleted file mode 100644
index f06abf3c5..000000000
--- a/vendor/github.com/onsi/ginkgo/internal/codelocation/code_location_suite_test.go
+++ /dev/null
@@ -1,13 +0,0 @@
-package codelocation_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-
- "testing"
-)
-
-func TestCodelocation(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "CodeLocation Suite")
-}
diff --git a/vendor/github.com/onsi/ginkgo/internal/codelocation/code_location_test.go b/vendor/github.com/onsi/ginkgo/internal/codelocation/code_location_test.go
deleted file mode 100644
index cca75a449..000000000
--- a/vendor/github.com/onsi/ginkgo/internal/codelocation/code_location_test.go
+++ /dev/null
@@ -1,80 +0,0 @@
-package codelocation_test
-
-import (
- "runtime"
-
- . "github.com/onsi/ginkgo"
- "github.com/onsi/ginkgo/internal/codelocation"
- "github.com/onsi/ginkgo/types"
- . "github.com/onsi/gomega"
-)
-
-var _ = Describe("CodeLocation", func() {
- var (
- codeLocation types.CodeLocation
- expectedFileName string
- expectedLineNumber int
- )
-
- caller0 := func() {
- codeLocation = codelocation.New(1)
- }
-
- caller1 := func() {
- _, expectedFileName, expectedLineNumber, _ = runtime.Caller(0)
- expectedLineNumber += 2
- caller0()
- }
-
- BeforeEach(func() {
- caller1()
- })
-
- It("should use the passed in skip parameter to pick out the correct file & line number", func() {
- Ω(codeLocation.FileName).Should(Equal(expectedFileName))
- Ω(codeLocation.LineNumber).Should(Equal(expectedLineNumber))
- })
-
- Describe("stringer behavior", func() {
- It("should stringify nicely", func() {
- Ω(codeLocation.String()).Should(ContainSubstring("code_location_test.go:%d", expectedLineNumber))
- })
- })
-
- //There's no better way than to test this private method as it
- //goes out of its way to prune out ginkgo related code in the stack trace
- Describe("PruneStack", func() {
- It("should remove any references to ginkgo and pkg/testing and pkg/runtime", func() {
- input := `/Skip/me
-Skip: skip()
-/Skip/me
-Skip: skip()
-/Users/whoever/gospace/src/github.com/onsi/ginkgo/whatever.go:10 (0x12314)
-Something: Func()
-/Users/whoever/gospace/src/github.com/onsi/ginkgo/whatever_else.go:10 (0x12314)
-SomethingInternalToGinkgo: Func()
-/usr/goroot/pkg/strings/oops.go:10 (0x12341)
-Oops: BlowUp()
-/Users/whoever/gospace/src/mycode/code.go:10 (0x12341)
-MyCode: Func()
-/Users/whoever/gospace/src/mycode/code_test.go:10 (0x12341)
-MyCodeTest: Func()
-/Users/whoever/gospace/src/mycode/code_suite_test.go:12 (0x37f08)
-TestFoo: RunSpecs(t, "Foo Suite")
-/usr/goroot/pkg/testing/testing.go:12 (0x37f08)
-TestingT: Blah()
-/usr/goroot/pkg/runtime/runtime.go:12 (0x37f08)
-Something: Func()
-`
- prunedStack := codelocation.PruneStack(input, 1)
- Ω(prunedStack).Should(Equal(`/usr/goroot/pkg/strings/oops.go:10 (0x12341)
-Oops: BlowUp()
-/Users/whoever/gospace/src/mycode/code.go:10 (0x12341)
-MyCode: Func()
-/Users/whoever/gospace/src/mycode/code_test.go:10 (0x12341)
-MyCodeTest: Func()
-/Users/whoever/gospace/src/mycode/code_suite_test.go:12 (0x37f08)
-TestFoo: RunSpecs(t, "Foo Suite")`))
- })
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/internal/containernode/container_node_suite_test.go b/vendor/github.com/onsi/ginkgo/internal/containernode/container_node_suite_test.go
deleted file mode 100644
index c6fc314ff..000000000
--- a/vendor/github.com/onsi/ginkgo/internal/containernode/container_node_suite_test.go
+++ /dev/null
@@ -1,13 +0,0 @@
-package containernode_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-
- "testing"
-)
-
-func TestContainernode(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "Containernode Suite")
-}
diff --git a/vendor/github.com/onsi/ginkgo/internal/containernode/container_node_test.go b/vendor/github.com/onsi/ginkgo/internal/containernode/container_node_test.go
deleted file mode 100644
index 11ac9b70b..000000000
--- a/vendor/github.com/onsi/ginkgo/internal/containernode/container_node_test.go
+++ /dev/null
@@ -1,213 +0,0 @@
-package containernode_test
-
-import (
- "math/rand"
-
- "github.com/onsi/ginkgo/internal/leafnodes"
-
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-
- "github.com/onsi/ginkgo/internal/codelocation"
- . "github.com/onsi/ginkgo/internal/containernode"
- "github.com/onsi/ginkgo/types"
-)
-
-var _ = Describe("Container Node", func() {
- var (
- codeLocation types.CodeLocation
- container *ContainerNode
- )
-
- BeforeEach(func() {
- codeLocation = codelocation.New(0)
- container = New("description text", types.FlagTypeFocused, codeLocation)
- })
-
- Describe("creating a container node", func() {
- It("can answer questions about itself", func() {
- Ω(container.Text()).Should(Equal("description text"))
- Ω(container.Flag()).Should(Equal(types.FlagTypeFocused))
- Ω(container.CodeLocation()).Should(Equal(codeLocation))
- })
- })
-
- Describe("pushing setup nodes", func() {
- It("can append setup nodes of various types and fetch them by type", func() {
- befA := leafnodes.NewBeforeEachNode(func() {}, codelocation.New(0), 0, nil, 0)
- befB := leafnodes.NewBeforeEachNode(func() {}, codelocation.New(0), 0, nil, 0)
- aftA := leafnodes.NewAfterEachNode(func() {}, codelocation.New(0), 0, nil, 0)
- aftB := leafnodes.NewAfterEachNode(func() {}, codelocation.New(0), 0, nil, 0)
- jusBefA := leafnodes.NewJustBeforeEachNode(func() {}, codelocation.New(0), 0, nil, 0)
- jusBefB := leafnodes.NewJustBeforeEachNode(func() {}, codelocation.New(0), 0, nil, 0)
-
- container.PushSetupNode(befA)
- container.PushSetupNode(befB)
- container.PushSetupNode(aftA)
- container.PushSetupNode(aftB)
- container.PushSetupNode(jusBefA)
- container.PushSetupNode(jusBefB)
-
- subject := leafnodes.NewItNode("subject", func() {}, types.FlagTypeNone, codelocation.New(0), 0, nil, 0)
- container.PushSubjectNode(subject)
-
- Ω(container.SetupNodesOfType(types.SpecComponentTypeBeforeEach)).Should(Equal([]leafnodes.BasicNode{befA, befB}))
- Ω(container.SetupNodesOfType(types.SpecComponentTypeAfterEach)).Should(Equal([]leafnodes.BasicNode{aftA, aftB}))
- Ω(container.SetupNodesOfType(types.SpecComponentTypeJustBeforeEach)).Should(Equal([]leafnodes.BasicNode{jusBefA, jusBefB}))
- Ω(container.SetupNodesOfType(types.SpecComponentTypeIt)).Should(BeEmpty()) //subjects are not setup nodes
- })
- })
-
- Context("With appended containers and subject nodes", func() {
- var (
- itA, itB, innerItA, innerItB leafnodes.SubjectNode
- innerContainer *ContainerNode
- )
-
- BeforeEach(func() {
- itA = leafnodes.NewItNode("Banana", func() {}, types.FlagTypeNone, codelocation.New(0), 0, nil, 0)
- itB = leafnodes.NewItNode("Apple", func() {}, types.FlagTypeNone, codelocation.New(0), 0, nil, 0)
-
- innerItA = leafnodes.NewItNode("inner A", func() {}, types.FlagTypeNone, codelocation.New(0), 0, nil, 0)
- innerItB = leafnodes.NewItNode("inner B", func() {}, types.FlagTypeNone, codelocation.New(0), 0, nil, 0)
-
- innerContainer = New("Orange", types.FlagTypeNone, codelocation.New(0))
-
- container.PushSubjectNode(itA)
- container.PushContainerNode(innerContainer)
- innerContainer.PushSubjectNode(innerItA)
- innerContainer.PushSubjectNode(innerItB)
- container.PushSubjectNode(itB)
- })
-
- Describe("Collating", func() {
- It("should return a collated set of containers and subject nodes in the correct order", func() {
- collated := container.Collate()
- Ω(collated).Should(HaveLen(4))
-
- Ω(collated[0]).Should(Equal(CollatedNodes{
- Containers: []*ContainerNode{container},
- Subject: itA,
- }))
-
- Ω(collated[1]).Should(Equal(CollatedNodes{
- Containers: []*ContainerNode{container, innerContainer},
- Subject: innerItA,
- }))
-
- Ω(collated[2]).Should(Equal(CollatedNodes{
- Containers: []*ContainerNode{container, innerContainer},
- Subject: innerItB,
- }))
-
- Ω(collated[3]).Should(Equal(CollatedNodes{
- Containers: []*ContainerNode{container},
- Subject: itB,
- }))
- })
- })
-
- Describe("Backpropagating Programmatic Focus", func() {
- //This allows inner focused specs to override the focus of outer focussed
- //specs and more closely maps to what a developer wants to happen
- //when debugging a test suite
-
- Context("when a parent is focused *and* an inner subject is focused", func() {
- BeforeEach(func() {
- container = New("description text", types.FlagTypeFocused, codeLocation)
- itA = leafnodes.NewItNode("A", func() {}, types.FlagTypeNone, codelocation.New(0), 0, nil, 0)
- container.PushSubjectNode(itA)
-
- innerContainer = New("Orange", types.FlagTypeNone, codelocation.New(0))
- container.PushContainerNode(innerContainer)
- innerItA = leafnodes.NewItNode("inner A", func() {}, types.FlagTypeFocused, codelocation.New(0), 0, nil, 0)
- innerContainer.PushSubjectNode(innerItA)
- })
-
- It("should unfocus the parent", func() {
- container.BackPropagateProgrammaticFocus()
-
- Ω(container.Flag()).Should(Equal(types.FlagTypeNone))
- Ω(itA.Flag()).Should(Equal(types.FlagTypeNone))
- Ω(innerContainer.Flag()).Should(Equal(types.FlagTypeNone))
- Ω(innerItA.Flag()).Should(Equal(types.FlagTypeFocused))
- })
- })
-
- Context("when a parent is focused *and* an inner container is focused", func() {
- BeforeEach(func() {
- container = New("description text", types.FlagTypeFocused, codeLocation)
- itA = leafnodes.NewItNode("A", func() {}, types.FlagTypeNone, codelocation.New(0), 0, nil, 0)
- container.PushSubjectNode(itA)
-
- innerContainer = New("Orange", types.FlagTypeFocused, codelocation.New(0))
- container.PushContainerNode(innerContainer)
- innerItA = leafnodes.NewItNode("inner A", func() {}, types.FlagTypeNone, codelocation.New(0), 0, nil, 0)
- innerContainer.PushSubjectNode(innerItA)
- })
-
- It("should unfocus the parent", func() {
- container.BackPropagateProgrammaticFocus()
-
- Ω(container.Flag()).Should(Equal(types.FlagTypeNone))
- Ω(itA.Flag()).Should(Equal(types.FlagTypeNone))
- Ω(innerContainer.Flag()).Should(Equal(types.FlagTypeFocused))
- Ω(innerItA.Flag()).Should(Equal(types.FlagTypeNone))
- })
- })
-
- Context("when a parent is pending and a child is focused", func() {
- BeforeEach(func() {
- container = New("description text", types.FlagTypeFocused, codeLocation)
- itA = leafnodes.NewItNode("A", func() {}, types.FlagTypeNone, codelocation.New(0), 0, nil, 0)
- container.PushSubjectNode(itA)
-
- innerContainer = New("Orange", types.FlagTypePending, codelocation.New(0))
- container.PushContainerNode(innerContainer)
- innerItA = leafnodes.NewItNode("inner A", func() {}, types.FlagTypeFocused, codelocation.New(0), 0, nil, 0)
- innerContainer.PushSubjectNode(innerItA)
- })
-
- It("should not do anything", func() {
- container.BackPropagateProgrammaticFocus()
-
- Ω(container.Flag()).Should(Equal(types.FlagTypeFocused))
- Ω(itA.Flag()).Should(Equal(types.FlagTypeNone))
- Ω(innerContainer.Flag()).Should(Equal(types.FlagTypePending))
- Ω(innerItA.Flag()).Should(Equal(types.FlagTypeFocused))
- })
- })
- })
-
- Describe("Shuffling", func() {
- var unshuffledCollation []CollatedNodes
- BeforeEach(func() {
- unshuffledCollation = container.Collate()
-
- r := rand.New(rand.NewSource(17))
- container.Shuffle(r)
- })
-
- It("should sort, and then shuffle, the top level contents of the container", func() {
- shuffledCollation := container.Collate()
- Ω(shuffledCollation).Should(HaveLen(len(unshuffledCollation)))
- Ω(shuffledCollation).ShouldNot(Equal(unshuffledCollation))
-
- for _, entry := range unshuffledCollation {
- Ω(shuffledCollation).Should(ContainElement(entry))
- }
-
- innerAIndex, innerBIndex := 0, 0
- for i, entry := range shuffledCollation {
- if entry.Subject == innerItA {
- innerAIndex = i
- } else if entry.Subject == innerItB {
- innerBIndex = i
- }
- }
-
- Ω(innerAIndex).Should(Equal(innerBIndex - 1))
- })
- })
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/internal/failer/failer_suite_test.go b/vendor/github.com/onsi/ginkgo/internal/failer/failer_suite_test.go
deleted file mode 100644
index 8dce7be9a..000000000
--- a/vendor/github.com/onsi/ginkgo/internal/failer/failer_suite_test.go
+++ /dev/null
@@ -1,13 +0,0 @@
-package failer_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-
- "testing"
-)
-
-func TestFailer(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "Failer Suite")
-}
diff --git a/vendor/github.com/onsi/ginkgo/internal/failer/failer_test.go b/vendor/github.com/onsi/ginkgo/internal/failer/failer_test.go
deleted file mode 100644
index 65210a40a..000000000
--- a/vendor/github.com/onsi/ginkgo/internal/failer/failer_test.go
+++ /dev/null
@@ -1,141 +0,0 @@
-package failer_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/ginkgo/internal/failer"
- . "github.com/onsi/gomega"
-
- "github.com/onsi/ginkgo/internal/codelocation"
- "github.com/onsi/ginkgo/types"
-)
-
-var _ = Describe("Failer", func() {
- var (
- failer *Failer
- codeLocationA types.CodeLocation
- codeLocationB types.CodeLocation
- )
-
- BeforeEach(func() {
- codeLocationA = codelocation.New(0)
- codeLocationB = codelocation.New(0)
- failer = New()
- })
-
- Context("with no failures", func() {
- It("should return success when drained", func() {
- failure, state := failer.Drain(types.SpecComponentTypeIt, 3, codeLocationB)
- Ω(failure).Should(BeZero())
- Ω(state).Should(Equal(types.SpecStatePassed))
- })
- })
-
- Describe("Skip", func() {
- It("should handle failures", func() {
- failer.Skip("something skipped", codeLocationA)
- failure, state := failer.Drain(types.SpecComponentTypeIt, 3, codeLocationB)
- Ω(failure).Should(Equal(types.SpecFailure{
- Message: "something skipped",
- Location: codeLocationA,
- ForwardedPanic: "",
- ComponentType: types.SpecComponentTypeIt,
- ComponentIndex: 3,
- ComponentCodeLocation: codeLocationB,
- }))
- Ω(state).Should(Equal(types.SpecStateSkipped))
- })
- })
-
- Describe("Fail", func() {
- It("should handle failures", func() {
- failer.Fail("something failed", codeLocationA)
- failure, state := failer.Drain(types.SpecComponentTypeIt, 3, codeLocationB)
- Ω(failure).Should(Equal(types.SpecFailure{
- Message: "something failed",
- Location: codeLocationA,
- ForwardedPanic: "",
- ComponentType: types.SpecComponentTypeIt,
- ComponentIndex: 3,
- ComponentCodeLocation: codeLocationB,
- }))
- Ω(state).Should(Equal(types.SpecStateFailed))
- })
- })
-
- Describe("Panic", func() {
- It("should handle panics", func() {
- failer.Panic(codeLocationA, "some forwarded panic")
- failure, state := failer.Drain(types.SpecComponentTypeIt, 3, codeLocationB)
- Ω(failure).Should(Equal(types.SpecFailure{
- Message: "Test Panicked",
- Location: codeLocationA,
- ForwardedPanic: "some forwarded panic",
- ComponentType: types.SpecComponentTypeIt,
- ComponentIndex: 3,
- ComponentCodeLocation: codeLocationB,
- }))
- Ω(state).Should(Equal(types.SpecStatePanicked))
- })
- })
-
- Describe("Timeout", func() {
- It("should handle timeouts", func() {
- failer.Timeout(codeLocationA)
- failure, state := failer.Drain(types.SpecComponentTypeIt, 3, codeLocationB)
- Ω(failure).Should(Equal(types.SpecFailure{
- Message: "Timed out",
- Location: codeLocationA,
- ForwardedPanic: "",
- ComponentType: types.SpecComponentTypeIt,
- ComponentIndex: 3,
- ComponentCodeLocation: codeLocationB,
- }))
- Ω(state).Should(Equal(types.SpecStateTimedOut))
- })
- })
-
- Context("when multiple failures are registered", func() {
- BeforeEach(func() {
- failer.Fail("something failed", codeLocationA)
- failer.Fail("something else failed", codeLocationA)
- })
-
- It("should only report the first one when drained", func() {
- failure, state := failer.Drain(types.SpecComponentTypeIt, 3, codeLocationB)
-
- Ω(failure).Should(Equal(types.SpecFailure{
- Message: "something failed",
- Location: codeLocationA,
- ForwardedPanic: "",
- ComponentType: types.SpecComponentTypeIt,
- ComponentIndex: 3,
- ComponentCodeLocation: codeLocationB,
- }))
- Ω(state).Should(Equal(types.SpecStateFailed))
- })
-
- It("should report subsequent failures after being drained", func() {
- failer.Drain(types.SpecComponentTypeIt, 3, codeLocationB)
- failer.Fail("yet another thing failed", codeLocationA)
-
- failure, state := failer.Drain(types.SpecComponentTypeIt, 3, codeLocationB)
-
- Ω(failure).Should(Equal(types.SpecFailure{
- Message: "yet another thing failed",
- Location: codeLocationA,
- ForwardedPanic: "",
- ComponentType: types.SpecComponentTypeIt,
- ComponentIndex: 3,
- ComponentCodeLocation: codeLocationB,
- }))
- Ω(state).Should(Equal(types.SpecStateFailed))
- })
-
- It("should report sucess on subsequent drains if no errors occur", func() {
- failer.Drain(types.SpecComponentTypeIt, 3, codeLocationB)
- failure, state := failer.Drain(types.SpecComponentTypeIt, 3, codeLocationB)
- Ω(failure).Should(BeZero())
- Ω(state).Should(Equal(types.SpecStatePassed))
- })
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/internal/leafnodes/it_node_test.go b/vendor/github.com/onsi/ginkgo/internal/leafnodes/it_node_test.go
deleted file mode 100644
index 29fa0c6e2..000000000
--- a/vendor/github.com/onsi/ginkgo/internal/leafnodes/it_node_test.go
+++ /dev/null
@@ -1,22 +0,0 @@
-package leafnodes_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/ginkgo/internal/leafnodes"
- . "github.com/onsi/gomega"
-
- "github.com/onsi/ginkgo/internal/codelocation"
- "github.com/onsi/ginkgo/types"
-)
-
-var _ = Describe("It Nodes", func() {
- It("should report the correct type, text, flag, and code location", func() {
- codeLocation := codelocation.New(0)
- it := NewItNode("my it node", func() {}, types.FlagTypeFocused, codeLocation, 0, nil, 3)
- Ω(it.Type()).Should(Equal(types.SpecComponentTypeIt))
- Ω(it.Flag()).Should(Equal(types.FlagTypeFocused))
- Ω(it.Text()).Should(Equal("my it node"))
- Ω(it.CodeLocation()).Should(Equal(codeLocation))
- Ω(it.Samples()).Should(Equal(1))
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/internal/leafnodes/leaf_node_suite_test.go b/vendor/github.com/onsi/ginkgo/internal/leafnodes/leaf_node_suite_test.go
deleted file mode 100644
index a7ba9e006..000000000
--- a/vendor/github.com/onsi/ginkgo/internal/leafnodes/leaf_node_suite_test.go
+++ /dev/null
@@ -1,13 +0,0 @@
-package leafnodes_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-
- "testing"
-)
-
-func TestLeafNode(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "LeafNode Suite")
-}
diff --git a/vendor/github.com/onsi/ginkgo/internal/leafnodes/measure_node_test.go b/vendor/github.com/onsi/ginkgo/internal/leafnodes/measure_node_test.go
deleted file mode 100644
index 1cd13336a..000000000
--- a/vendor/github.com/onsi/ginkgo/internal/leafnodes/measure_node_test.go
+++ /dev/null
@@ -1,155 +0,0 @@
-package leafnodes_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/ginkgo/internal/leafnodes"
- . "github.com/onsi/gomega"
-
- "time"
-
- "github.com/onsi/ginkgo/internal/codelocation"
- Failer "github.com/onsi/ginkgo/internal/failer"
- "github.com/onsi/ginkgo/types"
-)
-
-var _ = Describe("Measure Nodes", func() {
- It("should report the correct type, text, flag, and code location", func() {
- codeLocation := codelocation.New(0)
- measure := NewMeasureNode("my measure node", func(b Benchmarker) {}, types.FlagTypeFocused, codeLocation, 10, nil, 3)
- Ω(measure.Type()).Should(Equal(types.SpecComponentTypeMeasure))
- Ω(measure.Flag()).Should(Equal(types.FlagTypeFocused))
- Ω(measure.Text()).Should(Equal("my measure node"))
- Ω(measure.CodeLocation()).Should(Equal(codeLocation))
- Ω(measure.Samples()).Should(Equal(10))
- })
-
- Describe("benchmarking", func() {
- var measure *MeasureNode
-
- Describe("Value", func() {
- BeforeEach(func() {
- measure = NewMeasureNode("the measurement", func(b Benchmarker) {
- b.RecordValue("foo", 7, "info!")
- b.RecordValue("foo", 2)
- b.RecordValue("foo", 3)
- b.RecordValue("bar", 0.3)
- b.RecordValue("bar", 0.1)
- b.RecordValue("bar", 0.5)
- b.RecordValue("bar", 0.7)
- }, types.FlagTypeFocused, codelocation.New(0), 1, Failer.New(), 3)
- Ω(measure.Run()).Should(Equal(types.SpecStatePassed))
- })
-
- It("records passed in values and reports on them", func() {
- report := measure.MeasurementsReport()
- Ω(report).Should(HaveLen(2))
- Ω(report["foo"].Name).Should(Equal("foo"))
- Ω(report["foo"].Info).Should(Equal("info!"))
- Ω(report["foo"].Order).Should(Equal(0))
- Ω(report["foo"].SmallestLabel).Should(Equal("Smallest"))
- Ω(report["foo"].LargestLabel).Should(Equal(" Largest"))
- Ω(report["foo"].AverageLabel).Should(Equal(" Average"))
- Ω(report["foo"].Units).Should(Equal(""))
- Ω(report["foo"].Results).Should(Equal([]float64{7, 2, 3}))
- Ω(report["foo"].Smallest).Should(BeNumerically("==", 2))
- Ω(report["foo"].Largest).Should(BeNumerically("==", 7))
- Ω(report["foo"].Average).Should(BeNumerically("==", 4))
- Ω(report["foo"].StdDeviation).Should(BeNumerically("~", 2.16, 0.01))
-
- Ω(report["bar"].Name).Should(Equal("bar"))
- Ω(report["bar"].Info).Should(BeNil())
- Ω(report["bar"].SmallestLabel).Should(Equal("Smallest"))
- Ω(report["bar"].Order).Should(Equal(1))
- Ω(report["bar"].LargestLabel).Should(Equal(" Largest"))
- Ω(report["bar"].AverageLabel).Should(Equal(" Average"))
- Ω(report["bar"].Units).Should(Equal(""))
- Ω(report["bar"].Results).Should(Equal([]float64{0.3, 0.1, 0.5, 0.7}))
- Ω(report["bar"].Smallest).Should(BeNumerically("==", 0.1))
- Ω(report["bar"].Largest).Should(BeNumerically("==", 0.7))
- Ω(report["bar"].Average).Should(BeNumerically("==", 0.4))
- Ω(report["bar"].StdDeviation).Should(BeNumerically("~", 0.22, 0.01))
- })
- })
-
- Describe("Value with precision", func() {
- BeforeEach(func() {
- measure = NewMeasureNode("the measurement", func(b Benchmarker) {
- b.RecordValueWithPrecision("foo", 7, "ms", 7, "info!")
- b.RecordValueWithPrecision("foo", 2, "ms", 6)
- b.RecordValueWithPrecision("foo", 3, "ms", 5)
- b.RecordValueWithPrecision("bar", 0.3, "ns", 4)
- b.RecordValueWithPrecision("bar", 0.1, "ns", 3)
- b.RecordValueWithPrecision("bar", 0.5, "ns", 2)
- b.RecordValueWithPrecision("bar", 0.7, "ns", 1)
- }, types.FlagTypeFocused, codelocation.New(0), 1, Failer.New(), 3)
- Ω(measure.Run()).Should(Equal(types.SpecStatePassed))
- })
-
- It("records passed in values and reports on them", func() {
- report := measure.MeasurementsReport()
- Ω(report).Should(HaveLen(2))
- Ω(report["foo"].Name).Should(Equal("foo"))
- Ω(report["foo"].Info).Should(Equal("info!"))
- Ω(report["foo"].Order).Should(Equal(0))
- Ω(report["foo"].SmallestLabel).Should(Equal("Smallest"))
- Ω(report["foo"].LargestLabel).Should(Equal(" Largest"))
- Ω(report["foo"].AverageLabel).Should(Equal(" Average"))
- Ω(report["foo"].Units).Should(Equal("ms"))
- Ω(report["foo"].Results).Should(Equal([]float64{7, 2, 3}))
- Ω(report["foo"].Smallest).Should(BeNumerically("==", 2))
- Ω(report["foo"].Largest).Should(BeNumerically("==", 7))
- Ω(report["foo"].Average).Should(BeNumerically("==", 4))
- Ω(report["foo"].StdDeviation).Should(BeNumerically("~", 2.16, 0.01))
-
- Ω(report["bar"].Name).Should(Equal("bar"))
- Ω(report["bar"].Info).Should(BeNil())
- Ω(report["bar"].SmallestLabel).Should(Equal("Smallest"))
- Ω(report["bar"].Order).Should(Equal(1))
- Ω(report["bar"].LargestLabel).Should(Equal(" Largest"))
- Ω(report["bar"].AverageLabel).Should(Equal(" Average"))
- Ω(report["bar"].Units).Should(Equal("ns"))
- Ω(report["bar"].Results).Should(Equal([]float64{0.3, 0.1, 0.5, 0.7}))
- Ω(report["bar"].Smallest).Should(BeNumerically("==", 0.1))
- Ω(report["bar"].Largest).Should(BeNumerically("==", 0.7))
- Ω(report["bar"].Average).Should(BeNumerically("==", 0.4))
- Ω(report["bar"].StdDeviation).Should(BeNumerically("~", 0.22, 0.01))
- })
- })
-
- Describe("Time", func() {
- BeforeEach(func() {
- measure = NewMeasureNode("the measurement", func(b Benchmarker) {
- b.Time("foo", func() {
- time.Sleep(200 * time.Millisecond)
- }, "info!")
- b.Time("foo", func() {
- time.Sleep(300 * time.Millisecond)
- })
- b.Time("foo", func() {
- time.Sleep(250 * time.Millisecond)
- })
- }, types.FlagTypeFocused, codelocation.New(0), 1, Failer.New(), 3)
- Ω(measure.Run()).Should(Equal(types.SpecStatePassed))
- })
-
- It("records passed in values and reports on them", func() {
- report := measure.MeasurementsReport()
- Ω(report).Should(HaveLen(1))
- Ω(report["foo"].Name).Should(Equal("foo"))
- Ω(report["foo"].Info).Should(Equal("info!"))
- Ω(report["foo"].SmallestLabel).Should(Equal("Fastest Time"))
- Ω(report["foo"].LargestLabel).Should(Equal("Slowest Time"))
- Ω(report["foo"].AverageLabel).Should(Equal("Average Time"))
- Ω(report["foo"].Units).Should(Equal("s"))
- Ω(report["foo"].Results).Should(HaveLen(3))
- Ω(report["foo"].Results[0]).Should(BeNumerically("~", 0.2, 0.06))
- Ω(report["foo"].Results[1]).Should(BeNumerically("~", 0.3, 0.06))
- Ω(report["foo"].Results[2]).Should(BeNumerically("~", 0.25, 0.06))
- Ω(report["foo"].Smallest).Should(BeNumerically("~", 0.2, 0.06))
- Ω(report["foo"].Largest).Should(BeNumerically("~", 0.3, 0.06))
- Ω(report["foo"].Average).Should(BeNumerically("~", 0.25, 0.06))
- Ω(report["foo"].StdDeviation).Should(BeNumerically("~", 0.07, 0.04))
- })
- })
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/internal/leafnodes/setup_nodes_test.go b/vendor/github.com/onsi/ginkgo/internal/leafnodes/setup_nodes_test.go
deleted file mode 100644
index 9810688cb..000000000
--- a/vendor/github.com/onsi/ginkgo/internal/leafnodes/setup_nodes_test.go
+++ /dev/null
@@ -1,48 +0,0 @@
-package leafnodes_test
-
-import (
- . "github.com/onsi/ginkgo"
- "github.com/onsi/ginkgo/types"
- . "github.com/onsi/gomega"
-
- . "github.com/onsi/ginkgo/internal/leafnodes"
-
- "github.com/onsi/ginkgo/internal/codelocation"
-)
-
-var _ = Describe("Setup Nodes", func() {
- Describe("BeforeEachNodes", func() {
- It("should report the correct type and code location", func() {
- codeLocation := codelocation.New(0)
- beforeEach := NewBeforeEachNode(func() {}, codeLocation, 0, nil, 3)
- Ω(beforeEach.Type()).Should(Equal(types.SpecComponentTypeBeforeEach))
- Ω(beforeEach.CodeLocation()).Should(Equal(codeLocation))
- })
- })
-
- Describe("AfterEachNodes", func() {
- It("should report the correct type and code location", func() {
- codeLocation := codelocation.New(0)
- afterEach := NewAfterEachNode(func() {}, codeLocation, 0, nil, 3)
- Ω(afterEach.Type()).Should(Equal(types.SpecComponentTypeAfterEach))
- Ω(afterEach.CodeLocation()).Should(Equal(codeLocation))
- })
- })
-
- Describe("JustBeforeEachNodes", func() {
- It("should report the correct type and code location", func() {
- codeLocation := codelocation.New(0)
- justBeforeEach := NewJustBeforeEachNode(func() {}, codeLocation, 0, nil, 3)
- Ω(justBeforeEach.Type()).Should(Equal(types.SpecComponentTypeJustBeforeEach))
- Ω(justBeforeEach.CodeLocation()).Should(Equal(codeLocation))
- })
- })
- Describe("JustAfterEachNodes", func() {
- It("should report the correct type and code location", func() {
- codeLocation := codelocation.New(0)
- justAfterEach := NewJustAfterEachNode(func() {}, codeLocation, 0, nil, 3)
- Ω(justAfterEach.Type()).Should(Equal(types.SpecComponentTypeJustAfterEach))
- Ω(justAfterEach.CodeLocation()).Should(Equal(codeLocation))
- })
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/internal/leafnodes/shared_runner_test.go b/vendor/github.com/onsi/ginkgo/internal/leafnodes/shared_runner_test.go
deleted file mode 100644
index 0897836cb..000000000
--- a/vendor/github.com/onsi/ginkgo/internal/leafnodes/shared_runner_test.go
+++ /dev/null
@@ -1,353 +0,0 @@
-package leafnodes_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/ginkgo/internal/leafnodes"
- . "github.com/onsi/gomega"
-
- "reflect"
- "time"
-
- "github.com/onsi/ginkgo/internal/codelocation"
- Failer "github.com/onsi/ginkgo/internal/failer"
- "github.com/onsi/ginkgo/types"
-)
-
-type runnable interface {
- Run() (outcome types.SpecState, failure types.SpecFailure)
- CodeLocation() types.CodeLocation
-}
-
-func SynchronousSharedRunnerBehaviors(build func(body interface{}, timeout time.Duration, failer *Failer.Failer, componentCodeLocation types.CodeLocation) runnable, componentType types.SpecComponentType, componentIndex int) {
- var (
- outcome types.SpecState
- failure types.SpecFailure
-
- failer *Failer.Failer
-
- componentCodeLocation types.CodeLocation
- innerCodeLocation types.CodeLocation
-
- didRun bool
- )
-
- BeforeEach(func() {
- failer = Failer.New()
- componentCodeLocation = codelocation.New(0)
- innerCodeLocation = codelocation.New(0)
-
- didRun = false
- })
-
- Describe("synchronous functions", func() {
- Context("when the function passes", func() {
- BeforeEach(func() {
- outcome, failure = build(func() {
- didRun = true
- }, 0, failer, componentCodeLocation).Run()
- })
-
- It("should have a succesful outcome", func() {
- Ω(didRun).Should(BeTrue())
-
- Ω(outcome).Should(Equal(types.SpecStatePassed))
- Ω(failure).Should(BeZero())
- })
- })
-
- Context("when a failure occurs", func() {
- BeforeEach(func() {
- outcome, failure = build(func() {
- didRun = true
- failer.Fail("bam", innerCodeLocation)
- panic("should not matter")
- }, 0, failer, componentCodeLocation).Run()
- })
-
- It("should return the failure", func() {
- Ω(didRun).Should(BeTrue())
-
- Ω(outcome).Should(Equal(types.SpecStateFailed))
- Ω(failure).Should(Equal(types.SpecFailure{
- Message: "bam",
- Location: innerCodeLocation,
- ForwardedPanic: "",
- ComponentIndex: componentIndex,
- ComponentType: componentType,
- ComponentCodeLocation: componentCodeLocation,
- }))
- })
- })
-
- Context("when a panic occurs", func() {
- BeforeEach(func() {
- outcome, failure = build(func() {
- didRun = true
- innerCodeLocation = codelocation.New(0)
- panic("ack!")
- }, 0, failer, componentCodeLocation).Run()
- })
-
- It("should return the panic", func() {
- Ω(didRun).Should(BeTrue())
-
- Ω(outcome).Should(Equal(types.SpecStatePanicked))
- Ω(failure.ForwardedPanic).Should(Equal("ack!"))
- })
- })
-
- Context("when a panic occurs with a nil value", func() {
- BeforeEach(func() {
- outcome, failure = build(func() {
- didRun = true
- innerCodeLocation = codelocation.New(0)
- panic(nil)
- }, 0, failer, componentCodeLocation).Run()
- })
-
- It("should return the nil-valued panic", func() {
- Ω(didRun).Should(BeTrue())
-
- Ω(outcome).Should(Equal(types.SpecStatePanicked))
- Ω(failure.ForwardedPanic).Should(Equal("<nil>"))
- })
- })
-
- })
-}
-
-func AsynchronousSharedRunnerBehaviors(build func(body interface{}, timeout time.Duration, failer *Failer.Failer, componentCodeLocation types.CodeLocation) runnable, componentType types.SpecComponentType, componentIndex int) {
- var (
- outcome types.SpecState
- failure types.SpecFailure
-
- failer *Failer.Failer
-
- componentCodeLocation types.CodeLocation
- innerCodeLocation types.CodeLocation
-
- didRun bool
- )
-
- BeforeEach(func() {
- failer = Failer.New()
- componentCodeLocation = codelocation.New(0)
- innerCodeLocation = codelocation.New(0)
-
- didRun = false
- })
-
- Describe("asynchronous functions", func() {
- var timeoutDuration time.Duration
-
- BeforeEach(func() {
- timeoutDuration = time.Duration(1 * float64(time.Second))
- })
-
- Context("when running", func() {
- It("should run the function as a goroutine, and block until it's done", func() {
- proveAsync := make(chan bool)
-
- build(func(done Done) {
- didRun = true
- proveAsync <- true
- close(done)
- }, timeoutDuration, failer, componentCodeLocation).Run()
-
- Eventually(proveAsync).Should(Receive(Equal(true)))
- })
- })
-
- Context("when the function passes", func() {
- BeforeEach(func() {
- outcome, failure = build(func(done Done) {
- didRun = true
- close(done)
- }, timeoutDuration, failer, componentCodeLocation).Run()
- })
-
- It("should have a succesful outcome", func() {
- Ω(didRun).Should(BeTrue())
- Ω(outcome).Should(Equal(types.SpecStatePassed))
- Ω(failure).Should(BeZero())
- })
- })
-
- Context("when the function fails", func() {
- BeforeEach(func() {
- outcome, failure = build(func(done Done) {
- didRun = true
- failer.Fail("bam", innerCodeLocation)
- time.Sleep(20 * time.Millisecond)
- defer close(done)
- panic("doesn't matter")
- }, 10*time.Millisecond, failer, componentCodeLocation).Run()
- })
-
- It("should return the failure", func() {
- Ω(didRun).Should(BeTrue())
-
- Ω(outcome).Should(Equal(types.SpecStateFailed))
- Ω(failure).Should(Equal(types.SpecFailure{
- Message: "bam",
- Location: innerCodeLocation,
- ForwardedPanic: "",
- ComponentIndex: componentIndex,
- ComponentType: componentType,
- ComponentCodeLocation: componentCodeLocation,
- }))
- })
- })
-
- Context("when the function doesn't close the done channel in time", func() {
- var guard chan struct{}
-
- BeforeEach(func() {
- guard = make(chan struct{})
- outcome, failure = build(func(done Done) {
- didRun = true
- close(guard)
- }, 10*time.Millisecond, failer, componentCodeLocation).Run()
- })
-
- It("should return a timeout", func() {
- <-guard
- Ω(didRun).Should(BeTrue())
-
- Ω(outcome).Should(Equal(types.SpecStateTimedOut))
- Ω(failure).Should(Equal(types.SpecFailure{
- Message: "Timed out",
- Location: componentCodeLocation,
- ForwardedPanic: "",
- ComponentIndex: componentIndex,
- ComponentType: componentType,
- ComponentCodeLocation: componentCodeLocation,
- }))
- })
- })
-
- Context("when the function panics", func() {
- BeforeEach(func() {
- outcome, failure = build(func(done Done) {
- didRun = true
- innerCodeLocation = codelocation.New(0)
- panic("ack!")
- }, 100*time.Millisecond, failer, componentCodeLocation).Run()
- })
-
- It("should return the panic", func() {
- Ω(didRun).Should(BeTrue())
-
- Ω(outcome).Should(Equal(types.SpecStatePanicked))
- Ω(failure.ForwardedPanic).Should(Equal("ack!"))
- })
- })
-
- Context("when the function panics with a nil value", func() {
- BeforeEach(func() {
- outcome, failure = build(func(done Done) {
- didRun = true
- innerCodeLocation = codelocation.New(0)
- panic(nil)
- }, 100*time.Millisecond, failer, componentCodeLocation).Run()
- })
-
- It("should return the nil-valued panic", func() {
- Ω(didRun).Should(BeTrue())
-
- Ω(outcome).Should(Equal(types.SpecStatePanicked))
- Ω(failure.ForwardedPanic).Should(Equal("<nil>"))
- })
- })
- })
-}
-
-func InvalidSharedRunnerBehaviors(build func(body interface{}, timeout time.Duration, failer *Failer.Failer, componentCodeLocation types.CodeLocation) runnable, componentType types.SpecComponentType) {
- var (
- failer *Failer.Failer
- componentCodeLocation types.CodeLocation
- )
-
- BeforeEach(func() {
- failer = Failer.New()
- componentCodeLocation = codelocation.New(0)
- })
-
- Describe("invalid functions", func() {
- Context("when passed something that's not a function", func() {
- It("should panic", func() {
- Ω(func() {
- build("not a function", 0, failer, componentCodeLocation)
- }).Should(Panic())
- })
- })
-
- Context("when the function takes the wrong kind of argument", func() {
- It("should panic", func() {
- Ω(func() {
- build(func(oops string) {}, 0, failer, componentCodeLocation)
- }).Should(Panic())
- })
- })
-
- Context("when the function takes more than one argument", func() {
- It("should panic", func() {
- Ω(func() {
- build(func(done Done, oops string) {}, 0, failer, componentCodeLocation)
- }).Should(Panic())
- })
- })
- })
-}
-
-var _ = Describe("Shared RunnableNode behavior", func() {
- Describe("It Nodes", func() {
- build := func(body interface{}, timeout time.Duration, failer *Failer.Failer, componentCodeLocation types.CodeLocation) runnable {
- return NewItNode("", body, types.FlagTypeFocused, componentCodeLocation, timeout, failer, 3)
- }
-
- SynchronousSharedRunnerBehaviors(build, types.SpecComponentTypeIt, 3)
- AsynchronousSharedRunnerBehaviors(build, types.SpecComponentTypeIt, 3)
- InvalidSharedRunnerBehaviors(build, types.SpecComponentTypeIt)
- })
-
- Describe("Measure Nodes", func() {
- build := func(body interface{}, _ time.Duration, failer *Failer.Failer, componentCodeLocation types.CodeLocation) runnable {
- return NewMeasureNode("", func(Benchmarker) {
- reflect.ValueOf(body).Call([]reflect.Value{})
- }, types.FlagTypeFocused, componentCodeLocation, 10, failer, 3)
- }
-
- SynchronousSharedRunnerBehaviors(build, types.SpecComponentTypeMeasure, 3)
- })
-
- Describe("BeforeEach Nodes", func() {
- build := func(body interface{}, timeout time.Duration, failer *Failer.Failer, componentCodeLocation types.CodeLocation) runnable {
- return NewBeforeEachNode(body, componentCodeLocation, timeout, failer, 3)
- }
-
- SynchronousSharedRunnerBehaviors(build, types.SpecComponentTypeBeforeEach, 3)
- AsynchronousSharedRunnerBehaviors(build, types.SpecComponentTypeBeforeEach, 3)
- InvalidSharedRunnerBehaviors(build, types.SpecComponentTypeBeforeEach)
- })
-
- Describe("AfterEach Nodes", func() {
- build := func(body interface{}, timeout time.Duration, failer *Failer.Failer, componentCodeLocation types.CodeLocation) runnable {
- return NewAfterEachNode(body, componentCodeLocation, timeout, failer, 3)
- }
-
- SynchronousSharedRunnerBehaviors(build, types.SpecComponentTypeAfterEach, 3)
- AsynchronousSharedRunnerBehaviors(build, types.SpecComponentTypeAfterEach, 3)
- InvalidSharedRunnerBehaviors(build, types.SpecComponentTypeAfterEach)
- })
-
- Describe("JustBeforeEach Nodes", func() {
- build := func(body interface{}, timeout time.Duration, failer *Failer.Failer, componentCodeLocation types.CodeLocation) runnable {
- return NewJustBeforeEachNode(body, componentCodeLocation, timeout, failer, 3)
- }
-
- SynchronousSharedRunnerBehaviors(build, types.SpecComponentTypeJustBeforeEach, 3)
- AsynchronousSharedRunnerBehaviors(build, types.SpecComponentTypeJustBeforeEach, 3)
- InvalidSharedRunnerBehaviors(build, types.SpecComponentTypeJustBeforeEach)
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/internal/leafnodes/suite_nodes_test.go b/vendor/github.com/onsi/ginkgo/internal/leafnodes/suite_nodes_test.go
deleted file mode 100644
index 246b329fe..000000000
--- a/vendor/github.com/onsi/ginkgo/internal/leafnodes/suite_nodes_test.go
+++ /dev/null
@@ -1,230 +0,0 @@
-package leafnodes_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-
- . "github.com/onsi/ginkgo/internal/leafnodes"
-
- "time"
-
- "github.com/onsi/ginkgo/internal/codelocation"
- Failer "github.com/onsi/ginkgo/internal/failer"
- "github.com/onsi/ginkgo/types"
-)
-
-var _ = Describe("SuiteNodes", func() {
- Describe("BeforeSuite nodes", func() {
- var befSuite SuiteNode
- var failer *Failer.Failer
- var codeLocation types.CodeLocation
- var innerCodeLocation types.CodeLocation
- var outcome bool
-
- BeforeEach(func() {
- failer = Failer.New()
- codeLocation = codelocation.New(0)
- innerCodeLocation = codelocation.New(0)
- })
-
- Context("when the body passes", func() {
- BeforeEach(func() {
- befSuite = NewBeforeSuiteNode(func() {
- time.Sleep(10 * time.Millisecond)
- }, codeLocation, 0, failer)
- outcome = befSuite.Run(0, 0, "")
- })
-
- It("should return true when run and report as passed", func() {
- Ω(outcome).Should(BeTrue())
- Ω(befSuite.Passed()).Should(BeTrue())
- })
-
- It("should have the correct summary", func() {
- summary := befSuite.Summary()
- Ω(summary.ComponentType).Should(Equal(types.SpecComponentTypeBeforeSuite))
- Ω(summary.CodeLocation).Should(Equal(codeLocation))
- Ω(summary.State).Should(Equal(types.SpecStatePassed))
- Ω(summary.RunTime).Should(BeNumerically(">=", 10*time.Millisecond))
- Ω(summary.Failure).Should(BeZero())
- })
- })
-
- Context("when the body fails", func() {
- BeforeEach(func() {
- befSuite = NewBeforeSuiteNode(func() {
- failer.Fail("oops", innerCodeLocation)
- }, codeLocation, 0, failer)
- outcome = befSuite.Run(0, 0, "")
- })
-
- It("should return false when run and report as failed", func() {
- Ω(outcome).Should(BeFalse())
- Ω(befSuite.Passed()).Should(BeFalse())
- })
-
- It("should have the correct summary", func() {
- summary := befSuite.Summary()
- Ω(summary.State).Should(Equal(types.SpecStateFailed))
- Ω(summary.Failure.Message).Should(Equal("oops"))
- Ω(summary.Failure.Location).Should(Equal(innerCodeLocation))
- Ω(summary.Failure.ForwardedPanic).Should(BeEmpty())
- Ω(summary.Failure.ComponentIndex).Should(Equal(0))
- Ω(summary.Failure.ComponentType).Should(Equal(types.SpecComponentTypeBeforeSuite))
- Ω(summary.Failure.ComponentCodeLocation).Should(Equal(codeLocation))
- })
- })
-
- Context("when the body times out", func() {
- BeforeEach(func() {
- befSuite = NewBeforeSuiteNode(func(done Done) {
- }, codeLocation, time.Millisecond, failer)
- outcome = befSuite.Run(0, 0, "")
- })
-
- It("should return false when run and report as failed", func() {
- Ω(outcome).Should(BeFalse())
- Ω(befSuite.Passed()).Should(BeFalse())
- })
-
- It("should have the correct summary", func() {
- summary := befSuite.Summary()
- Ω(summary.State).Should(Equal(types.SpecStateTimedOut))
- Ω(summary.Failure.ForwardedPanic).Should(BeEmpty())
- Ω(summary.Failure.ComponentIndex).Should(Equal(0))
- Ω(summary.Failure.ComponentType).Should(Equal(types.SpecComponentTypeBeforeSuite))
- Ω(summary.Failure.ComponentCodeLocation).Should(Equal(codeLocation))
- })
- })
-
- Context("when the body panics", func() {
- BeforeEach(func() {
- befSuite = NewBeforeSuiteNode(func() {
- panic("bam")
- }, codeLocation, 0, failer)
- outcome = befSuite.Run(0, 0, "")
- })
-
- It("should return false when run and report as failed", func() {
- Ω(outcome).Should(BeFalse())
- Ω(befSuite.Passed()).Should(BeFalse())
- })
-
- It("should have the correct summary", func() {
- summary := befSuite.Summary()
- Ω(summary.State).Should(Equal(types.SpecStatePanicked))
- Ω(summary.Failure.ForwardedPanic).Should(Equal("bam"))
- Ω(summary.Failure.ComponentIndex).Should(Equal(0))
- Ω(summary.Failure.ComponentType).Should(Equal(types.SpecComponentTypeBeforeSuite))
- Ω(summary.Failure.ComponentCodeLocation).Should(Equal(codeLocation))
- })
- })
- })
-
- Describe("AfterSuite nodes", func() {
- var aftSuite SuiteNode
- var failer *Failer.Failer
- var codeLocation types.CodeLocation
- var innerCodeLocation types.CodeLocation
- var outcome bool
-
- BeforeEach(func() {
- failer = Failer.New()
- codeLocation = codelocation.New(0)
- innerCodeLocation = codelocation.New(0)
- })
-
- Context("when the body passes", func() {
- BeforeEach(func() {
- aftSuite = NewAfterSuiteNode(func() {
- time.Sleep(10 * time.Millisecond)
- }, codeLocation, 0, failer)
- outcome = aftSuite.Run(0, 0, "")
- })
-
- It("should return true when run and report as passed", func() {
- Ω(outcome).Should(BeTrue())
- Ω(aftSuite.Passed()).Should(BeTrue())
- })
-
- It("should have the correct summary", func() {
- summary := aftSuite.Summary()
- Ω(summary.ComponentType).Should(Equal(types.SpecComponentTypeAfterSuite))
- Ω(summary.CodeLocation).Should(Equal(codeLocation))
- Ω(summary.State).Should(Equal(types.SpecStatePassed))
- Ω(summary.RunTime).Should(BeNumerically(">=", 10*time.Millisecond))
- Ω(summary.Failure).Should(BeZero())
- })
- })
-
- Context("when the body fails", func() {
- BeforeEach(func() {
- aftSuite = NewAfterSuiteNode(func() {
- failer.Fail("oops", innerCodeLocation)
- }, codeLocation, 0, failer)
- outcome = aftSuite.Run(0, 0, "")
- })
-
- It("should return false when run and report as failed", func() {
- Ω(outcome).Should(BeFalse())
- Ω(aftSuite.Passed()).Should(BeFalse())
- })
-
- It("should have the correct summary", func() {
- summary := aftSuite.Summary()
- Ω(summary.State).Should(Equal(types.SpecStateFailed))
- Ω(summary.Failure.Message).Should(Equal("oops"))
- Ω(summary.Failure.Location).Should(Equal(innerCodeLocation))
- Ω(summary.Failure.ForwardedPanic).Should(BeEmpty())
- Ω(summary.Failure.ComponentIndex).Should(Equal(0))
- Ω(summary.Failure.ComponentType).Should(Equal(types.SpecComponentTypeAfterSuite))
- Ω(summary.Failure.ComponentCodeLocation).Should(Equal(codeLocation))
- })
- })
-
- Context("when the body times out", func() {
- BeforeEach(func() {
- aftSuite = NewAfterSuiteNode(func(done Done) {
- }, codeLocation, time.Millisecond, failer)
- outcome = aftSuite.Run(0, 0, "")
- })
-
- It("should return false when run and report as failed", func() {
- Ω(outcome).Should(BeFalse())
- Ω(aftSuite.Passed()).Should(BeFalse())
- })
-
- It("should have the correct summary", func() {
- summary := aftSuite.Summary()
- Ω(summary.State).Should(Equal(types.SpecStateTimedOut))
- Ω(summary.Failure.ForwardedPanic).Should(BeEmpty())
- Ω(summary.Failure.ComponentIndex).Should(Equal(0))
- Ω(summary.Failure.ComponentType).Should(Equal(types.SpecComponentTypeAfterSuite))
- Ω(summary.Failure.ComponentCodeLocation).Should(Equal(codeLocation))
- })
- })
-
- Context("when the body panics", func() {
- BeforeEach(func() {
- aftSuite = NewAfterSuiteNode(func() {
- panic("bam")
- }, codeLocation, 0, failer)
- outcome = aftSuite.Run(0, 0, "")
- })
-
- It("should return false when run and report as failed", func() {
- Ω(outcome).Should(BeFalse())
- Ω(aftSuite.Passed()).Should(BeFalse())
- })
-
- It("should have the correct summary", func() {
- summary := aftSuite.Summary()
- Ω(summary.State).Should(Equal(types.SpecStatePanicked))
- Ω(summary.Failure.ForwardedPanic).Should(Equal("bam"))
- Ω(summary.Failure.ComponentIndex).Should(Equal(0))
- Ω(summary.Failure.ComponentType).Should(Equal(types.SpecComponentTypeAfterSuite))
- Ω(summary.Failure.ComponentCodeLocation).Should(Equal(codeLocation))
- })
- })
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/internal/leafnodes/synchronized_after_suite_node_test.go b/vendor/github.com/onsi/ginkgo/internal/leafnodes/synchronized_after_suite_node_test.go
deleted file mode 100644
index edbdf6ae5..000000000
--- a/vendor/github.com/onsi/ginkgo/internal/leafnodes/synchronized_after_suite_node_test.go
+++ /dev/null
@@ -1,199 +0,0 @@
-package leafnodes_test
-
-import (
- "sync"
-
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/ginkgo/internal/leafnodes"
- "github.com/onsi/ginkgo/types"
- . "github.com/onsi/gomega"
-
- "net/http"
-
- "github.com/onsi/gomega/ghttp"
-
- "time"
-
- "github.com/onsi/ginkgo/internal/codelocation"
- Failer "github.com/onsi/ginkgo/internal/failer"
-)
-
-var _ = Describe("SynchronizedAfterSuiteNode", func() {
- var failer *Failer.Failer
- var node SuiteNode
- var codeLocation types.CodeLocation
- var innerCodeLocation types.CodeLocation
- var outcome bool
- var server *ghttp.Server
- var things []string
- var lock *sync.Mutex
-
- BeforeEach(func() {
- things = []string{}
- server = ghttp.NewServer()
- codeLocation = codelocation.New(0)
- innerCodeLocation = codelocation.New(0)
- failer = Failer.New()
- lock = &sync.Mutex{}
- })
-
- AfterEach(func() {
- server.Close()
- })
-
- newNode := func(bodyA interface{}, bodyB interface{}) SuiteNode {
- return NewSynchronizedAfterSuiteNode(bodyA, bodyB, codeLocation, time.Millisecond, failer)
- }
-
- ranThing := func(thing string) {
- lock.Lock()
- defer lock.Unlock()
- things = append(things, thing)
- }
-
- thingsThatRan := func() []string {
- lock.Lock()
- defer lock.Unlock()
- return things
- }
-
- Context("when not running in parallel", func() {
- Context("when all is well", func() {
- BeforeEach(func() {
- node = newNode(func() {
- ranThing("A")
- }, func() {
- ranThing("B")
- })
-
- outcome = node.Run(1, 1, server.URL())
- })
-
- It("should run A, then B", func() {
- Ω(thingsThatRan()).Should(Equal([]string{"A", "B"}))
- })
-
- It("should report success", func() {
- Ω(outcome).Should(BeTrue())
- Ω(node.Passed()).Should(BeTrue())
- Ω(node.Summary().State).Should(Equal(types.SpecStatePassed))
- })
- })
-
- Context("when A fails", func() {
- BeforeEach(func() {
- node = newNode(func() {
- ranThing("A")
- failer.Fail("bam", innerCodeLocation)
- }, func() {
- ranThing("B")
- })
-
- outcome = node.Run(1, 1, server.URL())
- })
-
- It("should still run B", func() {
- Ω(thingsThatRan()).Should(Equal([]string{"A", "B"}))
- })
-
- It("should report failure", func() {
- Ω(outcome).Should(BeFalse())
- Ω(node.Passed()).Should(BeFalse())
- Ω(node.Summary().State).Should(Equal(types.SpecStateFailed))
- })
- })
-
- Context("when B fails", func() {
- BeforeEach(func() {
- node = newNode(func() {
- ranThing("A")
- }, func() {
- ranThing("B")
- failer.Fail("bam", innerCodeLocation)
- })
-
- outcome = node.Run(1, 1, server.URL())
- })
-
- It("should run all the things", func() {
- Ω(thingsThatRan()).Should(Equal([]string{"A", "B"}))
- })
-
- It("should report failure", func() {
- Ω(outcome).Should(BeFalse())
- Ω(node.Passed()).Should(BeFalse())
- Ω(node.Summary().State).Should(Equal(types.SpecStateFailed))
- })
- })
- })
-
- Context("when running in parallel", func() {
- Context("as the first node", func() {
- BeforeEach(func() {
- server.AppendHandlers(ghttp.CombineHandlers(
- ghttp.VerifyRequest("GET", "/RemoteAfterSuiteData"),
- func(writer http.ResponseWriter, request *http.Request) {
- ranThing("Request1")
- },
- ghttp.RespondWithJSONEncoded(200, types.RemoteAfterSuiteData{CanRun: false}),
- ), ghttp.CombineHandlers(
- ghttp.VerifyRequest("GET", "/RemoteAfterSuiteData"),
- func(writer http.ResponseWriter, request *http.Request) {
- ranThing("Request2")
- },
- ghttp.RespondWithJSONEncoded(200, types.RemoteAfterSuiteData{CanRun: false}),
- ), ghttp.CombineHandlers(
- ghttp.VerifyRequest("GET", "/RemoteAfterSuiteData"),
- func(writer http.ResponseWriter, request *http.Request) {
- ranThing("Request3")
- },
- ghttp.RespondWithJSONEncoded(200, types.RemoteAfterSuiteData{CanRun: true}),
- ))
-
- node = newNode(func() {
- ranThing("A")
- }, func() {
- ranThing("B")
- })
-
- outcome = node.Run(1, 3, server.URL())
- })
-
- It("should run A and, when the server says its time, run B", func() {
- Ω(thingsThatRan()).Should(Equal([]string{"A", "Request1", "Request2", "Request3", "B"}))
- })
-
- It("should report success", func() {
- Ω(outcome).Should(BeTrue())
- Ω(node.Passed()).Should(BeTrue())
- Ω(node.Summary().State).Should(Equal(types.SpecStatePassed))
- })
- })
-
- Context("as any other node", func() {
- BeforeEach(func() {
- node = newNode(func() {
- ranThing("A")
- }, func() {
- ranThing("B")
- })
-
- outcome = node.Run(2, 3, server.URL())
- })
-
- It("should run A, and not run B", func() {
- Ω(thingsThatRan()).Should(Equal([]string{"A"}))
- })
-
- It("should not talk to the server", func() {
- Ω(server.ReceivedRequests()).Should(BeEmpty())
- })
-
- It("should report success", func() {
- Ω(outcome).Should(BeTrue())
- Ω(node.Passed()).Should(BeTrue())
- Ω(node.Summary().State).Should(Equal(types.SpecStatePassed))
- })
- })
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/internal/leafnodes/synchronized_before_suite_node_test.go b/vendor/github.com/onsi/ginkgo/internal/leafnodes/synchronized_before_suite_node_test.go
deleted file mode 100644
index 46c3e276b..000000000
--- a/vendor/github.com/onsi/ginkgo/internal/leafnodes/synchronized_before_suite_node_test.go
+++ /dev/null
@@ -1,446 +0,0 @@
-package leafnodes_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/ginkgo/internal/leafnodes"
- . "github.com/onsi/gomega"
-
- "net/http"
-
- "github.com/onsi/gomega/ghttp"
-
- "time"
-
- "github.com/onsi/ginkgo/internal/codelocation"
- Failer "github.com/onsi/ginkgo/internal/failer"
- "github.com/onsi/ginkgo/types"
-)
-
-var _ = Describe("SynchronizedBeforeSuiteNode", func() {
- var failer *Failer.Failer
- var node SuiteNode
- var codeLocation types.CodeLocation
- var innerCodeLocation types.CodeLocation
- var outcome bool
- var server *ghttp.Server
-
- BeforeEach(func() {
- server = ghttp.NewServer()
- codeLocation = codelocation.New(0)
- innerCodeLocation = codelocation.New(0)
- failer = Failer.New()
- })
-
- AfterEach(func() {
- server.Close()
- })
-
- newNode := func(bodyA interface{}, bodyB interface{}) SuiteNode {
- return NewSynchronizedBeforeSuiteNode(bodyA, bodyB, codeLocation, time.Millisecond, failer)
- }
-
- Describe("when not running in parallel", func() {
- Context("when all is well", func() {
- var data []byte
- BeforeEach(func() {
- data = nil
-
- node = newNode(func() []byte {
- return []byte("my data")
- }, func(d []byte) {
- data = d
- })
-
- outcome = node.Run(1, 1, server.URL())
- })
-
- It("should run A, then B passing the output from A to B", func() {
- Ω(data).Should(Equal([]byte("my data")))
- })
-
- It("should report success", func() {
- Ω(outcome).Should(BeTrue())
- Ω(node.Passed()).Should(BeTrue())
- Ω(node.Summary().State).Should(Equal(types.SpecStatePassed))
- })
- })
-
- Context("when A fails", func() {
- var ranB bool
- BeforeEach(func() {
- ranB = false
- node = newNode(func() []byte {
- failer.Fail("boom", innerCodeLocation)
- return nil
- }, func([]byte) {
- ranB = true
- })
-
- outcome = node.Run(1, 1, server.URL())
- })
-
- It("should not run B", func() {
- Ω(ranB).Should(BeFalse())
- })
-
- It("should report failure", func() {
- Ω(outcome).Should(BeFalse())
- Ω(node.Passed()).Should(BeFalse())
- Ω(node.Summary().State).Should(Equal(types.SpecStateFailed))
- })
- })
-
- Context("when B fails", func() {
- BeforeEach(func() {
- node = newNode(func() []byte {
- return nil
- }, func([]byte) {
- failer.Fail("boom", innerCodeLocation)
- })
-
- outcome = node.Run(1, 1, server.URL())
- })
-
- It("should report failure", func() {
- Ω(outcome).Should(BeFalse())
- Ω(node.Passed()).Should(BeFalse())
- Ω(node.Summary().State).Should(Equal(types.SpecStateFailed))
- })
- })
-
- Context("when A times out", func() {
- var ranB bool
- BeforeEach(func() {
- ranB = false
- node = newNode(func(Done) []byte {
- time.Sleep(time.Second)
- return nil
- }, func([]byte) {
- ranB = true
- })
-
- outcome = node.Run(1, 1, server.URL())
- })
-
- It("should not run B", func() {
- Ω(ranB).Should(BeFalse())
- })
-
- It("should report failure", func() {
- Ω(outcome).Should(BeFalse())
- Ω(node.Passed()).Should(BeFalse())
- Ω(node.Summary().State).Should(Equal(types.SpecStateTimedOut))
- })
- })
-
- Context("when B times out", func() {
- BeforeEach(func() {
- node = newNode(func() []byte {
- return nil
- }, func([]byte, Done) {
- time.Sleep(time.Second)
- })
-
- outcome = node.Run(1, 1, server.URL())
- })
-
- It("should report failure", func() {
- Ω(outcome).Should(BeFalse())
- Ω(node.Passed()).Should(BeFalse())
- Ω(node.Summary().State).Should(Equal(types.SpecStateTimedOut))
- })
- })
- })
-
- Describe("when running in parallel", func() {
- var ranB bool
- var parallelNode, parallelTotal int
- BeforeEach(func() {
- ranB = false
- parallelNode, parallelTotal = 1, 3
- })
-
- Context("as the first node, it runs A", func() {
- var expectedState types.RemoteBeforeSuiteData
-
- BeforeEach(func() {
- parallelNode, parallelTotal = 1, 3
- })
-
- JustBeforeEach(func() {
- server.AppendHandlers(ghttp.CombineHandlers(
- ghttp.VerifyRequest("POST", "/BeforeSuiteState"),
- ghttp.VerifyJSONRepresenting(expectedState),
- ))
-
- outcome = node.Run(parallelNode, parallelTotal, server.URL())
- })
-
- Context("when A succeeds", func() {
- BeforeEach(func() {
- expectedState = types.RemoteBeforeSuiteData{Data: []byte("my data"), State: types.RemoteBeforeSuiteStatePassed}
-
- node = newNode(func() []byte {
- return []byte("my data")
- }, func([]byte) {
- ranB = true
- })
- })
-
- It("should post about A succeeding", func() {
- Ω(server.ReceivedRequests()).Should(HaveLen(1))
- })
-
- It("should run B", func() {
- Ω(ranB).Should(BeTrue())
- })
-
- It("should report success", func() {
- Ω(outcome).Should(BeTrue())
- })
- })
-
- Context("when A fails", func() {
- BeforeEach(func() {
- expectedState = types.RemoteBeforeSuiteData{Data: nil, State: types.RemoteBeforeSuiteStateFailed}
-
- node = newNode(func() []byte {
- panic("BAM")
- }, func([]byte) {
- ranB = true
- })
- })
-
- It("should post about A failing", func() {
- Ω(server.ReceivedRequests()).Should(HaveLen(1))
- })
-
- It("should not run B", func() {
- Ω(ranB).Should(BeFalse())
- })
-
- It("should report failure", func() {
- Ω(outcome).Should(BeFalse())
- })
- })
- })
-
- Context("as the Nth node", func() {
- var statusCode int
- var response interface{}
- var ranA bool
- var bData []byte
-
- BeforeEach(func() {
- ranA = false
- bData = nil
-
- statusCode = http.StatusOK
-
- server.AppendHandlers(ghttp.CombineHandlers(
- ghttp.VerifyRequest("GET", "/BeforeSuiteState"),
- ghttp.RespondWith(http.StatusOK, string((types.RemoteBeforeSuiteData{Data: nil, State: types.RemoteBeforeSuiteStatePending}).ToJSON())),
- ), ghttp.CombineHandlers(
- ghttp.VerifyRequest("GET", "/BeforeSuiteState"),
- ghttp.RespondWith(http.StatusOK, string((types.RemoteBeforeSuiteData{Data: nil, State: types.RemoteBeforeSuiteStatePending}).ToJSON())),
- ), ghttp.CombineHandlers(
- ghttp.VerifyRequest("GET", "/BeforeSuiteState"),
- ghttp.RespondWithJSONEncodedPtr(&statusCode, &response),
- ))
-
- node = newNode(func() []byte {
- ranA = true
- return nil
- }, func(data []byte) {
- bData = data
- })
-
- parallelNode, parallelTotal = 2, 3
- })
-
- Context("when A on node1 succeeds", func() {
- BeforeEach(func() {
- response = types.RemoteBeforeSuiteData{Data: []byte("my data"), State: types.RemoteBeforeSuiteStatePassed}
- outcome = node.Run(parallelNode, parallelTotal, server.URL())
- })
-
- It("should not run A", func() {
- Ω(ranA).Should(BeFalse())
- })
-
- It("should poll for A", func() {
- Ω(server.ReceivedRequests()).Should(HaveLen(3))
- })
-
- It("should run B when the polling succeeds", func() {
- Ω(bData).Should(Equal([]byte("my data")))
- })
-
- It("should succeed", func() {
- Ω(outcome).Should(BeTrue())
- Ω(node.Passed()).Should(BeTrue())
- })
- })
-
- Context("when A on node1 fails", func() {
- BeforeEach(func() {
- response = types.RemoteBeforeSuiteData{Data: []byte("my data"), State: types.RemoteBeforeSuiteStateFailed}
- outcome = node.Run(parallelNode, parallelTotal, server.URL())
- })
-
- It("should not run A", func() {
- Ω(ranA).Should(BeFalse())
- })
-
- It("should poll for A", func() {
- Ω(server.ReceivedRequests()).Should(HaveLen(3))
- })
-
- It("should not run B", func() {
- Ω(bData).Should(BeNil())
- })
-
- It("should fail", func() {
- Ω(outcome).Should(BeFalse())
- Ω(node.Passed()).Should(BeFalse())
-
- summary := node.Summary()
- Ω(summary.State).Should(Equal(types.SpecStateFailed))
- Ω(summary.Failure.Message).Should(Equal("BeforeSuite on Node 1 failed"))
- Ω(summary.Failure.Location).Should(Equal(codeLocation))
- Ω(summary.Failure.ComponentType).Should(Equal(types.SpecComponentTypeBeforeSuite))
- Ω(summary.Failure.ComponentIndex).Should(Equal(0))
- Ω(summary.Failure.ComponentCodeLocation).Should(Equal(codeLocation))
- })
- })
-
- Context("when node1 disappears", func() {
- BeforeEach(func() {
- response = types.RemoteBeforeSuiteData{Data: []byte("my data"), State: types.RemoteBeforeSuiteStateDisappeared}
- outcome = node.Run(parallelNode, parallelTotal, server.URL())
- })
-
- It("should not run A", func() {
- Ω(ranA).Should(BeFalse())
- })
-
- It("should poll for A", func() {
- Ω(server.ReceivedRequests()).Should(HaveLen(3))
- })
-
- It("should not run B", func() {
- Ω(bData).Should(BeNil())
- })
-
- It("should fail", func() {
- Ω(outcome).Should(BeFalse())
- Ω(node.Passed()).Should(BeFalse())
-
- summary := node.Summary()
- Ω(summary.State).Should(Equal(types.SpecStateFailed))
- Ω(summary.Failure.Message).Should(Equal("Node 1 disappeared before completing BeforeSuite"))
- Ω(summary.Failure.Location).Should(Equal(codeLocation))
- Ω(summary.Failure.ComponentType).Should(Equal(types.SpecComponentTypeBeforeSuite))
- Ω(summary.Failure.ComponentIndex).Should(Equal(0))
- Ω(summary.Failure.ComponentCodeLocation).Should(Equal(codeLocation))
- })
- })
- })
- })
-
- Describe("construction", func() {
- Describe("the first function", func() {
- Context("when the first function returns a byte array", func() {
- Context("and takes nothing", func() {
- It("should be fine", func() {
- Ω(func() {
- newNode(func() []byte { return nil }, func([]byte) {})
- }).ShouldNot(Panic())
- })
- })
-
- Context("and takes a done function", func() {
- It("should be fine", func() {
- Ω(func() {
- newNode(func(Done) []byte { return nil }, func([]byte) {})
- }).ShouldNot(Panic())
- })
- })
-
- Context("and takes more than one thing", func() {
- It("should panic", func() {
- Ω(func() {
- newNode(func(Done, Done) []byte { return nil }, func([]byte) {})
- }).Should(Panic())
- })
- })
-
- Context("and takes something else", func() {
- It("should panic", func() {
- Ω(func() {
- newNode(func(bool) []byte { return nil }, func([]byte) {})
- }).Should(Panic())
- })
- })
- })
-
- Context("when the first function does not return a byte array", func() {
- It("should panic", func() {
- Ω(func() {
- newNode(func() {}, func([]byte) {})
- }).Should(Panic())
-
- Ω(func() {
- newNode(func() []int { return nil }, func([]byte) {})
- }).Should(Panic())
- })
- })
- })
-
- Describe("the second function", func() {
- Context("when the second function takes a byte array", func() {
- It("should be fine", func() {
- Ω(func() {
- newNode(func() []byte { return nil }, func([]byte) {})
- }).ShouldNot(Panic())
- })
- })
-
- Context("when it also takes a done channel", func() {
- It("should be fine", func() {
- Ω(func() {
- newNode(func() []byte { return nil }, func([]byte, Done) {})
- }).ShouldNot(Panic())
- })
- })
-
- Context("if it takes anything else", func() {
- It("should panic", func() {
- Ω(func() {
- newNode(func() []byte { return nil }, func([]byte, chan bool) {})
- }).Should(Panic())
-
- Ω(func() {
- newNode(func() []byte { return nil }, func(string) {})
- }).Should(Panic())
- })
- })
-
- Context("if it takes nothing at all", func() {
- It("should panic", func() {
- Ω(func() {
- newNode(func() []byte { return nil }, func() {})
- }).Should(Panic())
- })
- })
-
- Context("if it returns something", func() {
- It("should panic", func() {
- Ω(func() {
- newNode(func() []byte { return nil }, func([]byte) []byte { return nil })
- }).Should(Panic())
- })
- })
- })
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/internal/remote/aggregator_test.go b/vendor/github.com/onsi/ginkgo/internal/remote/aggregator_test.go
deleted file mode 100644
index aedf93927..000000000
--- a/vendor/github.com/onsi/ginkgo/internal/remote/aggregator_test.go
+++ /dev/null
@@ -1,315 +0,0 @@
-package remote_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-
- "time"
-
- "github.com/onsi/ginkgo/config"
- . "github.com/onsi/ginkgo/internal/remote"
- st "github.com/onsi/ginkgo/reporters/stenographer"
- "github.com/onsi/ginkgo/types"
-)
-
-var _ = Describe("Aggregator", func() {
- var (
- aggregator *Aggregator
- reporterConfig config.DefaultReporterConfigType
- stenographer *st.FakeStenographer
- result chan bool
-
- ginkgoConfig1 config.GinkgoConfigType
- ginkgoConfig2 config.GinkgoConfigType
-
- suiteSummary1 *types.SuiteSummary
- suiteSummary2 *types.SuiteSummary
-
- beforeSummary *types.SetupSummary
- afterSummary *types.SetupSummary
- specSummary *types.SpecSummary
-
- suiteDescription string
- )
-
- BeforeEach(func() {
- reporterConfig = config.DefaultReporterConfigType{
- NoColor: false,
- SlowSpecThreshold: 0.1,
- NoisyPendings: true,
- Succinct: false,
- Verbose: true,
- }
- stenographer = st.NewFakeStenographer()
- result = make(chan bool, 1)
- aggregator = NewAggregator(2, result, reporterConfig, stenographer)
-
- //
- // now set up some fixture data
- //
-
- ginkgoConfig1 = config.GinkgoConfigType{
- RandomSeed: 1138,
- RandomizeAllSpecs: true,
- ParallelNode: 1,
- ParallelTotal: 2,
- }
-
- ginkgoConfig2 = config.GinkgoConfigType{
- RandomSeed: 1138,
- RandomizeAllSpecs: true,
- ParallelNode: 2,
- ParallelTotal: 2,
- }
-
- suiteDescription = "My Parallel Suite"
-
- suiteSummary1 = &types.SuiteSummary{
- SuiteDescription: suiteDescription,
-
- NumberOfSpecsBeforeParallelization: 30,
- NumberOfTotalSpecs: 17,
- NumberOfSpecsThatWillBeRun: 15,
- NumberOfPendingSpecs: 1,
- NumberOfSkippedSpecs: 1,
- }
-
- suiteSummary2 = &types.SuiteSummary{
- SuiteDescription: suiteDescription,
-
- NumberOfSpecsBeforeParallelization: 30,
- NumberOfTotalSpecs: 13,
- NumberOfSpecsThatWillBeRun: 8,
- NumberOfPendingSpecs: 2,
- NumberOfSkippedSpecs: 3,
- }
-
- beforeSummary = &types.SetupSummary{
- State: types.SpecStatePassed,
- CapturedOutput: "BeforeSuiteOutput",
- }
-
- afterSummary = &types.SetupSummary{
- State: types.SpecStatePassed,
- CapturedOutput: "AfterSuiteOutput",
- }
-
- specSummary = &types.SpecSummary{
- State: types.SpecStatePassed,
- CapturedOutput: "SpecOutput",
- }
- })
-
- call := func(method string, args ...interface{}) st.FakeStenographerCall {
- return st.NewFakeStenographerCall(method, args...)
- }
-
- beginSuite := func() {
- stenographer.Reset()
- aggregator.SpecSuiteWillBegin(ginkgoConfig2, suiteSummary2)
- aggregator.SpecSuiteWillBegin(ginkgoConfig1, suiteSummary1)
- Eventually(func() interface{} {
- return len(stenographer.Calls())
- }).Should(BeNumerically(">=", 3))
- }
-
- Describe("Announcing the beginning of the suite", func() {
- Context("When one of the parallel-suites starts", func() {
- BeforeEach(func() {
- aggregator.SpecSuiteWillBegin(ginkgoConfig2, suiteSummary2)
- })
-
- It("should be silent", func() {
- Consistently(func() interface{} { return stenographer.Calls() }).Should(BeEmpty())
- })
- })
-
- Context("once all of the parallel-suites have started", func() {
- BeforeEach(func() {
- aggregator.SpecSuiteWillBegin(ginkgoConfig2, suiteSummary2)
- aggregator.SpecSuiteWillBegin(ginkgoConfig1, suiteSummary1)
- Eventually(func() interface{} {
- return stenographer.Calls()
- }).Should(HaveLen(3))
- })
-
- It("should announce the beginning of the suite", func() {
- Ω(stenographer.Calls()).Should(HaveLen(3))
- Ω(stenographer.Calls()[0]).Should(Equal(call("AnnounceSuite", suiteDescription, ginkgoConfig1.RandomSeed, true, false)))
- Ω(stenographer.Calls()[1]).Should(Equal(call("AnnounceTotalNumberOfSpecs", 30, false)))
- Ω(stenographer.Calls()[2]).Should(Equal(call("AnnounceAggregatedParallelRun", 2, false)))
- })
- })
- })
-
- Describe("Announcing specs and before suites", func() {
- Context("when the parallel-suites have not all started", func() {
- BeforeEach(func() {
- aggregator.BeforeSuiteDidRun(beforeSummary)
- aggregator.AfterSuiteDidRun(afterSummary)
- aggregator.SpecDidComplete(specSummary)
- })
-
- It("should not announce any specs", func() {
- Consistently(func() interface{} { return stenographer.Calls() }).Should(BeEmpty())
- })
-
- Context("when the parallel-suites subsequently start", func() {
- BeforeEach(func() {
- beginSuite()
- })
-
- It("should announce the specs, the before suites and the after suites", func() {
- Eventually(func() interface{} {
- return stenographer.Calls()
- }).Should(ContainElement(call("AnnounceSuccesfulSpec", specSummary)))
-
- Ω(stenographer.Calls()).Should(ContainElement(call("AnnounceCapturedOutput", beforeSummary.CapturedOutput)))
- Ω(stenographer.Calls()).Should(ContainElement(call("AnnounceCapturedOutput", afterSummary.CapturedOutput)))
- })
- })
- })
-
- Context("When the parallel-suites have all started", func() {
- BeforeEach(func() {
- beginSuite()
- stenographer.Reset()
- })
-
- Context("When a spec completes", func() {
- BeforeEach(func() {
- aggregator.BeforeSuiteDidRun(beforeSummary)
- aggregator.SpecDidComplete(specSummary)
- aggregator.AfterSuiteDidRun(afterSummary)
- Eventually(func() interface{} {
- return stenographer.Calls()
- }).Should(HaveLen(5))
- })
-
- It("should announce the captured output of the BeforeSuite", func() {
- Ω(stenographer.Calls()[0]).Should(Equal(call("AnnounceCapturedOutput", beforeSummary.CapturedOutput)))
- })
-
- It("should announce that the spec will run (when in verbose mode)", func() {
- Ω(stenographer.Calls()[1]).Should(Equal(call("AnnounceSpecWillRun", specSummary)))
- })
-
- It("should announce the captured stdout of the spec", func() {
- Ω(stenographer.Calls()[2]).Should(Equal(call("AnnounceCapturedOutput", specSummary.CapturedOutput)))
- })
-
- It("should announce completion", func() {
- Ω(stenographer.Calls()[3]).Should(Equal(call("AnnounceSuccesfulSpec", specSummary)))
- })
-
- It("should announce the captured output of the AfterSuite", func() {
- Ω(stenographer.Calls()[4]).Should(Equal(call("AnnounceCapturedOutput", afterSummary.CapturedOutput)))
- })
- })
- })
- })
-
- Describe("Announcing the end of the suite", func() {
- BeforeEach(func() {
- beginSuite()
- stenographer.Reset()
- })
-
- Context("When one of the parallel-suites ends", func() {
- BeforeEach(func() {
- aggregator.SpecSuiteDidEnd(suiteSummary2)
- })
-
- It("should be silent", func() {
- Consistently(func() interface{} { return stenographer.Calls() }).Should(BeEmpty())
- })
-
- It("should not notify the channel", func() {
- Ω(result).Should(BeEmpty())
- })
- })
-
- Context("once all of the parallel-suites end", func() {
- BeforeEach(func() {
- time.Sleep(200 * time.Millisecond)
-
- suiteSummary1.SuiteSucceeded = true
- suiteSummary1.NumberOfPassedSpecs = 15
- suiteSummary1.NumberOfFailedSpecs = 0
- suiteSummary1.NumberOfFlakedSpecs = 3
- suiteSummary2.SuiteSucceeded = false
- suiteSummary2.NumberOfPassedSpecs = 5
- suiteSummary2.NumberOfFailedSpecs = 3
- suiteSummary2.NumberOfFlakedSpecs = 4
-
- aggregator.SpecSuiteDidEnd(suiteSummary2)
- aggregator.SpecSuiteDidEnd(suiteSummary1)
- Eventually(func() interface{} {
- return stenographer.Calls()
- }).Should(HaveLen(2))
- })
-
- It("should announce the end of the suite", func() {
- compositeSummary := stenographer.Calls()[1].Args[0].(*types.SuiteSummary)
-
- Ω(compositeSummary.SuiteSucceeded).Should(BeFalse())
- Ω(compositeSummary.NumberOfSpecsThatWillBeRun).Should(Equal(23))
- Ω(compositeSummary.NumberOfTotalSpecs).Should(Equal(30))
- Ω(compositeSummary.NumberOfPassedSpecs).Should(Equal(20))
- Ω(compositeSummary.NumberOfFailedSpecs).Should(Equal(3))
- Ω(compositeSummary.NumberOfPendingSpecs).Should(Equal(3))
- Ω(compositeSummary.NumberOfSkippedSpecs).Should(Equal(4))
- Ω(compositeSummary.NumberOfFlakedSpecs).Should(Equal(7))
- Ω(compositeSummary.RunTime.Seconds()).Should(BeNumerically(">", 0.2))
- })
- })
-
- Context("when all the parallel-suites pass", func() {
- BeforeEach(func() {
- suiteSummary1.SuiteSucceeded = true
- suiteSummary2.SuiteSucceeded = true
-
- aggregator.SpecSuiteDidEnd(suiteSummary2)
- aggregator.SpecSuiteDidEnd(suiteSummary1)
- Eventually(func() interface{} {
- return stenographer.Calls()
- }).Should(HaveLen(2))
- })
-
- It("should report success", func() {
- compositeSummary := stenographer.Calls()[1].Args[0].(*types.SuiteSummary)
-
- Ω(compositeSummary.SuiteSucceeded).Should(BeTrue())
- })
-
- It("should notify the channel that it succeded", func(done Done) {
- Ω(<-result).Should(BeTrue())
- close(done)
- })
- })
-
- Context("when one of the parallel-suites fails", func() {
- BeforeEach(func() {
- suiteSummary1.SuiteSucceeded = true
- suiteSummary2.SuiteSucceeded = false
-
- aggregator.SpecSuiteDidEnd(suiteSummary2)
- aggregator.SpecSuiteDidEnd(suiteSummary1)
- Eventually(func() interface{} {
- return stenographer.Calls()
- }).Should(HaveLen(2))
- })
-
- It("should report failure", func() {
- compositeSummary := stenographer.Calls()[1].Args[0].(*types.SuiteSummary)
-
- Ω(compositeSummary.SuiteSucceeded).Should(BeFalse())
- })
-
- It("should notify the channel that it failed", func(done Done) {
- Ω(<-result).Should(BeFalse())
- close(done)
- })
- })
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/internal/remote/fake_output_interceptor_test.go b/vendor/github.com/onsi/ginkgo/internal/remote/fake_output_interceptor_test.go
deleted file mode 100644
index ef54862ea..000000000
--- a/vendor/github.com/onsi/ginkgo/internal/remote/fake_output_interceptor_test.go
+++ /dev/null
@@ -1,22 +0,0 @@
-package remote_test
-
-import "os"
-
-type fakeOutputInterceptor struct {
- DidStartInterceptingOutput bool
- DidStopInterceptingOutput bool
- InterceptedOutput string
-}
-
-func (interceptor *fakeOutputInterceptor) StartInterceptingOutput() error {
- interceptor.DidStartInterceptingOutput = true
- return nil
-}
-
-func (interceptor *fakeOutputInterceptor) StopInterceptingAndReturnOutput() (string, error) {
- interceptor.DidStopInterceptingOutput = true
- return interceptor.InterceptedOutput, nil
-}
-
-func (interceptor *fakeOutputInterceptor) StreamTo(*os.File) {
-}
diff --git a/vendor/github.com/onsi/ginkgo/internal/remote/fake_poster_test.go b/vendor/github.com/onsi/ginkgo/internal/remote/fake_poster_test.go
deleted file mode 100644
index 3543c59c6..000000000
--- a/vendor/github.com/onsi/ginkgo/internal/remote/fake_poster_test.go
+++ /dev/null
@@ -1,33 +0,0 @@
-package remote_test
-
-import (
- "io"
- "io/ioutil"
- "net/http"
-)
-
-type post struct {
- url string
- bodyType string
- bodyContent []byte
-}
-
-type fakePoster struct {
- posts []post
-}
-
-func newFakePoster() *fakePoster {
- return &fakePoster{
- posts: make([]post, 0),
- }
-}
-
-func (poster *fakePoster) Post(url string, bodyType string, body io.Reader) (resp *http.Response, err error) {
- bodyContent, _ := ioutil.ReadAll(body)
- poster.posts = append(poster.posts, post{
- url: url,
- bodyType: bodyType,
- bodyContent: bodyContent,
- })
- return nil, nil
-}
diff --git a/vendor/github.com/onsi/ginkgo/internal/remote/forwarding_reporter_test.go b/vendor/github.com/onsi/ginkgo/internal/remote/forwarding_reporter_test.go
deleted file mode 100644
index 0d7e4769c..000000000
--- a/vendor/github.com/onsi/ginkgo/internal/remote/forwarding_reporter_test.go
+++ /dev/null
@@ -1,181 +0,0 @@
-package remote_test
-
-import (
- "encoding/json"
-
- . "github.com/onsi/ginkgo"
- "github.com/onsi/ginkgo/config"
- . "github.com/onsi/ginkgo/internal/remote"
- "github.com/onsi/ginkgo/types"
- . "github.com/onsi/gomega"
-)
-
-var _ = Describe("ForwardingReporter", func() {
- var (
- reporter *ForwardingReporter
- interceptor *fakeOutputInterceptor
- poster *fakePoster
- suiteSummary *types.SuiteSummary
- specSummary *types.SpecSummary
- setupSummary *types.SetupSummary
- serverHost string
- )
-
- BeforeEach(func() {
- serverHost = "http://127.0.0.1:7788"
-
- poster = newFakePoster()
-
- interceptor = &fakeOutputInterceptor{
- InterceptedOutput: "The intercepted output!",
- }
-
- reporter = NewForwardingReporter(config.DefaultReporterConfigType{}, serverHost, poster, interceptor, nil, "")
-
- suiteSummary = &types.SuiteSummary{
- SuiteDescription: "My Test Suite",
- }
-
- setupSummary = &types.SetupSummary{
- State: types.SpecStatePassed,
- }
-
- specSummary = &types.SpecSummary{
- ComponentTexts: []string{"My", "Spec"},
- State: types.SpecStatePassed,
- }
- })
-
- Context("When a suite begins", func() {
- BeforeEach(func() {
- reporter.SpecSuiteWillBegin(config.GinkgoConfig, suiteSummary)
- })
-
- It("should start intercepting output", func() {
- Ω(interceptor.DidStartInterceptingOutput).Should(BeTrue())
- })
-
- It("should POST the SuiteSummary and Ginkgo Config to the Ginkgo server", func() {
- Ω(poster.posts).Should(HaveLen(1))
- Ω(poster.posts[0].url).Should(Equal("http://127.0.0.1:7788/SpecSuiteWillBegin"))
- Ω(poster.posts[0].bodyType).Should(Equal("application/json"))
-
- var sentData struct {
- SentConfig config.GinkgoConfigType `json:"config"`
- SentSuiteSummary *types.SuiteSummary `json:"suite-summary"`
- }
-
- err := json.Unmarshal(poster.posts[0].bodyContent, &sentData)
- Ω(err).ShouldNot(HaveOccurred())
-
- Ω(sentData.SentConfig).Should(Equal(config.GinkgoConfig))
- Ω(sentData.SentSuiteSummary).Should(Equal(suiteSummary))
- })
- })
-
- Context("when a BeforeSuite completes", func() {
- BeforeEach(func() {
- reporter.BeforeSuiteDidRun(setupSummary)
- })
-
- It("should stop, then start intercepting output", func() {
- Ω(interceptor.DidStopInterceptingOutput).Should(BeTrue())
- Ω(interceptor.DidStartInterceptingOutput).Should(BeTrue())
- })
-
- It("should POST the SetupSummary to the Ginkgo server", func() {
- Ω(poster.posts).Should(HaveLen(1))
- Ω(poster.posts[0].url).Should(Equal("http://127.0.0.1:7788/BeforeSuiteDidRun"))
- Ω(poster.posts[0].bodyType).Should(Equal("application/json"))
-
- var summary *types.SetupSummary
- err := json.Unmarshal(poster.posts[0].bodyContent, &summary)
- Ω(err).ShouldNot(HaveOccurred())
- setupSummary.CapturedOutput = interceptor.InterceptedOutput
- Ω(summary).Should(Equal(setupSummary))
- })
- })
-
- Context("when an AfterSuite completes", func() {
- BeforeEach(func() {
- reporter.AfterSuiteDidRun(setupSummary)
- })
-
- It("should stop, then start intercepting output", func() {
- Ω(interceptor.DidStopInterceptingOutput).Should(BeTrue())
- Ω(interceptor.DidStartInterceptingOutput).Should(BeTrue())
- })
-
- It("should POST the SetupSummary to the Ginkgo server", func() {
- Ω(poster.posts).Should(HaveLen(1))
- Ω(poster.posts[0].url).Should(Equal("http://127.0.0.1:7788/AfterSuiteDidRun"))
- Ω(poster.posts[0].bodyType).Should(Equal("application/json"))
-
- var summary *types.SetupSummary
- err := json.Unmarshal(poster.posts[0].bodyContent, &summary)
- Ω(err).ShouldNot(HaveOccurred())
- setupSummary.CapturedOutput = interceptor.InterceptedOutput
- Ω(summary).Should(Equal(setupSummary))
- })
- })
-
- Context("When a spec will run", func() {
- BeforeEach(func() {
- reporter.SpecWillRun(specSummary)
- })
-
- It("should POST the SpecSummary to the Ginkgo server", func() {
- Ω(poster.posts).Should(HaveLen(1))
- Ω(poster.posts[0].url).Should(Equal("http://127.0.0.1:7788/SpecWillRun"))
- Ω(poster.posts[0].bodyType).Should(Equal("application/json"))
-
- var summary *types.SpecSummary
- err := json.Unmarshal(poster.posts[0].bodyContent, &summary)
- Ω(err).ShouldNot(HaveOccurred())
- Ω(summary).Should(Equal(specSummary))
- })
-
- Context("When a spec completes", func() {
- BeforeEach(func() {
- specSummary.State = types.SpecStatePanicked
- reporter.SpecDidComplete(specSummary)
- })
-
- It("should POST the SpecSummary to the Ginkgo server and include any intercepted output", func() {
- Ω(poster.posts).Should(HaveLen(2))
- Ω(poster.posts[1].url).Should(Equal("http://127.0.0.1:7788/SpecDidComplete"))
- Ω(poster.posts[1].bodyType).Should(Equal("application/json"))
-
- var summary *types.SpecSummary
- err := json.Unmarshal(poster.posts[1].bodyContent, &summary)
- Ω(err).ShouldNot(HaveOccurred())
- specSummary.CapturedOutput = interceptor.InterceptedOutput
- Ω(summary).Should(Equal(specSummary))
- })
-
- It("should stop, then start intercepting output", func() {
- Ω(interceptor.DidStopInterceptingOutput).Should(BeTrue())
- Ω(interceptor.DidStartInterceptingOutput).Should(BeTrue())
- })
- })
- })
-
- Context("When a suite ends", func() {
- BeforeEach(func() {
- reporter.SpecSuiteDidEnd(suiteSummary)
- })
-
- It("should POST the SuiteSummary to the Ginkgo server", func() {
- Ω(poster.posts).Should(HaveLen(1))
- Ω(poster.posts[0].url).Should(Equal("http://127.0.0.1:7788/SpecSuiteDidEnd"))
- Ω(poster.posts[0].bodyType).Should(Equal("application/json"))
-
- var summary *types.SuiteSummary
-
- err := json.Unmarshal(poster.posts[0].bodyContent, &summary)
- Ω(err).ShouldNot(HaveOccurred())
-
- Ω(summary).Should(Equal(suiteSummary))
- })
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/internal/remote/remote_suite_test.go b/vendor/github.com/onsi/ginkgo/internal/remote/remote_suite_test.go
deleted file mode 100644
index e6b4e9f32..000000000
--- a/vendor/github.com/onsi/ginkgo/internal/remote/remote_suite_test.go
+++ /dev/null
@@ -1,13 +0,0 @@
-package remote_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-
- "testing"
-)
-
-func TestRemote(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "Remote Spec Forwarding Suite")
-}
diff --git a/vendor/github.com/onsi/ginkgo/internal/remote/server_test.go b/vendor/github.com/onsi/ginkgo/internal/remote/server_test.go
deleted file mode 100644
index 36bd00355..000000000
--- a/vendor/github.com/onsi/ginkgo/internal/remote/server_test.go
+++ /dev/null
@@ -1,269 +0,0 @@
-package remote_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/ginkgo/internal/remote"
- . "github.com/onsi/gomega"
-
- "github.com/onsi/ginkgo/config"
- "github.com/onsi/ginkgo/reporters"
- "github.com/onsi/ginkgo/types"
-
- "bytes"
- "encoding/json"
- "net/http"
-)
-
-var _ = Describe("Server", func() {
- var (
- server *Server
- )
-
- BeforeEach(func() {
- var err error
- server, err = NewServer(3)
- Ω(err).ShouldNot(HaveOccurred())
-
- server.Start()
- })
-
- AfterEach(func() {
- server.Close()
- })
-
- Describe("Streaming endpoints", func() {
- var (
- reporterA, reporterB *reporters.FakeReporter
- forwardingReporter *ForwardingReporter
-
- suiteSummary *types.SuiteSummary
- setupSummary *types.SetupSummary
- specSummary *types.SpecSummary
- )
-
- BeforeEach(func() {
- reporterA = reporters.NewFakeReporter()
- reporterB = reporters.NewFakeReporter()
-
- server.RegisterReporters(reporterA, reporterB)
-
- forwardingReporter = NewForwardingReporter(config.DefaultReporterConfigType{}, server.Address(), &http.Client{}, &fakeOutputInterceptor{}, nil, "")
-
- suiteSummary = &types.SuiteSummary{
- SuiteDescription: "My Test Suite",
- }
-
- setupSummary = &types.SetupSummary{
- State: types.SpecStatePassed,
- }
-
- specSummary = &types.SpecSummary{
- ComponentTexts: []string{"My", "Spec"},
- State: types.SpecStatePassed,
- }
- })
-
- It("should make its address available", func() {
- Ω(server.Address()).Should(MatchRegexp(`http://127.0.0.1:\d{2,}`))
- })
-
- Describe("/SpecSuiteWillBegin", func() {
- It("should decode and forward the Ginkgo config and suite summary", func(done Done) {
- forwardingReporter.SpecSuiteWillBegin(config.GinkgoConfig, suiteSummary)
- Ω(reporterA.Config).Should(Equal(config.GinkgoConfig))
- Ω(reporterB.Config).Should(Equal(config.GinkgoConfig))
- Ω(reporterA.BeginSummary).Should(Equal(suiteSummary))
- Ω(reporterB.BeginSummary).Should(Equal(suiteSummary))
- close(done)
- })
- })
-
- Describe("/BeforeSuiteDidRun", func() {
- It("should decode and forward the setup summary", func() {
- forwardingReporter.BeforeSuiteDidRun(setupSummary)
- Ω(reporterA.BeforeSuiteSummary).Should(Equal(setupSummary))
- Ω(reporterB.BeforeSuiteSummary).Should(Equal(setupSummary))
- })
- })
-
- Describe("/AfterSuiteDidRun", func() {
- It("should decode and forward the setup summary", func() {
- forwardingReporter.AfterSuiteDidRun(setupSummary)
- Ω(reporterA.AfterSuiteSummary).Should(Equal(setupSummary))
- Ω(reporterB.AfterSuiteSummary).Should(Equal(setupSummary))
- })
- })
-
- Describe("/SpecWillRun", func() {
- It("should decode and forward the spec summary", func(done Done) {
- forwardingReporter.SpecWillRun(specSummary)
- Ω(reporterA.SpecWillRunSummaries[0]).Should(Equal(specSummary))
- Ω(reporterB.SpecWillRunSummaries[0]).Should(Equal(specSummary))
- close(done)
- })
- })
-
- Describe("/SpecDidComplete", func() {
- It("should decode and forward the spec summary", func(done Done) {
- forwardingReporter.SpecDidComplete(specSummary)
- Ω(reporterA.SpecSummaries[0]).Should(Equal(specSummary))
- Ω(reporterB.SpecSummaries[0]).Should(Equal(specSummary))
- close(done)
- })
- })
-
- Describe("/SpecSuiteDidEnd", func() {
- It("should decode and forward the suite summary", func(done Done) {
- forwardingReporter.SpecSuiteDidEnd(suiteSummary)
- Ω(reporterA.EndSummary).Should(Equal(suiteSummary))
- Ω(reporterB.EndSummary).Should(Equal(suiteSummary))
- close(done)
- })
- })
- })
-
- Describe("Synchronization endpoints", func() {
- Describe("GETting and POSTing BeforeSuiteState", func() {
- getBeforeSuite := func() types.RemoteBeforeSuiteData {
- resp, err := http.Get(server.Address() + "/BeforeSuiteState")
- Ω(err).ShouldNot(HaveOccurred())
- Ω(resp.StatusCode).Should(Equal(http.StatusOK))
-
- r := types.RemoteBeforeSuiteData{}
- decoder := json.NewDecoder(resp.Body)
- err = decoder.Decode(&r)
- Ω(err).ShouldNot(HaveOccurred())
-
- return r
- }
-
- postBeforeSuite := func(r types.RemoteBeforeSuiteData) {
- resp, err := http.Post(server.Address()+"/BeforeSuiteState", "application/json", bytes.NewReader(r.ToJSON()))
- Ω(err).ShouldNot(HaveOccurred())
- Ω(resp.StatusCode).Should(Equal(http.StatusOK))
- }
-
- Context("when the first node's Alive has not been registered yet", func() {
- It("should return pending", func() {
- state := getBeforeSuite()
- Ω(state).Should(Equal(types.RemoteBeforeSuiteData{Data: nil, State: types.RemoteBeforeSuiteStatePending}))
-
- state = getBeforeSuite()
- Ω(state).Should(Equal(types.RemoteBeforeSuiteData{Data: nil, State: types.RemoteBeforeSuiteStatePending}))
- })
- })
-
- Context("when the first node is Alive but has not responded yet", func() {
- BeforeEach(func() {
- server.RegisterAlive(1, func() bool {
- return true
- })
- })
-
- It("should return pending", func() {
- state := getBeforeSuite()
- Ω(state).Should(Equal(types.RemoteBeforeSuiteData{Data: nil, State: types.RemoteBeforeSuiteStatePending}))
-
- state = getBeforeSuite()
- Ω(state).Should(Equal(types.RemoteBeforeSuiteData{Data: nil, State: types.RemoteBeforeSuiteStatePending}))
- })
- })
-
- Context("when the first node has responded", func() {
- var state types.RemoteBeforeSuiteData
- BeforeEach(func() {
- server.RegisterAlive(1, func() bool {
- return false
- })
-
- state = types.RemoteBeforeSuiteData{
- Data: []byte("my data"),
- State: types.RemoteBeforeSuiteStatePassed,
- }
- postBeforeSuite(state)
- })
-
- It("should return the passed in state", func() {
- returnedState := getBeforeSuite()
- Ω(returnedState).Should(Equal(state))
- })
- })
-
- Context("when the first node is no longer Alive and has not responded yet", func() {
- BeforeEach(func() {
- server.RegisterAlive(1, func() bool {
- return false
- })
- })
-
- It("should return disappeared", func() {
- state := getBeforeSuite()
- Ω(state).Should(Equal(types.RemoteBeforeSuiteData{Data: nil, State: types.RemoteBeforeSuiteStateDisappeared}))
-
- state = getBeforeSuite()
- Ω(state).Should(Equal(types.RemoteBeforeSuiteData{Data: nil, State: types.RemoteBeforeSuiteStateDisappeared}))
- })
- })
- })
-
- Describe("GETting RemoteAfterSuiteData", func() {
- getRemoteAfterSuiteData := func() bool {
- resp, err := http.Get(server.Address() + "/RemoteAfterSuiteData")
- Ω(err).ShouldNot(HaveOccurred())
- Ω(resp.StatusCode).Should(Equal(http.StatusOK))
-
- a := types.RemoteAfterSuiteData{}
- decoder := json.NewDecoder(resp.Body)
- err = decoder.Decode(&a)
- Ω(err).ShouldNot(HaveOccurred())
-
- return a.CanRun
- }
-
- Context("when there are unregistered nodes", func() {
- BeforeEach(func() {
- server.RegisterAlive(2, func() bool {
- return false
- })
- })
-
- It("should return false", func() {
- Ω(getRemoteAfterSuiteData()).Should(BeFalse())
- })
- })
-
- Context("when all none-node-1 nodes are still running", func() {
- BeforeEach(func() {
- server.RegisterAlive(2, func() bool {
- return true
- })
-
- server.RegisterAlive(3, func() bool {
- return false
- })
- })
-
- It("should return false", func() {
- Ω(getRemoteAfterSuiteData()).Should(BeFalse())
- })
- })
-
- Context("when all none-1 nodes are done", func() {
- BeforeEach(func() {
- server.RegisterAlive(2, func() bool {
- return false
- })
-
- server.RegisterAlive(3, func() bool {
- return false
- })
- })
-
- It("should return true", func() {
- Ω(getRemoteAfterSuiteData()).Should(BeTrue())
- })
-
- })
- })
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/internal/spec/spec_suite_test.go b/vendor/github.com/onsi/ginkgo/internal/spec/spec_suite_test.go
deleted file mode 100644
index 8681a7206..000000000
--- a/vendor/github.com/onsi/ginkgo/internal/spec/spec_suite_test.go
+++ /dev/null
@@ -1,13 +0,0 @@
-package spec_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-
- "testing"
-)
-
-func TestSpec(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "Spec Suite")
-}
diff --git a/vendor/github.com/onsi/ginkgo/internal/spec/spec_test.go b/vendor/github.com/onsi/ginkgo/internal/spec/spec_test.go
deleted file mode 100644
index b4a2c9c79..000000000
--- a/vendor/github.com/onsi/ginkgo/internal/spec/spec_test.go
+++ /dev/null
@@ -1,739 +0,0 @@
-package spec_test
-
-import (
- "time"
-
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
- "github.com/onsi/gomega/gbytes"
-
- . "github.com/onsi/ginkgo/internal/spec"
-
- "github.com/onsi/ginkgo/internal/codelocation"
- "github.com/onsi/ginkgo/internal/containernode"
- Failer "github.com/onsi/ginkgo/internal/failer"
- "github.com/onsi/ginkgo/internal/leafnodes"
- "github.com/onsi/ginkgo/types"
-)
-
-var noneFlag = types.FlagTypeNone
-var focusedFlag = types.FlagTypeFocused
-var pendingFlag = types.FlagTypePending
-
-var _ = Describe("Spec", func() {
- var (
- failer *Failer.Failer
- codeLocation types.CodeLocation
- nodesThatRan []string
- spec *Spec
- buffer *gbytes.Buffer
- )
-
- newBody := func(text string, fail bool) func() {
- return func() {
- nodesThatRan = append(nodesThatRan, text)
- if fail {
- failer.Fail(text, codeLocation)
- }
- }
- }
-
- newIt := func(text string, flag types.FlagType, fail bool) *leafnodes.ItNode {
- return leafnodes.NewItNode(text, newBody(text, fail), flag, codeLocation, 0, failer, 0)
- }
-
- newItWithBody := func(text string, body interface{}) *leafnodes.ItNode {
- return leafnodes.NewItNode(text, body, noneFlag, codeLocation, 0, failer, 0)
- }
-
- newMeasure := func(text string, flag types.FlagType, fail bool, samples int) *leafnodes.MeasureNode {
- return leafnodes.NewMeasureNode(text, func(Benchmarker) {
- nodesThatRan = append(nodesThatRan, text)
- if fail {
- failer.Fail(text, codeLocation)
- }
- }, flag, codeLocation, samples, failer, 0)
- }
-
- newBef := func(text string, fail bool) leafnodes.BasicNode {
- return leafnodes.NewBeforeEachNode(newBody(text, fail), codeLocation, 0, failer, 0)
- }
-
- newAft := func(text string, fail bool) leafnodes.BasicNode {
- return leafnodes.NewAfterEachNode(newBody(text, fail), codeLocation, 0, failer, 0)
- }
-
- newJusBef := func(text string, fail bool) leafnodes.BasicNode {
- return leafnodes.NewJustBeforeEachNode(newBody(text, fail), codeLocation, 0, failer, 0)
- }
-
- newJusAft := func(text string, fail bool) leafnodes.BasicNode {
- return leafnodes.NewJustAfterEachNode(newBody(text, fail), codeLocation, 0, failer, 0)
- }
-
- newContainer := func(text string, flag types.FlagType, setupNodes ...leafnodes.BasicNode) *containernode.ContainerNode {
- c := containernode.New(text, flag, codeLocation)
- for _, node := range setupNodes {
- c.PushSetupNode(node)
- }
- return c
- }
-
- containers := func(containers ...*containernode.ContainerNode) []*containernode.ContainerNode {
- return containers
- }
-
- BeforeEach(func() {
- buffer = gbytes.NewBuffer()
- failer = Failer.New()
- codeLocation = codelocation.New(0)
- nodesThatRan = []string{}
- })
-
- Describe("marking specs focused and pending", func() {
- It("should satisfy various caes", func() {
- cases := []struct {
- ContainerFlags []types.FlagType
- SubjectFlag types.FlagType
- Pending bool
- Focused bool
- }{
- {[]types.FlagType{}, noneFlag, false, false},
- {[]types.FlagType{}, focusedFlag, false, true},
- {[]types.FlagType{}, pendingFlag, true, false},
- {[]types.FlagType{noneFlag}, noneFlag, false, false},
- {[]types.FlagType{focusedFlag}, noneFlag, false, true},
- {[]types.FlagType{pendingFlag}, noneFlag, true, false},
- {[]types.FlagType{noneFlag}, focusedFlag, false, true},
- {[]types.FlagType{focusedFlag}, focusedFlag, false, true},
- {[]types.FlagType{pendingFlag}, focusedFlag, true, true},
- {[]types.FlagType{noneFlag}, pendingFlag, true, false},
- {[]types.FlagType{focusedFlag}, pendingFlag, true, true},
- {[]types.FlagType{pendingFlag}, pendingFlag, true, false},
- {[]types.FlagType{focusedFlag, noneFlag}, noneFlag, false, true},
- {[]types.FlagType{noneFlag, focusedFlag}, noneFlag, false, true},
- {[]types.FlagType{pendingFlag, noneFlag}, noneFlag, true, false},
- {[]types.FlagType{noneFlag, pendingFlag}, noneFlag, true, false},
- {[]types.FlagType{focusedFlag, pendingFlag}, noneFlag, true, true},
- }
-
- for i, c := range cases {
- subject := newIt("it node", c.SubjectFlag, false)
- containers := []*containernode.ContainerNode{}
- for _, flag := range c.ContainerFlags {
- containers = append(containers, newContainer("container", flag))
- }
-
- spec := New(subject, containers, false)
- Ω(spec.Pending()).Should(Equal(c.Pending), "Case %d: %#v", i, c)
- Ω(spec.Focused()).Should(Equal(c.Focused), "Case %d: %#v", i, c)
-
- if c.Pending {
- Ω(spec.Summary("").State).Should(Equal(types.SpecStatePending))
- }
- }
- })
- })
-
- Describe("Skip", func() {
- It("should be skipped", func() {
- spec := New(newIt("it node", noneFlag, false), containers(newContainer("container", noneFlag)), false)
- Ω(spec.Skipped()).Should(BeFalse())
- spec.Skip()
- Ω(spec.Skipped()).Should(BeTrue())
- Ω(spec.Summary("").State).Should(Equal(types.SpecStateSkipped))
- })
- })
-
- Describe("IsMeasurement", func() {
- It("should be true if the subject is a measurement node", func() {
- spec := New(newIt("it node", noneFlag, false), containers(newContainer("container", noneFlag)), false)
- Ω(spec.IsMeasurement()).Should(BeFalse())
- Ω(spec.Summary("").IsMeasurement).Should(BeFalse())
- Ω(spec.Summary("").NumberOfSamples).Should(Equal(1))
-
- spec = New(newMeasure("measure node", noneFlag, false, 10), containers(newContainer("container", noneFlag)), false)
- Ω(spec.IsMeasurement()).Should(BeTrue())
- Ω(spec.Summary("").IsMeasurement).Should(BeTrue())
- Ω(spec.Summary("").NumberOfSamples).Should(Equal(10))
- })
- })
-
- Describe("Passed", func() {
- It("should pass when the subject passed", func() {
- spec := New(newIt("it node", noneFlag, false), containers(), false)
- spec.Run(buffer)
-
- Ω(spec.Passed()).Should(BeTrue())
- Ω(spec.Failed()).Should(BeFalse())
- Ω(spec.Summary("").State).Should(Equal(types.SpecStatePassed))
- Ω(spec.Summary("").Failure).Should(BeZero())
- })
- })
-
- Describe("Flaked", func() {
- It("should work if Run is called twice and gets different results", func() {
- i := 0
- spec := New(newItWithBody("flaky it", func() {
- i++
- if i == 1 {
- failer.Fail("oops", codeLocation)
- }
- }), containers(), false)
- spec.Run(buffer)
- Ω(spec.Passed()).Should(BeFalse())
- Ω(spec.Failed()).Should(BeTrue())
- Ω(spec.Flaked()).Should(BeFalse())
- Ω(spec.Summary("").State).Should(Equal(types.SpecStateFailed))
- Ω(spec.Summary("").Failure.Message).Should(Equal("oops"))
- spec.Run(buffer)
- Ω(spec.Passed()).Should(BeTrue())
- Ω(spec.Failed()).Should(BeFalse())
- Ω(spec.Flaked()).Should(BeTrue())
- Ω(spec.Summary("").State).Should(Equal(types.SpecStatePassed))
- })
- })
-
- Describe("Failed", func() {
- It("should be failed if the failure was panic", func() {
- spec := New(newItWithBody("panicky it", func() {
- panic("bam")
- }), containers(), false)
- spec.Run(buffer)
- Ω(spec.Passed()).Should(BeFalse())
- Ω(spec.Failed()).Should(BeTrue())
- Ω(spec.Summary("").State).Should(Equal(types.SpecStatePanicked))
- Ω(spec.Summary("").Failure.Message).Should(Equal("Test Panicked"))
- Ω(spec.Summary("").Failure.ForwardedPanic).Should(Equal("bam"))
- })
-
- It("should be failed if the failure was a timeout", func() {
- spec := New(newItWithBody("sleepy it", func(done Done) {}), containers(), false)
- spec.Run(buffer)
- Ω(spec.Passed()).Should(BeFalse())
- Ω(spec.Failed()).Should(BeTrue())
- Ω(spec.Summary("").State).Should(Equal(types.SpecStateTimedOut))
- Ω(spec.Summary("").Failure.Message).Should(Equal("Timed out"))
- })
-
- It("should be failed if the failure was... a failure", func() {
- spec := New(newItWithBody("failing it", func() {
- failer.Fail("bam", codeLocation)
- }), containers(), false)
- spec.Run(buffer)
- Ω(spec.Passed()).Should(BeFalse())
- Ω(spec.Failed()).Should(BeTrue())
- Ω(spec.Summary("").State).Should(Equal(types.SpecStateFailed))
- Ω(spec.Summary("").Failure.Message).Should(Equal("bam"))
- })
- })
-
- Describe("Concatenated string", func() {
- It("should concatenate the texts of the containers and the subject", func() {
- spec := New(
- newIt("it node", noneFlag, false),
- containers(
- newContainer("outer container", noneFlag),
- newContainer("inner container", noneFlag),
- ),
- false,
- )
-
- Ω(spec.ConcatenatedString()).Should(Equal("outer container inner container it node"))
- })
- })
-
- Describe("running it specs", func() {
- Context("with just an it", func() {
- Context("that succeeds", func() {
- It("should run the it and report on its success", func() {
- spec := New(newIt("it node", noneFlag, false), containers(), false)
- spec.Run(buffer)
- Ω(spec.Passed()).Should(BeTrue())
- Ω(spec.Failed()).Should(BeFalse())
- Ω(nodesThatRan).Should(Equal([]string{"it node"}))
- })
- })
-
- Context("that fails", func() {
- It("should run the it and report on its success", func() {
- spec := New(newIt("it node", noneFlag, true), containers(), false)
- spec.Run(buffer)
- Ω(spec.Passed()).Should(BeFalse())
- Ω(spec.Failed()).Should(BeTrue())
- Ω(spec.Summary("").Failure.Message).Should(Equal("it node"))
- Ω(nodesThatRan).Should(Equal([]string{"it node"}))
- })
- })
- })
-
- Context("with a full set of setup nodes", func() {
- var failingNodes map[string]bool
-
- BeforeEach(func() {
- failingNodes = map[string]bool{}
- })
-
- JustBeforeEach(func() {
- spec = New(
- newIt("it node", noneFlag, failingNodes["it node"]),
- containers(
- newContainer("outer container", noneFlag,
- newBef("outer bef A", failingNodes["outer bef A"]),
- newBef("outer bef B", failingNodes["outer bef B"]),
- newJusBef("outer jusbef A", failingNodes["outer jusbef A"]),
- newJusBef("outer jusbef B", failingNodes["outer jusbef B"]),
- newJusAft("outer jusaft A", failingNodes["outer jusaft A"]),
- newJusAft("outer jusaft B", failingNodes["outer jusaft B"]),
- newAft("outer aft A", failingNodes["outer aft A"]),
- newAft("outer aft B", failingNodes["outer aft B"]),
- ),
- newContainer("inner container", noneFlag,
- newBef("inner bef A", failingNodes["inner bef A"]),
- newBef("inner bef B", failingNodes["inner bef B"]),
- newJusBef("inner jusbef A", failingNodes["inner jusbef A"]),
- newJusBef("inner jusbef B", failingNodes["inner jusbef B"]),
- newJusAft("inner jusaft A", failingNodes["inner jusaft A"]),
- newJusAft("inner jusaft B", failingNodes["inner jusaft B"]),
- newAft("inner aft A", failingNodes["inner aft A"]),
- newAft("inner aft B", failingNodes["inner aft B"]),
- ),
- ),
- false,
- )
- spec.Run(buffer)
- })
-
- Context("that all pass", func() {
- It("should walk through the nodes in the correct order", func() {
- Ω(spec.Passed()).Should(BeTrue())
- Ω(spec.Failed()).Should(BeFalse())
- Ω(nodesThatRan).Should(Equal([]string{
- "outer bef A",
- "outer bef B",
- "inner bef A",
- "inner bef B",
- "outer jusbef A",
- "outer jusbef B",
- "inner jusbef A",
- "inner jusbef B",
- "it node",
- "inner jusaft A",
- "inner jusaft B",
- "outer jusaft A",
- "outer jusaft B",
- "inner aft A",
- "inner aft B",
- "outer aft A",
- "outer aft B",
- }))
- })
- })
-
- Context("when the subject fails", func() {
- BeforeEach(func() {
- failingNodes["it node"] = true
- })
-
- It("should run the afters", func() {
- Ω(spec.Passed()).Should(BeFalse())
- Ω(spec.Failed()).Should(BeTrue())
- Ω(nodesThatRan).Should(Equal([]string{
- "outer bef A",
- "outer bef B",
- "inner bef A",
- "inner bef B",
- "outer jusbef A",
- "outer jusbef B",
- "inner jusbef A",
- "inner jusbef B",
- "it node",
- "inner jusaft A",
- "inner jusaft B",
- "outer jusaft A",
- "outer jusaft B",
- "inner aft A",
- "inner aft B",
- "outer aft A",
- "outer aft B",
- }))
- Ω(spec.Summary("").Failure.Message).Should(Equal("it node"))
- })
- })
-
- Context("when an inner before fails", func() {
- BeforeEach(func() {
- failingNodes["inner bef A"] = true
- })
-
- It("should not run any other befores, but it should run the subsequent afters", func() {
- Ω(spec.Passed()).Should(BeFalse())
- Ω(spec.Failed()).Should(BeTrue())
- Ω(nodesThatRan).Should(Equal([]string{
- "outer bef A",
- "outer bef B",
- "inner bef A",
- "inner jusaft A",
- "inner jusaft B",
- "outer jusaft A",
- "outer jusaft B",
- "inner aft A",
- "inner aft B",
- "outer aft A",
- "outer aft B",
- }))
- Ω(spec.Summary("").Failure.Message).Should(Equal("inner bef A"))
- })
- })
-
- Context("when an outer before fails", func() {
- BeforeEach(func() {
- failingNodes["outer bef B"] = true
- })
-
- It("should not run any other befores, but it should run the subsequent afters", func() {
- Ω(spec.Passed()).Should(BeFalse())
- Ω(spec.Failed()).Should(BeTrue())
- Ω(nodesThatRan).Should(Equal([]string{
- "outer bef A",
- "outer bef B",
- "outer jusaft A",
- "outer jusaft B",
- "outer aft A",
- "outer aft B",
- }))
- Ω(spec.Summary("").Failure.Message).Should(Equal("outer bef B"))
- })
- })
-
- Context("when an after fails", func() {
- BeforeEach(func() {
- failingNodes["inner aft B"] = true
- })
-
- It("should run all other afters, but mark the test as failed", func() {
- Ω(spec.Passed()).Should(BeFalse())
- Ω(spec.Failed()).Should(BeTrue())
- Ω(nodesThatRan).Should(Equal([]string{
- "outer bef A",
- "outer bef B",
- "inner bef A",
- "inner bef B",
- "outer jusbef A",
- "outer jusbef B",
- "inner jusbef A",
- "inner jusbef B",
- "it node",
- "inner jusaft A",
- "inner jusaft B",
- "outer jusaft A",
- "outer jusaft B",
- "inner aft A",
- "inner aft B",
- "outer aft A",
- "outer aft B",
- }))
- Ω(spec.Summary("").Failure.Message).Should(Equal("inner aft B"))
- })
- })
-
- Context("when a just before each fails", func() {
- BeforeEach(func() {
- failingNodes["outer jusbef B"] = true
- })
-
- It("should run the afters, but not the subject", func() {
- Ω(spec.Passed()).Should(BeFalse())
- Ω(spec.Failed()).Should(BeTrue())
- Ω(nodesThatRan).Should(Equal([]string{
- "outer bef A",
- "outer bef B",
- "inner bef A",
- "inner bef B",
- "outer jusbef A",
- "outer jusbef B",
- "inner jusaft A",
- "inner jusaft B",
- "outer jusaft A",
- "outer jusaft B",
- "inner aft A",
- "inner aft B",
- "outer aft A",
- "outer aft B",
- }))
- Ω(spec.Summary("").Failure.Message).Should(Equal("outer jusbef B"))
- })
- })
-
- Context("when a just after each fails", func() {
- BeforeEach(func() {
- failingNodes["outer jusaft A"] = true
- })
-
- It("should run all other afters, but mark the test as failed", func() {
- Ω(spec.Passed()).Should(BeFalse())
- Ω(spec.Failed()).Should(BeTrue())
- Ω(nodesThatRan).Should(Equal([]string{
- "outer bef A",
- "outer bef B",
- "inner bef A",
- "inner bef B",
- "outer jusbef A",
- "outer jusbef B",
- "inner jusbef A",
- "inner jusbef B",
- "it node",
- "inner jusaft A",
- "inner jusaft B",
- "outer jusaft A",
- "outer jusaft B",
- "inner aft A",
- "inner aft B",
- "outer aft A",
- "outer aft B",
- }))
- Ω(spec.Summary("").Failure.Message).Should(Equal("outer jusaft A"))
- })
- })
-
- Context("when an after fails after an earlier node has failed", func() {
- BeforeEach(func() {
- failingNodes["it node"] = true
- failingNodes["inner aft B"] = true
- })
-
- It("should record the earlier failure", func() {
- Ω(spec.Passed()).Should(BeFalse())
- Ω(spec.Failed()).Should(BeTrue())
- Ω(nodesThatRan).Should(Equal([]string{
- "outer bef A",
- "outer bef B",
- "inner bef A",
- "inner bef B",
- "outer jusbef A",
- "outer jusbef B",
- "inner jusbef A",
- "inner jusbef B",
- "it node",
- "inner jusaft A",
- "inner jusaft B",
- "outer jusaft A",
- "outer jusaft B",
- "inner aft A",
- "inner aft B",
- "outer aft A",
- "outer aft B",
- }))
- Ω(spec.Summary("").Failure.Message).Should(Equal("it node"))
- })
- })
- })
- })
-
- Describe("running measurement specs", func() {
- Context("when the measurement succeeds", func() {
- It("should run N samples", func() {
- spec = New(
- newMeasure("measure node", noneFlag, false, 3),
- containers(
- newContainer("container", noneFlag,
- newBef("bef A", false),
- newJusBef("jusbef A", false),
- newJusAft("jusaft A", false),
- newAft("aft A", false),
- ),
- ),
- false,
- )
- spec.Run(buffer)
-
- Ω(spec.Passed()).Should(BeTrue())
- Ω(spec.Failed()).Should(BeFalse())
- Ω(nodesThatRan).Should(Equal([]string{
- "bef A",
- "jusbef A",
- "measure node",
- "jusaft A",
- "aft A",
- "bef A",
- "jusbef A",
- "measure node",
- "jusaft A",
- "aft A",
- "bef A",
- "jusbef A",
- "measure node",
- "jusaft A",
- "aft A",
- }))
- })
- })
-
- Context("when the measurement fails", func() {
- It("should bail after the failure occurs", func() {
- spec = New(
- newMeasure("measure node", noneFlag, true, 3),
- containers(
- newContainer("container", noneFlag,
- newBef("bef A", false),
- newJusBef("jusbef A", false),
- newJusAft("jusaft A", false),
- newAft("aft A", false),
- ),
- ),
- false,
- )
- spec.Run(buffer)
-
- Ω(spec.Passed()).Should(BeFalse())
- Ω(spec.Failed()).Should(BeTrue())
- Ω(nodesThatRan).Should(Equal([]string{
- "bef A",
- "jusbef A",
- "measure node",
- "jusaft A",
- "aft A",
- }))
- })
- })
- })
-
- Describe("Summary", func() {
- var (
- subjectCodeLocation types.CodeLocation
- outerContainerCodeLocation types.CodeLocation
- innerContainerCodeLocation types.CodeLocation
- summary *types.SpecSummary
- )
-
- BeforeEach(func() {
- subjectCodeLocation = codelocation.New(0)
- outerContainerCodeLocation = codelocation.New(0)
- innerContainerCodeLocation = codelocation.New(0)
-
- spec = New(
- leafnodes.NewItNode("it node", func() {
- time.Sleep(10 * time.Millisecond)
- }, noneFlag, subjectCodeLocation, 0, failer, 0),
- containers(
- containernode.New("outer container", noneFlag, outerContainerCodeLocation),
- containernode.New("inner container", noneFlag, innerContainerCodeLocation),
- ),
- false,
- )
-
- spec.Run(buffer)
- Ω(spec.Passed()).Should(BeTrue())
- summary = spec.Summary("suite id")
- })
-
- It("should have the suite id", func() {
- Ω(summary.SuiteID).Should(Equal("suite id"))
- })
-
- It("should have the component texts and code locations", func() {
- Ω(summary.ComponentTexts).Should(Equal([]string{"outer container", "inner container", "it node"}))
- Ω(summary.ComponentCodeLocations).Should(Equal([]types.CodeLocation{outerContainerCodeLocation, innerContainerCodeLocation, subjectCodeLocation}))
- })
-
- It("should have a runtime", func() {
- Ω(summary.RunTime).Should(BeNumerically(">=", 10*time.Millisecond))
- })
-
- It("should have a runtime which remains consistent after spec run", func() {
- totalRunTime := summary.RunTime
- Ω(totalRunTime).Should(BeNumerically(">=", 10*time.Millisecond))
-
- Consistently(func() time.Duration { return spec.Summary("suite id").RunTime }).Should(Equal(totalRunTime))
- })
-
- It("should not be a measurement, or have a measurement summary", func() {
- Ω(summary.IsMeasurement).Should(BeFalse())
- Ω(summary.Measurements).Should(BeEmpty())
- })
- })
-
- Describe("Summaries for measurements", func() {
- var summary *types.SpecSummary
-
- BeforeEach(func() {
- spec = New(leafnodes.NewMeasureNode("measure node", func(b Benchmarker) {
- b.RecordValue("a value", 7, "some info")
- b.RecordValueWithPrecision("another value", 8, "ns", 5, "more info")
- }, noneFlag, codeLocation, 4, failer, 0), containers(), false)
- spec.Run(buffer)
- Ω(spec.Passed()).Should(BeTrue())
- summary = spec.Summary("suite id")
- })
-
- It("should include the number of samples", func() {
- Ω(summary.NumberOfSamples).Should(Equal(4))
- })
-
- It("should be a measurement", func() {
- Ω(summary.IsMeasurement).Should(BeTrue())
- })
-
- It("should have the measurements report", func() {
- Ω(summary.Measurements).Should(HaveKey("a value"))
- report := summary.Measurements["a value"]
- Ω(report.Name).Should(Equal("a value"))
- Ω(report.Info).Should(Equal("some info"))
- Ω(report.Results).Should(Equal([]float64{7, 7, 7, 7}))
-
- Ω(summary.Measurements).Should(HaveKey("another value"))
- report = summary.Measurements["another value"]
- Ω(report.Name).Should(Equal("another value"))
- Ω(report.Info).Should(Equal("more info"))
- Ω(report.Results).Should(Equal([]float64{8, 8, 8, 8}))
- Ω(report.Units).Should(Equal("ns"))
- Ω(report.Precision).Should(Equal(5))
- })
- })
-
- Describe("When told to emit progress", func() {
- It("should emit progress to the writer as it runs Befores, JustBefores, Afters, and Its", func() {
- spec = New(
- newIt("it node", noneFlag, false),
- containers(
- newContainer("outer container", noneFlag,
- newBef("outer bef A", false),
- newJusBef("outer jusbef A", false),
- newJusAft("outer jusaft A", false),
- newAft("outer aft A", false),
- ),
- newContainer("inner container", noneFlag,
- newBef("inner bef A", false),
- newJusBef("inner jusbef A", false),
- newJusAft("inner jusaft A", false),
- newAft("inner aft A", false),
- ),
- ),
- true,
- )
- spec.Run(buffer)
-
- Ω(buffer).Should(gbytes.Say(`\[BeforeEach\] outer container`))
- Ω(buffer).Should(gbytes.Say(`\[BeforeEach\] inner container`))
- Ω(buffer).Should(gbytes.Say(`\[JustBeforeEach\] outer container`))
- Ω(buffer).Should(gbytes.Say(`\[JustBeforeEach\] inner container`))
- Ω(buffer).Should(gbytes.Say(`\[It\] it node`))
- Ω(buffer).Should(gbytes.Say(`\[JustAfterEach\] inner container`))
- Ω(buffer).Should(gbytes.Say(`\[JustAfterEach\] outer container`))
- Ω(buffer).Should(gbytes.Say(`\[AfterEach\] inner container`))
- Ω(buffer).Should(gbytes.Say(`\[AfterEach\] outer container`))
- })
-
- It("should emit progress to the writer as it runs Befores, JustBefores, JustAfters, Afters, and Measures", func() {
- spec = New(
- newMeasure("measure node", noneFlag, false, 2),
- containers(),
- true,
- )
- spec.Run(buffer)
-
- Ω(buffer).Should(gbytes.Say(`\[Measure\] measure node`))
- Ω(buffer).Should(gbytes.Say(`\[Measure\] measure node`))
- })
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/internal/spec/specs.go b/vendor/github.com/onsi/ginkgo/internal/spec/specs.go
index 006185ab5..27c0d1d6c 100644
--- a/vendor/github.com/onsi/ginkgo/internal/spec/specs.go
+++ b/vendor/github.com/onsi/ginkgo/internal/spec/specs.go
@@ -7,14 +7,21 @@ import (
)
type Specs struct {
- specs []*Spec
+ specs []*Spec
+ names []string
+
hasProgrammaticFocus bool
RegexScansFilePath bool
}
func NewSpecs(specs []*Spec) *Specs {
+ names := make([]string, len(specs))
+ for i, spec := range specs {
+ names[i] = spec.ConcatenatedString()
+ }
return &Specs{
specs: specs,
+ names: names,
}
}
@@ -30,10 +37,13 @@ func (e *Specs) Shuffle(r *rand.Rand) {
sort.Sort(e)
permutation := r.Perm(len(e.specs))
shuffledSpecs := make([]*Spec, len(e.specs))
+ names := make([]string, len(e.specs))
for i, j := range permutation {
shuffledSpecs[i] = e.specs[j]
+ names[i] = e.names[j]
}
e.specs = shuffledSpecs
+ e.names = names
}
func (e *Specs) ApplyFocus(description string, focusString string, skipString string) {
@@ -64,33 +74,43 @@ func (e *Specs) applyProgrammaticFocus() {
// toMatch returns a byte[] to be used by regex matchers. When adding new behaviours to the matching function,
// this is the place which we append to.
-func (e *Specs) toMatch(description string, spec *Spec) []byte {
+func (e *Specs) toMatch(description string, i int) []byte {
+ if i > len(e.names) {
+ return nil
+ }
if e.RegexScansFilePath {
return []byte(
description + " " +
- spec.ConcatenatedString() + " " +
- spec.subject.CodeLocation().FileName)
+ e.names[i] + " " +
+ e.specs[i].subject.CodeLocation().FileName)
} else {
return []byte(
description + " " +
- spec.ConcatenatedString())
+ e.names[i])
}
}
func (e *Specs) applyRegExpFocusAndSkip(description string, focusString string, skipString string) {
- for _, spec := range e.specs {
+ var focusFilter *regexp.Regexp
+ if focusString != "" {
+ focusFilter = regexp.MustCompile(focusString)
+ }
+ var skipFilter *regexp.Regexp
+ if skipString != "" {
+ skipFilter = regexp.MustCompile(skipString)
+ }
+
+ for i, spec := range e.specs {
matchesFocus := true
matchesSkip := false
- toMatch := e.toMatch(description, spec)
+ toMatch := e.toMatch(description, i)
- if focusString != "" {
- focusFilter := regexp.MustCompile(focusString)
+ if focusFilter != nil {
matchesFocus = focusFilter.Match([]byte(toMatch))
}
- if skipString != "" {
- skipFilter := regexp.MustCompile(skipString)
+ if skipFilter != nil {
matchesSkip = skipFilter.Match([]byte(toMatch))
}
@@ -115,9 +135,10 @@ func (e *Specs) Len() int {
}
func (e *Specs) Less(i, j int) bool {
- return e.specs[i].ConcatenatedString() < e.specs[j].ConcatenatedString()
+ return e.names[i] < e.names[j]
}
func (e *Specs) Swap(i, j int) {
+ e.names[i], e.names[j] = e.names[j], e.names[i]
e.specs[i], e.specs[j] = e.specs[j], e.specs[i]
}
diff --git a/vendor/github.com/onsi/ginkgo/internal/spec/specs_test.go b/vendor/github.com/onsi/ginkgo/internal/spec/specs_test.go
deleted file mode 100644
index 066fbbb3a..000000000
--- a/vendor/github.com/onsi/ginkgo/internal/spec/specs_test.go
+++ /dev/null
@@ -1,287 +0,0 @@
-package spec_test
-
-import (
- "math/rand"
-
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/ginkgo/internal/spec"
- . "github.com/onsi/gomega"
-
- "github.com/onsi/ginkgo/internal/codelocation"
- "github.com/onsi/ginkgo/internal/containernode"
- "github.com/onsi/ginkgo/internal/leafnodes"
- "github.com/onsi/ginkgo/types"
-)
-
-var _ = Describe("Specs", func() {
- var specs *Specs
-
- newSpec := func(text string, flag types.FlagType) *Spec {
- subject := leafnodes.NewItNode(text, func() {}, flag, codelocation.New(0), 0, nil, 0)
- return New(subject, []*containernode.ContainerNode{}, false)
- }
-
- newMeasureSpec := func(text string, flag types.FlagType) *Spec {
- subject := leafnodes.NewMeasureNode(text, func(Benchmarker) {}, flag, codelocation.New(0), 0, nil, 0)
- return New(subject, []*containernode.ContainerNode{}, false)
- }
-
- newSpecs := func(args ...interface{}) *Specs {
- specs := []*Spec{}
- for index := 0; index < len(args)-1; index += 2 {
- specs = append(specs, newSpec(args[index].(string), args[index+1].(types.FlagType)))
- }
- return NewSpecs(specs)
- }
-
- specTexts := func(specs *Specs) []string {
- texts := []string{}
- for _, spec := range specs.Specs() {
- texts = append(texts, spec.ConcatenatedString())
- }
- return texts
- }
-
- willRunTexts := func(specs *Specs) []string {
- texts := []string{}
- for _, spec := range specs.Specs() {
- if !(spec.Skipped() || spec.Pending()) {
- texts = append(texts, spec.ConcatenatedString())
- }
- }
- return texts
- }
-
- skippedTexts := func(specs *Specs) []string {
- texts := []string{}
- for _, spec := range specs.Specs() {
- if spec.Skipped() {
- texts = append(texts, spec.ConcatenatedString())
- }
- }
- return texts
- }
-
- pendingTexts := func(specs *Specs) []string {
- texts := []string{}
- for _, spec := range specs.Specs() {
- if spec.Pending() {
- texts = append(texts, spec.ConcatenatedString())
- }
- }
- return texts
- }
-
- Describe("Shuffling specs", func() {
- It("should shuffle the specs using the passed in randomizer", func() {
- specs17 := newSpecs("C", noneFlag, "A", noneFlag, "B", noneFlag)
- specs17.Shuffle(rand.New(rand.NewSource(17)))
- texts17 := specTexts(specs17)
-
- specs17Again := newSpecs("C", noneFlag, "A", noneFlag, "B", noneFlag)
- specs17Again.Shuffle(rand.New(rand.NewSource(17)))
- texts17Again := specTexts(specs17Again)
-
- specs15 := newSpecs("C", noneFlag, "A", noneFlag, "B", noneFlag)
- specs15.Shuffle(rand.New(rand.NewSource(15)))
- texts15 := specTexts(specs15)
-
- specsUnshuffled := newSpecs("C", noneFlag, "A", noneFlag, "B", noneFlag)
- textsUnshuffled := specTexts(specsUnshuffled)
-
- Ω(textsUnshuffled).Should(Equal([]string{"C", "A", "B"}))
-
- Ω(texts17).Should(Equal(texts17Again))
- Ω(texts17).ShouldNot(Equal(texts15))
- Ω(texts17).ShouldNot(Equal(textsUnshuffled))
- Ω(texts15).ShouldNot(Equal(textsUnshuffled))
-
- Ω(texts17).Should(HaveLen(3))
- Ω(texts17).Should(ContainElement("A"))
- Ω(texts17).Should(ContainElement("B"))
- Ω(texts17).Should(ContainElement("C"))
-
- Ω(texts15).Should(HaveLen(3))
- Ω(texts15).Should(ContainElement("A"))
- Ω(texts15).Should(ContainElement("B"))
- Ω(texts15).Should(ContainElement("C"))
- })
- })
-
- Describe("with no programmatic focus", func() {
- BeforeEach(func() {
- specs = newSpecs("A1", noneFlag, "A2", noneFlag, "B1", noneFlag, "B2", pendingFlag)
- specs.ApplyFocus("", "", "")
- })
-
- It("should not report as having programmatic specs", func() {
- Ω(specs.HasProgrammaticFocus()).Should(BeFalse())
- })
- })
-
- Describe("Applying focus/skip", func() {
- var description, focusString, skipString string
-
- BeforeEach(func() {
- description, focusString, skipString = "", "", ""
- })
-
- JustBeforeEach(func() {
- specs = newSpecs("A1", focusedFlag, "A2", noneFlag, "B1", focusedFlag, "B2", pendingFlag)
- specs.ApplyFocus(description, focusString, skipString)
- })
-
- Context("with neither a focus string nor a skip string", func() {
- It("should apply the programmatic focus", func() {
- Ω(willRunTexts(specs)).Should(Equal([]string{"A1", "B1"}))
- Ω(skippedTexts(specs)).Should(Equal([]string{"A2", "B2"}))
- Ω(pendingTexts(specs)).Should(BeEmpty())
- })
-
- It("should report as having programmatic specs", func() {
- Ω(specs.HasProgrammaticFocus()).Should(BeTrue())
- })
- })
-
- Context("with a focus regexp", func() {
- BeforeEach(func() {
- focusString = "A"
- })
-
- It("should override the programmatic focus", func() {
- Ω(willRunTexts(specs)).Should(Equal([]string{"A1", "A2"}))
- Ω(skippedTexts(specs)).Should(Equal([]string{"B1", "B2"}))
- Ω(pendingTexts(specs)).Should(BeEmpty())
- })
-
- It("should not report as having programmatic specs", func() {
- Ω(specs.HasProgrammaticFocus()).Should(BeFalse())
- })
- })
-
- Context("with a focus regexp", func() {
- BeforeEach(func() {
- focusString = "B"
- })
-
- It("should not override any pendings", func() {
- Ω(willRunTexts(specs)).Should(Equal([]string{"B1"}))
- Ω(skippedTexts(specs)).Should(Equal([]string{"A1", "A2"}))
- Ω(pendingTexts(specs)).Should(Equal([]string{"B2"}))
- })
- })
-
- Context("with a description", func() {
- BeforeEach(func() {
- description = "C"
- focusString = "C"
- })
-
- It("should include the description in the focus determination", func() {
- Ω(willRunTexts(specs)).Should(Equal([]string{"A1", "A2", "B1"}))
- Ω(skippedTexts(specs)).Should(BeEmpty())
- Ω(pendingTexts(specs)).Should(Equal([]string{"B2"}))
- })
- })
-
- Context("with a description", func() {
- BeforeEach(func() {
- description = "C"
- skipString = "C"
- })
-
- It("should include the description in the focus determination", func() {
- Ω(willRunTexts(specs)).Should(BeEmpty())
- Ω(skippedTexts(specs)).Should(Equal([]string{"A1", "A2", "B1", "B2"}))
- Ω(pendingTexts(specs)).Should(BeEmpty())
- })
- })
-
- Context("with a skip regexp", func() {
- BeforeEach(func() {
- skipString = "A"
- })
-
- It("should override the programmatic focus", func() {
- Ω(willRunTexts(specs)).Should(Equal([]string{"B1"}))
- Ω(skippedTexts(specs)).Should(Equal([]string{"A1", "A2"}))
- Ω(pendingTexts(specs)).Should(Equal([]string{"B2"}))
- })
-
- It("should not report as having programmatic specs", func() {
- Ω(specs.HasProgrammaticFocus()).Should(BeFalse())
- })
- })
-
- Context("with both a focus and a skip regexp", func() {
- BeforeEach(func() {
- focusString = "1"
- skipString = "B"
- })
-
- It("should AND the two", func() {
- Ω(willRunTexts(specs)).Should(Equal([]string{"A1"}))
- Ω(skippedTexts(specs)).Should(Equal([]string{"A2", "B1", "B2"}))
- Ω(pendingTexts(specs)).Should(BeEmpty())
- })
-
- It("should not report as having programmatic specs", func() {
- Ω(specs.HasProgrammaticFocus()).Should(BeFalse())
- })
- })
- })
-
- Describe("With a focused spec within a pending context and a pending spec within a focused context", func() {
- BeforeEach(func() {
- pendingInFocused := New(
- leafnodes.NewItNode("PendingInFocused", func() {}, pendingFlag, codelocation.New(0), 0, nil, 0),
- []*containernode.ContainerNode{
- containernode.New("", focusedFlag, codelocation.New(0)),
- }, false)
-
- focusedInPending := New(
- leafnodes.NewItNode("FocusedInPending", func() {}, focusedFlag, codelocation.New(0), 0, nil, 0),
- []*containernode.ContainerNode{
- containernode.New("", pendingFlag, codelocation.New(0)),
- }, false)
-
- specs = NewSpecs([]*Spec{
- newSpec("A", noneFlag),
- newSpec("B", noneFlag),
- pendingInFocused,
- focusedInPending,
- })
- specs.ApplyFocus("", "", "")
- })
-
- It("should not have a programmatic focus and should run all tests", func() {
- Ω(willRunTexts(specs)).Should(Equal([]string{"A", "B"}))
- Ω(skippedTexts(specs)).Should(BeEmpty())
- Ω(pendingTexts(specs)).Should(ConsistOf(ContainSubstring("PendingInFocused"), ContainSubstring("FocusedInPending")))
- })
- })
-
- Describe("skipping measurements", func() {
- BeforeEach(func() {
- specs = NewSpecs([]*Spec{
- newSpec("A", noneFlag),
- newSpec("B", noneFlag),
- newSpec("C", pendingFlag),
- newMeasureSpec("measurementA", noneFlag),
- newMeasureSpec("measurementB", pendingFlag),
- })
- })
-
- It("should skip measurements", func() {
- Ω(willRunTexts(specs)).Should(Equal([]string{"A", "B", "measurementA"}))
- Ω(skippedTexts(specs)).Should(BeEmpty())
- Ω(pendingTexts(specs)).Should(Equal([]string{"C", "measurementB"}))
-
- specs.SkipMeasurements()
-
- Ω(willRunTexts(specs)).Should(Equal([]string{"A", "B"}))
- Ω(skippedTexts(specs)).Should(Equal([]string{"measurementA", "measurementB"}))
- Ω(pendingTexts(specs)).Should(Equal([]string{"C"}))
- })
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/internal/spec_iterator/index_computer_test.go b/vendor/github.com/onsi/ginkgo/internal/spec_iterator/index_computer_test.go
deleted file mode 100644
index 65da9837c..000000000
--- a/vendor/github.com/onsi/ginkgo/internal/spec_iterator/index_computer_test.go
+++ /dev/null
@@ -1,149 +0,0 @@
-package spec_iterator_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/ginkgo/internal/spec_iterator"
- . "github.com/onsi/gomega"
-)
-
-var _ = Describe("ParallelizedIndexRange", func() {
- var startIndex, count int
-
- It("should return the correct index range for 4 tests on 2 nodes", func() {
- startIndex, count = ParallelizedIndexRange(4, 2, 1)
- Ω(startIndex).Should(Equal(0))
- Ω(count).Should(Equal(2))
-
- startIndex, count = ParallelizedIndexRange(4, 2, 2)
- Ω(startIndex).Should(Equal(2))
- Ω(count).Should(Equal(2))
- })
-
- It("should return the correct index range for 5 tests on 2 nodes", func() {
- startIndex, count = ParallelizedIndexRange(5, 2, 1)
- Ω(startIndex).Should(Equal(0))
- Ω(count).Should(Equal(3))
-
- startIndex, count = ParallelizedIndexRange(5, 2, 2)
- Ω(startIndex).Should(Equal(3))
- Ω(count).Should(Equal(2))
- })
-
- It("should return the correct index range for 5 tests on 3 nodes", func() {
- startIndex, count = ParallelizedIndexRange(5, 3, 1)
- Ω(startIndex).Should(Equal(0))
- Ω(count).Should(Equal(2))
-
- startIndex, count = ParallelizedIndexRange(5, 3, 2)
- Ω(startIndex).Should(Equal(2))
- Ω(count).Should(Equal(2))
-
- startIndex, count = ParallelizedIndexRange(5, 3, 3)
- Ω(startIndex).Should(Equal(4))
- Ω(count).Should(Equal(1))
- })
-
- It("should return the correct index range for 5 tests on 4 nodes", func() {
- startIndex, count = ParallelizedIndexRange(5, 4, 1)
- Ω(startIndex).Should(Equal(0))
- Ω(count).Should(Equal(2))
-
- startIndex, count = ParallelizedIndexRange(5, 4, 2)
- Ω(startIndex).Should(Equal(2))
- Ω(count).Should(Equal(1))
-
- startIndex, count = ParallelizedIndexRange(5, 4, 3)
- Ω(startIndex).Should(Equal(3))
- Ω(count).Should(Equal(1))
-
- startIndex, count = ParallelizedIndexRange(5, 4, 4)
- Ω(startIndex).Should(Equal(4))
- Ω(count).Should(Equal(1))
- })
-
- It("should return the correct index range for 5 tests on 5 nodes", func() {
- startIndex, count = ParallelizedIndexRange(5, 5, 1)
- Ω(startIndex).Should(Equal(0))
- Ω(count).Should(Equal(1))
-
- startIndex, count = ParallelizedIndexRange(5, 5, 2)
- Ω(startIndex).Should(Equal(1))
- Ω(count).Should(Equal(1))
-
- startIndex, count = ParallelizedIndexRange(5, 5, 3)
- Ω(startIndex).Should(Equal(2))
- Ω(count).Should(Equal(1))
-
- startIndex, count = ParallelizedIndexRange(5, 5, 4)
- Ω(startIndex).Should(Equal(3))
- Ω(count).Should(Equal(1))
-
- startIndex, count = ParallelizedIndexRange(5, 5, 5)
- Ω(startIndex).Should(Equal(4))
- Ω(count).Should(Equal(1))
- })
-
- It("should return the correct index range for 5 tests on 6 nodes", func() {
- startIndex, count = ParallelizedIndexRange(5, 6, 1)
- Ω(startIndex).Should(Equal(0))
- Ω(count).Should(Equal(1))
-
- startIndex, count = ParallelizedIndexRange(5, 6, 2)
- Ω(startIndex).Should(Equal(1))
- Ω(count).Should(Equal(1))
-
- startIndex, count = ParallelizedIndexRange(5, 6, 3)
- Ω(startIndex).Should(Equal(2))
- Ω(count).Should(Equal(1))
-
- startIndex, count = ParallelizedIndexRange(5, 6, 4)
- Ω(startIndex).Should(Equal(3))
- Ω(count).Should(Equal(1))
-
- startIndex, count = ParallelizedIndexRange(5, 6, 5)
- Ω(startIndex).Should(Equal(4))
- Ω(count).Should(Equal(1))
-
- startIndex, count = ParallelizedIndexRange(5, 6, 6)
- Ω(count).Should(Equal(0))
- })
-
- It("should return the correct index range for 5 tests on 7 nodes", func() {
- startIndex, count = ParallelizedIndexRange(5, 7, 6)
- Ω(count).Should(Equal(0))
-
- startIndex, count = ParallelizedIndexRange(5, 7, 7)
- Ω(count).Should(Equal(0))
- })
-
- It("should return the correct index range for 11 tests on 7 nodes", func() {
- startIndex, count = ParallelizedIndexRange(11, 7, 1)
- Ω(startIndex).Should(Equal(0))
- Ω(count).Should(Equal(2))
-
- startIndex, count = ParallelizedIndexRange(11, 7, 2)
- Ω(startIndex).Should(Equal(2))
- Ω(count).Should(Equal(2))
-
- startIndex, count = ParallelizedIndexRange(11, 7, 3)
- Ω(startIndex).Should(Equal(4))
- Ω(count).Should(Equal(2))
-
- startIndex, count = ParallelizedIndexRange(11, 7, 4)
- Ω(startIndex).Should(Equal(6))
- Ω(count).Should(Equal(2))
-
- startIndex, count = ParallelizedIndexRange(11, 7, 5)
- Ω(startIndex).Should(Equal(8))
- Ω(count).Should(Equal(1))
-
- startIndex, count = ParallelizedIndexRange(11, 7, 6)
- Ω(startIndex).Should(Equal(9))
- Ω(count).Should(Equal(1))
-
- startIndex, count = ParallelizedIndexRange(11, 7, 7)
- Ω(startIndex).Should(Equal(10))
- Ω(count).Should(Equal(1))
- })
-
-})
diff --git a/vendor/github.com/onsi/ginkgo/internal/spec_iterator/parallel_spec_iterator_test.go b/vendor/github.com/onsi/ginkgo/internal/spec_iterator/parallel_spec_iterator_test.go
deleted file mode 100644
index c5a762fd5..000000000
--- a/vendor/github.com/onsi/ginkgo/internal/spec_iterator/parallel_spec_iterator_test.go
+++ /dev/null
@@ -1,112 +0,0 @@
-package spec_iterator_test
-
-import (
- "net/http"
-
- . "github.com/onsi/ginkgo/internal/spec_iterator"
- "github.com/onsi/gomega/ghttp"
-
- "github.com/onsi/ginkgo/internal/codelocation"
- "github.com/onsi/ginkgo/internal/containernode"
- "github.com/onsi/ginkgo/internal/leafnodes"
- "github.com/onsi/ginkgo/internal/spec"
- "github.com/onsi/ginkgo/types"
-
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-)
-
-var _ = Describe("ParallelSpecIterator", func() {
- var specs []*spec.Spec
- var iterator *ParallelIterator
- var server *ghttp.Server
-
- newSpec := func(text string, flag types.FlagType) *spec.Spec {
- subject := leafnodes.NewItNode(text, func() {}, flag, codelocation.New(0), 0, nil, 0)
- return spec.New(subject, []*containernode.ContainerNode{}, false)
- }
-
- BeforeEach(func() {
- specs = []*spec.Spec{
- newSpec("A", types.FlagTypePending),
- newSpec("B", types.FlagTypeNone),
- newSpec("C", types.FlagTypeNone),
- newSpec("D", types.FlagTypeNone),
- }
- specs[3].Skip()
-
- server = ghttp.NewServer()
-
- iterator = NewParallelIterator(specs, "http://"+server.Addr())
- })
-
- AfterEach(func() {
- server.Close()
- })
-
- It("should report the total number of specs", func() {
- Ω(iterator.NumberOfSpecsPriorToIteration()).Should(Equal(4))
- })
-
- It("should not report the number to be processed", func() {
- n, known := iterator.NumberOfSpecsToProcessIfKnown()
- Ω(n).Should(Equal(-1))
- Ω(known).Should(BeFalse())
- })
-
- It("should not report the number that will be run", func() {
- n, known := iterator.NumberOfSpecsThatWillBeRunIfKnown()
- Ω(n).Should(Equal(-1))
- Ω(known).Should(BeFalse())
- })
-
- Describe("iterating", func() {
- Describe("when the server returns well-formed responses", func() {
- BeforeEach(func() {
- server.AppendHandlers(
- ghttp.RespondWithJSONEncoded(http.StatusOK, Counter{Index: 0}),
- ghttp.RespondWithJSONEncoded(http.StatusOK, Counter{Index: 1}),
- ghttp.RespondWithJSONEncoded(http.StatusOK, Counter{Index: 3}),
- ghttp.RespondWithJSONEncoded(http.StatusOK, Counter{Index: 4}),
- )
- })
-
- It("should return the specs in question", func() {
- Ω(iterator.Next()).Should(Equal(specs[0]))
- Ω(iterator.Next()).Should(Equal(specs[1]))
- Ω(iterator.Next()).Should(Equal(specs[3]))
- spec, err := iterator.Next()
- Ω(spec).Should(BeNil())
- Ω(err).Should(MatchError(ErrClosed))
- })
- })
-
- Describe("when the server 404s", func() {
- BeforeEach(func() {
- server.AppendHandlers(
- ghttp.RespondWith(http.StatusNotFound, ""),
- )
- })
-
- It("should return an error", func() {
- spec, err := iterator.Next()
- Ω(spec).Should(BeNil())
- Ω(err).Should(MatchError("unexpected status code 404"))
- })
- })
-
- Describe("when the server returns gibberish", func() {
- BeforeEach(func() {
- server.AppendHandlers(
- ghttp.RespondWith(http.StatusOK, "ß"),
- )
- })
-
- It("should error", func() {
- spec, err := iterator.Next()
- Ω(spec).Should(BeNil())
- Ω(err).ShouldNot(BeNil())
- })
- })
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/internal/spec_iterator/serial_spec_iterator_test.go b/vendor/github.com/onsi/ginkgo/internal/spec_iterator/serial_spec_iterator_test.go
deleted file mode 100644
index dde4a344e..000000000
--- a/vendor/github.com/onsi/ginkgo/internal/spec_iterator/serial_spec_iterator_test.go
+++ /dev/null
@@ -1,64 +0,0 @@
-package spec_iterator_test
-
-import (
- . "github.com/onsi/ginkgo/internal/spec_iterator"
-
- "github.com/onsi/ginkgo/internal/codelocation"
- "github.com/onsi/ginkgo/internal/containernode"
- "github.com/onsi/ginkgo/internal/leafnodes"
- "github.com/onsi/ginkgo/internal/spec"
- "github.com/onsi/ginkgo/types"
-
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-)
-
-var _ = Describe("SerialSpecIterator", func() {
- var specs []*spec.Spec
- var iterator *SerialIterator
-
- newSpec := func(text string, flag types.FlagType) *spec.Spec {
- subject := leafnodes.NewItNode(text, func() {}, flag, codelocation.New(0), 0, nil, 0)
- return spec.New(subject, []*containernode.ContainerNode{}, false)
- }
-
- BeforeEach(func() {
- specs = []*spec.Spec{
- newSpec("A", types.FlagTypePending),
- newSpec("B", types.FlagTypeNone),
- newSpec("C", types.FlagTypeNone),
- newSpec("D", types.FlagTypeNone),
- }
- specs[3].Skip()
-
- iterator = NewSerialIterator(specs)
- })
-
- It("should report the total number of specs", func() {
- Ω(iterator.NumberOfSpecsPriorToIteration()).Should(Equal(4))
- })
-
- It("should report the number to be processed", func() {
- n, known := iterator.NumberOfSpecsToProcessIfKnown()
- Ω(n).Should(Equal(4))
- Ω(known).Should(BeTrue())
- })
-
- It("should report the number that will be run", func() {
- n, known := iterator.NumberOfSpecsThatWillBeRunIfKnown()
- Ω(n).Should(Equal(2))
- Ω(known).Should(BeTrue())
- })
-
- Describe("iterating", func() {
- It("should return the specs in order", func() {
- Ω(iterator.Next()).Should(Equal(specs[0]))
- Ω(iterator.Next()).Should(Equal(specs[1]))
- Ω(iterator.Next()).Should(Equal(specs[2]))
- Ω(iterator.Next()).Should(Equal(specs[3]))
- spec, err := iterator.Next()
- Ω(spec).Should(BeNil())
- Ω(err).Should(MatchError(ErrClosed))
- })
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/internal/spec_iterator/sharded_parallel_spec_iterator_test.go b/vendor/github.com/onsi/ginkgo/internal/spec_iterator/sharded_parallel_spec_iterator_test.go
deleted file mode 100644
index c3786e03a..000000000
--- a/vendor/github.com/onsi/ginkgo/internal/spec_iterator/sharded_parallel_spec_iterator_test.go
+++ /dev/null
@@ -1,62 +0,0 @@
-package spec_iterator_test
-
-import (
- . "github.com/onsi/ginkgo/internal/spec_iterator"
-
- "github.com/onsi/ginkgo/internal/codelocation"
- "github.com/onsi/ginkgo/internal/containernode"
- "github.com/onsi/ginkgo/internal/leafnodes"
- "github.com/onsi/ginkgo/internal/spec"
- "github.com/onsi/ginkgo/types"
-
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-)
-
-var _ = Describe("ShardedParallelSpecIterator", func() {
- var specs []*spec.Spec
- var iterator *ShardedParallelIterator
-
- newSpec := func(text string, flag types.FlagType) *spec.Spec {
- subject := leafnodes.NewItNode(text, func() {}, flag, codelocation.New(0), 0, nil, 0)
- return spec.New(subject, []*containernode.ContainerNode{}, false)
- }
-
- BeforeEach(func() {
- specs = []*spec.Spec{
- newSpec("A", types.FlagTypePending),
- newSpec("B", types.FlagTypeNone),
- newSpec("C", types.FlagTypeNone),
- newSpec("D", types.FlagTypeNone),
- }
- specs[3].Skip()
-
- iterator = NewShardedParallelIterator(specs, 2, 1)
- })
-
- It("should report the total number of specs", func() {
- Ω(iterator.NumberOfSpecsPriorToIteration()).Should(Equal(4))
- })
-
- It("should report the number to be processed", func() {
- n, known := iterator.NumberOfSpecsToProcessIfKnown()
- Ω(n).Should(Equal(2))
- Ω(known).Should(BeTrue())
- })
-
- It("should report the number that will be run", func() {
- n, known := iterator.NumberOfSpecsThatWillBeRunIfKnown()
- Ω(n).Should(Equal(1))
- Ω(known).Should(BeTrue())
- })
-
- Describe("iterating", func() {
- It("should return the specs in order", func() {
- Ω(iterator.Next()).Should(Equal(specs[0]))
- Ω(iterator.Next()).Should(Equal(specs[1]))
- spec, err := iterator.Next()
- Ω(spec).Should(BeNil())
- Ω(err).Should(MatchError(ErrClosed))
- })
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/internal/spec_iterator/spec_iterator_suite_test.go b/vendor/github.com/onsi/ginkgo/internal/spec_iterator/spec_iterator_suite_test.go
deleted file mode 100644
index 5c08a77e3..000000000
--- a/vendor/github.com/onsi/ginkgo/internal/spec_iterator/spec_iterator_suite_test.go
+++ /dev/null
@@ -1,13 +0,0 @@
-package spec_iterator_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-
- "testing"
-)
-
-func TestSpecIterator(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "SpecIterator Suite")
-}
diff --git a/vendor/github.com/onsi/ginkgo/internal/specrunner/spec_runner_suite_test.go b/vendor/github.com/onsi/ginkgo/internal/specrunner/spec_runner_suite_test.go
deleted file mode 100644
index c8388fb6f..000000000
--- a/vendor/github.com/onsi/ginkgo/internal/specrunner/spec_runner_suite_test.go
+++ /dev/null
@@ -1,13 +0,0 @@
-package specrunner_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-
- "testing"
-)
-
-func TestSpecRunner(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "Spec Runner Suite")
-}
diff --git a/vendor/github.com/onsi/ginkgo/internal/specrunner/spec_runner_test.go b/vendor/github.com/onsi/ginkgo/internal/specrunner/spec_runner_test.go
deleted file mode 100644
index a41437922..000000000
--- a/vendor/github.com/onsi/ginkgo/internal/specrunner/spec_runner_test.go
+++ /dev/null
@@ -1,785 +0,0 @@
-package specrunner_test
-
-import (
- . "github.com/onsi/ginkgo"
- "github.com/onsi/ginkgo/internal/spec_iterator"
- . "github.com/onsi/ginkgo/internal/specrunner"
- "github.com/onsi/ginkgo/types"
- . "github.com/onsi/gomega"
-
- "github.com/onsi/ginkgo/config"
- "github.com/onsi/ginkgo/internal/codelocation"
- "github.com/onsi/ginkgo/internal/containernode"
- Failer "github.com/onsi/ginkgo/internal/failer"
- "github.com/onsi/ginkgo/internal/leafnodes"
- "github.com/onsi/ginkgo/internal/spec"
- Writer "github.com/onsi/ginkgo/internal/writer"
- "github.com/onsi/ginkgo/reporters"
-)
-
-var noneFlag = types.FlagTypeNone
-var pendingFlag = types.FlagTypePending
-
-var _ = Describe("Spec Runner", func() {
- var (
- reporter1 *reporters.FakeReporter
- reporter2 *reporters.FakeReporter
- failer *Failer.Failer
- writer *Writer.FakeGinkgoWriter
-
- thingsThatRan []string
-
- runner *SpecRunner
- )
-
- newBefSuite := func(text string, fail bool) leafnodes.SuiteNode {
- return leafnodes.NewBeforeSuiteNode(func() {
- writer.AddEvent(text)
- thingsThatRan = append(thingsThatRan, text)
- if fail {
- failer.Fail(text, codelocation.New(0))
- }
- }, codelocation.New(0), 0, failer)
- }
-
- newAftSuite := func(text string, fail bool) leafnodes.SuiteNode {
- return leafnodes.NewAfterSuiteNode(func() {
- writer.AddEvent(text)
- thingsThatRan = append(thingsThatRan, text)
- if fail {
- failer.Fail(text, codelocation.New(0))
- }
- }, codelocation.New(0), 0, failer)
- }
-
- newSpec := func(text string, flag types.FlagType, fail bool) *spec.Spec {
- subject := leafnodes.NewItNode(text, func() {
- writer.AddEvent(text)
- thingsThatRan = append(thingsThatRan, text)
- if fail {
- failer.Fail(text, codelocation.New(0))
- }
- }, flag, codelocation.New(0), 0, failer, 0)
-
- return spec.New(subject, []*containernode.ContainerNode{}, false)
- }
-
- newFlakySpec := func(text string, flag types.FlagType, failures int) *spec.Spec {
- runs := 0
- subject := leafnodes.NewItNode(text, func() {
- writer.AddEvent(text)
- thingsThatRan = append(thingsThatRan, text)
- runs++
- if runs < failures {
- failer.Fail(text, codelocation.New(0))
- }
- }, flag, codelocation.New(0), 0, failer, 0)
-
- return spec.New(subject, []*containernode.ContainerNode{}, false)
- }
-
- newSpecWithBody := func(text string, body interface{}) *spec.Spec {
- subject := leafnodes.NewItNode(text, body, noneFlag, codelocation.New(0), 0, failer, 0)
-
- return spec.New(subject, []*containernode.ContainerNode{}, false)
- }
-
- newRunner := func(config config.GinkgoConfigType, beforeSuiteNode leafnodes.SuiteNode, afterSuiteNode leafnodes.SuiteNode, specs ...*spec.Spec) *SpecRunner {
- iterator := spec_iterator.NewSerialIterator(specs)
- return New("description", beforeSuiteNode, iterator, afterSuiteNode, []reporters.Reporter{reporter1, reporter2}, writer, config)
- }
-
- BeforeEach(func() {
- reporter1 = reporters.NewFakeReporter()
- reporter2 = reporters.NewFakeReporter()
- writer = Writer.NewFake()
- failer = Failer.New()
-
- thingsThatRan = []string{}
- })
-
- Describe("Running and Reporting", func() {
- var specA, pendingSpec, anotherPendingSpec, failedSpec, specB, skippedSpec *spec.Spec
- var willRunCalls, didCompleteCalls []string
- var conf config.GinkgoConfigType
-
- JustBeforeEach(func() {
- willRunCalls = []string{}
- didCompleteCalls = []string{}
- specA = newSpec("spec A", noneFlag, false)
- pendingSpec = newSpec("pending spec", pendingFlag, false)
- anotherPendingSpec = newSpec("another pending spec", pendingFlag, false)
- failedSpec = newSpec("failed spec", noneFlag, true)
- specB = newSpec("spec B", noneFlag, false)
- skippedSpec = newSpec("skipped spec", noneFlag, false)
- skippedSpec.Skip()
-
- reporter1.SpecWillRunStub = func(specSummary *types.SpecSummary) {
- willRunCalls = append(willRunCalls, "Reporter1")
- }
- reporter2.SpecWillRunStub = func(specSummary *types.SpecSummary) {
- willRunCalls = append(willRunCalls, "Reporter2")
- }
-
- reporter1.SpecDidCompleteStub = func(specSummary *types.SpecSummary) {
- didCompleteCalls = append(didCompleteCalls, "Reporter1")
- }
- reporter2.SpecDidCompleteStub = func(specSummary *types.SpecSummary) {
- didCompleteCalls = append(didCompleteCalls, "Reporter2")
- }
-
- runner = newRunner(conf, newBefSuite("BefSuite", false), newAftSuite("AftSuite", false), specA, pendingSpec, anotherPendingSpec, failedSpec, specB, skippedSpec)
- runner.Run()
- })
-
- BeforeEach(func() {
- conf = config.GinkgoConfigType{RandomSeed: 17}
- })
-
- It("should skip skipped/pending tests", func() {
- Ω(thingsThatRan).Should(Equal([]string{"BefSuite", "spec A", "failed spec", "spec B", "AftSuite"}))
- })
-
- It("should report to any attached reporters", func() {
- Ω(reporter1.Config).Should(Equal(reporter2.Config))
- Ω(reporter1.BeforeSuiteSummary).Should(Equal(reporter2.BeforeSuiteSummary))
- Ω(reporter1.BeginSummary).Should(Equal(reporter2.BeginSummary))
- Ω(reporter1.SpecWillRunSummaries).Should(Equal(reporter2.SpecWillRunSummaries))
- Ω(reporter1.SpecSummaries).Should(Equal(reporter2.SpecSummaries))
- Ω(reporter1.AfterSuiteSummary).Should(Equal(reporter2.AfterSuiteSummary))
- Ω(reporter1.EndSummary).Should(Equal(reporter2.EndSummary))
- })
-
- It("should report that a spec did end in reverse order", func() {
- Ω(willRunCalls[0:4]).Should(Equal([]string{"Reporter1", "Reporter2", "Reporter1", "Reporter2"}))
- Ω(didCompleteCalls[0:4]).Should(Equal([]string{"Reporter2", "Reporter1", "Reporter2", "Reporter1"}))
- })
-
- It("should report the passed in config", func() {
- Ω(reporter1.Config.RandomSeed).Should(BeNumerically("==", 17))
- })
-
- It("should report the beginning of the suite", func() {
- Ω(reporter1.BeginSummary.SuiteDescription).Should(Equal("description"))
- Ω(reporter1.BeginSummary.SuiteID).Should(MatchRegexp("[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}"))
- Ω(reporter1.BeginSummary.NumberOfSpecsBeforeParallelization).Should(Equal(6))
- Ω(reporter1.BeginSummary.NumberOfTotalSpecs).Should(Equal(6))
- Ω(reporter1.BeginSummary.NumberOfSpecsThatWillBeRun).Should(Equal(3))
- Ω(reporter1.BeginSummary.NumberOfPendingSpecs).Should(Equal(-1))
- Ω(reporter1.BeginSummary.NumberOfSkippedSpecs).Should(Equal(-1))
- })
-
- It("should report the end of the suite", func() {
- Ω(reporter1.EndSummary.SuiteDescription).Should(Equal("description"))
- Ω(reporter1.EndSummary.SuiteSucceeded).Should(BeFalse())
- Ω(reporter1.EndSummary.SuiteID).Should(MatchRegexp("[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}"))
- Ω(reporter1.EndSummary.NumberOfSpecsBeforeParallelization).Should(Equal(6))
- Ω(reporter1.EndSummary.NumberOfTotalSpecs).Should(Equal(6))
- Ω(reporter1.EndSummary.NumberOfSpecsThatWillBeRun).Should(Equal(3))
- Ω(reporter1.EndSummary.NumberOfPendingSpecs).Should(Equal(2))
- Ω(reporter1.EndSummary.NumberOfSkippedSpecs).Should(Equal(1))
- Ω(reporter1.EndSummary.NumberOfPassedSpecs).Should(Equal(2))
- Ω(reporter1.EndSummary.NumberOfFailedSpecs).Should(Equal(1))
- })
-
- Context("when told to perform a dry run", func() {
- BeforeEach(func() {
- conf.DryRun = true
- })
-
- It("should report to the reporters", func() {
- Ω(reporter1.Config).Should(Equal(reporter2.Config))
- Ω(reporter1.BeforeSuiteSummary).Should(Equal(reporter2.BeforeSuiteSummary))
- Ω(reporter1.BeginSummary).Should(Equal(reporter2.BeginSummary))
- Ω(reporter1.SpecWillRunSummaries).Should(Equal(reporter2.SpecWillRunSummaries))
- Ω(reporter1.SpecSummaries).Should(Equal(reporter2.SpecSummaries))
- Ω(reporter1.AfterSuiteSummary).Should(Equal(reporter2.AfterSuiteSummary))
- Ω(reporter1.EndSummary).Should(Equal(reporter2.EndSummary))
- })
-
- It("should not actually run anything", func() {
- Ω(thingsThatRan).Should(BeEmpty())
- })
-
- It("report before and after suites as passed", func() {
- Ω(reporter1.BeforeSuiteSummary.State).Should(Equal(types.SpecStatePassed))
- Ω(reporter1.AfterSuiteSummary.State).Should(Equal(types.SpecStatePassed))
- })
-
- It("should report specs as passed", func() {
- summaries := reporter1.SpecSummaries
- Ω(summaries).Should(HaveLen(6))
- Ω(summaries[0].ComponentTexts).Should(ContainElement("spec A"))
- Ω(summaries[0].State).Should(Equal(types.SpecStatePassed))
- Ω(summaries[1].ComponentTexts).Should(ContainElement("pending spec"))
- Ω(summaries[1].State).Should(Equal(types.SpecStatePending))
- Ω(summaries[2].ComponentTexts).Should(ContainElement("another pending spec"))
- Ω(summaries[2].State).Should(Equal(types.SpecStatePending))
- Ω(summaries[3].ComponentTexts).Should(ContainElement("failed spec"))
- Ω(summaries[3].State).Should(Equal(types.SpecStatePassed))
- Ω(summaries[4].ComponentTexts).Should(ContainElement("spec B"))
- Ω(summaries[4].State).Should(Equal(types.SpecStatePassed))
- Ω(summaries[5].ComponentTexts).Should(ContainElement("skipped spec"))
- Ω(summaries[5].State).Should(Equal(types.SpecStateSkipped))
- })
-
- It("should report the end of the suite", func() {
- Ω(reporter1.EndSummary.SuiteDescription).Should(Equal("description"))
- Ω(reporter1.EndSummary.SuiteSucceeded).Should(BeTrue())
- Ω(reporter1.EndSummary.SuiteID).Should(MatchRegexp("[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}"))
- Ω(reporter1.EndSummary.NumberOfSpecsBeforeParallelization).Should(Equal(6))
- Ω(reporter1.EndSummary.NumberOfTotalSpecs).Should(Equal(6))
- Ω(reporter1.EndSummary.NumberOfSpecsThatWillBeRun).Should(Equal(3))
- Ω(reporter1.EndSummary.NumberOfPendingSpecs).Should(Equal(2))
- Ω(reporter1.EndSummary.NumberOfSkippedSpecs).Should(Equal(1))
- Ω(reporter1.EndSummary.NumberOfPassedSpecs).Should(Equal(0))
- Ω(reporter1.EndSummary.NumberOfFailedSpecs).Should(Equal(0))
- })
-
- It("should not report a slow test", func() {
- summaries := reporter1.SpecSummaries
- for _, s := range summaries {
- Expect(s.RunTime).To(BeZero())
- }
- })
- })
- })
-
- Describe("reporting on specs", func() {
- var proceed chan bool
- var ready chan bool
- var finished chan bool
- BeforeEach(func() {
- ready = make(chan bool)
- proceed = make(chan bool)
- finished = make(chan bool)
- skippedSpec := newSpec("SKIP", noneFlag, false)
- skippedSpec.Skip()
-
- runner = newRunner(
- config.GinkgoConfigType{},
- newBefSuite("BefSuite", false),
- newAftSuite("AftSuite", false),
- skippedSpec,
- newSpec("PENDING", pendingFlag, false),
- newSpecWithBody("RUN", func() {
- close(ready)
- <-proceed
- }),
- )
- go func() {
- runner.Run()
- close(finished)
- }()
- })
-
- It("should report about pending/skipped specs", func() {
- <-ready
- Ω(reporter1.SpecWillRunSummaries).Should(HaveLen(3))
-
- Ω(reporter1.SpecWillRunSummaries[0].ComponentTexts[0]).Should(Equal("SKIP"))
- Ω(reporter1.SpecWillRunSummaries[1].ComponentTexts[0]).Should(Equal("PENDING"))
- Ω(reporter1.SpecWillRunSummaries[2].ComponentTexts[0]).Should(Equal("RUN"))
-
- Ω(reporter1.SpecSummaries[0].ComponentTexts[0]).Should(Equal("SKIP"))
- Ω(reporter1.SpecSummaries[1].ComponentTexts[0]).Should(Equal("PENDING"))
- Ω(reporter1.SpecSummaries).Should(HaveLen(2))
-
- close(proceed)
- <-finished
-
- Ω(reporter1.SpecSummaries).Should(HaveLen(3))
- Ω(reporter1.SpecSummaries[2].ComponentTexts[0]).Should(Equal("RUN"))
- })
- })
-
- Describe("Running and Reporting when there's flakes", func() {
- var specA, pendingSpec, flakySpec, failedSpec, specB, skippedSpec *spec.Spec
- var willRunCalls, didCompleteCalls []string
- var conf config.GinkgoConfigType
- var failedSpecFlag = noneFlag
-
- JustBeforeEach(func() {
- willRunCalls = []string{}
- didCompleteCalls = []string{}
- specA = newSpec("spec A", noneFlag, false)
- pendingSpec = newSpec("pending spec", pendingFlag, false)
- flakySpec = newFlakySpec("flaky spec", noneFlag, 3)
- failedSpec = newSpec("failed spec", failedSpecFlag, true)
- specB = newSpec("spec B", noneFlag, false)
- skippedSpec = newSpec("skipped spec", noneFlag, false)
- skippedSpec.Skip()
-
- reporter1.SpecWillRunStub = func(specSummary *types.SpecSummary) {
- willRunCalls = append(willRunCalls, "Reporter1")
- }
- reporter2.SpecWillRunStub = func(specSummary *types.SpecSummary) {
- willRunCalls = append(willRunCalls, "Reporter2")
- }
-
- reporter1.SpecDidCompleteStub = func(specSummary *types.SpecSummary) {
- didCompleteCalls = append(didCompleteCalls, "Reporter1")
- }
- reporter2.SpecDidCompleteStub = func(specSummary *types.SpecSummary) {
- didCompleteCalls = append(didCompleteCalls, "Reporter2")
- }
-
- runner = newRunner(conf, newBefSuite("BefSuite", false), newAftSuite("AftSuite", false), specA, pendingSpec, flakySpec, failedSpec, specB, skippedSpec)
- runner.Run()
- })
-
- BeforeEach(func() {
- failedSpecFlag = noneFlag
- conf = config.GinkgoConfigType{
- RandomSeed: 17,
- FlakeAttempts: 5,
- }
- })
-
- It("should skip skipped/pending tests", func() {
- Ω(thingsThatRan).Should(Equal([]string{"BefSuite", "spec A", "flaky spec", "flaky spec", "flaky spec", "failed spec", "failed spec", "failed spec", "failed spec", "failed spec", "spec B", "AftSuite"}))
- })
-
- It("should report to any attached reporters", func() {
- Ω(reporter1.Config).Should(Equal(reporter2.Config))
- Ω(reporter1.BeforeSuiteSummary).Should(Equal(reporter2.BeforeSuiteSummary))
- Ω(reporter1.BeginSummary).Should(Equal(reporter2.BeginSummary))
- Ω(reporter1.SpecWillRunSummaries).Should(Equal(reporter2.SpecWillRunSummaries))
- Ω(reporter1.SpecSummaries).Should(Equal(reporter2.SpecSummaries))
- Ω(reporter1.AfterSuiteSummary).Should(Equal(reporter2.AfterSuiteSummary))
- Ω(reporter1.EndSummary).Should(Equal(reporter2.EndSummary))
- })
-
- It("should report that a spec did end in reverse order", func() {
- Ω(willRunCalls[0:4]).Should(Equal([]string{"Reporter1", "Reporter2", "Reporter1", "Reporter2"}))
- Ω(didCompleteCalls[0:4]).Should(Equal([]string{"Reporter2", "Reporter1", "Reporter2", "Reporter1"}))
- })
-
- It("should report the passed in config", func() {
- Ω(reporter1.Config.RandomSeed).Should(BeNumerically("==", 17))
- })
-
- It("should report the beginning of the suite", func() {
- Ω(reporter1.BeginSummary.SuiteDescription).Should(Equal("description"))
- Ω(reporter1.BeginSummary.SuiteID).Should(MatchRegexp("[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}"))
- Ω(reporter1.BeginSummary.NumberOfSpecsBeforeParallelization).Should(Equal(6))
- Ω(reporter1.BeginSummary.NumberOfTotalSpecs).Should(Equal(6))
- Ω(reporter1.BeginSummary.NumberOfSpecsThatWillBeRun).Should(Equal(4))
- Ω(reporter1.BeginSummary.NumberOfPendingSpecs).Should(Equal(-1))
- Ω(reporter1.BeginSummary.NumberOfSkippedSpecs).Should(Equal(-1))
- })
-
- It("should report the end of the suite", func() {
- Ω(reporter1.EndSummary.SuiteDescription).Should(Equal("description"))
- Ω(reporter1.EndSummary.SuiteSucceeded).Should(BeFalse())
- Ω(reporter1.EndSummary.SuiteID).Should(MatchRegexp("[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}"))
- Ω(reporter1.EndSummary.NumberOfSpecsBeforeParallelization).Should(Equal(6))
- Ω(reporter1.EndSummary.NumberOfTotalSpecs).Should(Equal(6))
- Ω(reporter1.EndSummary.NumberOfSpecsThatWillBeRun).Should(Equal(4))
- Ω(reporter1.EndSummary.NumberOfPendingSpecs).Should(Equal(1))
- Ω(reporter1.EndSummary.NumberOfSkippedSpecs).Should(Equal(1))
- Ω(reporter1.EndSummary.NumberOfPassedSpecs).Should(Equal(3))
- Ω(reporter1.EndSummary.NumberOfFailedSpecs).Should(Equal(1))
- Ω(reporter1.EndSummary.NumberOfFlakedSpecs).Should(Equal(1))
- })
-
- Context("when nothing fails", func() {
- BeforeEach(func() {
- failedSpecFlag = pendingFlag
- })
-
- It("the suite should pass even with flakes", func() {
- Ω(reporter1.EndSummary.SuiteSucceeded).Should(BeTrue())
- Ω(reporter1.EndSummary.NumberOfFlakedSpecs).Should(Equal(1))
- })
- })
-
- Context("when told to perform a dry run", func() {
- BeforeEach(func() {
- conf.DryRun = true
- })
-
- It("should report to the reporters", func() {
- Ω(reporter1.Config).Should(Equal(reporter2.Config))
- Ω(reporter1.BeforeSuiteSummary).Should(Equal(reporter2.BeforeSuiteSummary))
- Ω(reporter1.BeginSummary).Should(Equal(reporter2.BeginSummary))
- Ω(reporter1.SpecWillRunSummaries).Should(Equal(reporter2.SpecWillRunSummaries))
- Ω(reporter1.SpecSummaries).Should(Equal(reporter2.SpecSummaries))
- Ω(reporter1.AfterSuiteSummary).Should(Equal(reporter2.AfterSuiteSummary))
- Ω(reporter1.EndSummary).Should(Equal(reporter2.EndSummary))
- })
-
- It("should not actually run anything", func() {
- Ω(thingsThatRan).Should(BeEmpty())
- })
-
- It("report before and after suites as passed", func() {
- Ω(reporter1.BeforeSuiteSummary.State).Should(Equal(types.SpecStatePassed))
- Ω(reporter1.AfterSuiteSummary.State).Should(Equal(types.SpecStatePassed))
- })
-
- It("should report specs as passed", func() {
- summaries := reporter1.SpecSummaries
- Ω(summaries).Should(HaveLen(6))
- Ω(summaries[0].ComponentTexts).Should(ContainElement("spec A"))
- Ω(summaries[0].State).Should(Equal(types.SpecStatePassed))
- Ω(summaries[1].ComponentTexts).Should(ContainElement("pending spec"))
- Ω(summaries[1].State).Should(Equal(types.SpecStatePending))
- Ω(summaries[2].ComponentTexts).Should(ContainElement("flaky spec"))
- Ω(summaries[2].State).Should(Equal(types.SpecStatePassed))
- Ω(summaries[3].ComponentTexts).Should(ContainElement("failed spec"))
- Ω(summaries[3].State).Should(Equal(types.SpecStatePassed))
- Ω(summaries[4].ComponentTexts).Should(ContainElement("spec B"))
- Ω(summaries[4].State).Should(Equal(types.SpecStatePassed))
- Ω(summaries[5].ComponentTexts).Should(ContainElement("skipped spec"))
- Ω(summaries[5].State).Should(Equal(types.SpecStateSkipped))
- })
-
- It("should report the end of the suite", func() {
- Ω(reporter1.EndSummary.SuiteDescription).Should(Equal("description"))
- Ω(reporter1.EndSummary.SuiteSucceeded).Should(BeTrue())
- Ω(reporter1.EndSummary.SuiteID).Should(MatchRegexp("[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}"))
- Ω(reporter1.EndSummary.NumberOfSpecsBeforeParallelization).Should(Equal(6))
- Ω(reporter1.EndSummary.NumberOfTotalSpecs).Should(Equal(6))
- Ω(reporter1.EndSummary.NumberOfSpecsThatWillBeRun).Should(Equal(4))
- Ω(reporter1.EndSummary.NumberOfPendingSpecs).Should(Equal(1))
- Ω(reporter1.EndSummary.NumberOfSkippedSpecs).Should(Equal(1))
- Ω(reporter1.EndSummary.NumberOfPassedSpecs).Should(Equal(0))
- Ω(reporter1.EndSummary.NumberOfFailedSpecs).Should(Equal(0))
- })
- })
- })
-
- Describe("Running BeforeSuite & AfterSuite", func() {
- var success bool
- var befSuite leafnodes.SuiteNode
- var aftSuite leafnodes.SuiteNode
- Context("with a nil BeforeSuite & AfterSuite", func() {
- BeforeEach(func() {
- runner = newRunner(
- config.GinkgoConfigType{},
- nil,
- nil,
- newSpec("A", noneFlag, false),
- newSpec("B", noneFlag, false),
- )
- success = runner.Run()
- })
-
- It("should not report about the BeforeSuite", func() {
- Ω(reporter1.BeforeSuiteSummary).Should(BeNil())
- })
-
- It("should not report about the AfterSuite", func() {
- Ω(reporter1.AfterSuiteSummary).Should(BeNil())
- })
-
- It("should run the specs", func() {
- Ω(thingsThatRan).Should(Equal([]string{"A", "B"}))
- })
- })
-
- Context("when the BeforeSuite & AfterSuite pass", func() {
- BeforeEach(func() {
- befSuite = newBefSuite("BefSuite", false)
- aftSuite = newBefSuite("AftSuite", false)
- runner = newRunner(
- config.GinkgoConfigType{},
- befSuite,
- aftSuite,
- newSpec("A", noneFlag, false),
- newSpec("B", noneFlag, false),
- )
- success = runner.Run()
- })
-
- It("should run the BeforeSuite, the AfterSuite and the specs", func() {
- Ω(thingsThatRan).Should(Equal([]string{"BefSuite", "A", "B", "AftSuite"}))
- })
-
- It("should report about the BeforeSuite", func() {
- Ω(reporter1.BeforeSuiteSummary).Should(Equal(befSuite.Summary()))
- })
-
- It("should report about the AfterSuite", func() {
- Ω(reporter1.AfterSuiteSummary).Should(Equal(aftSuite.Summary()))
- })
-
- It("should report success", func() {
- Ω(success).Should(BeTrue())
- Ω(reporter1.EndSummary.SuiteSucceeded).Should(BeTrue())
- Ω(reporter1.EndSummary.NumberOfFailedSpecs).Should(Equal(0))
- })
-
- It("should not dump the writer", func() {
- Ω(writer.EventStream).ShouldNot(ContainElement("DUMP"))
- })
- })
-
- Context("when the BeforeSuite fails", func() {
- BeforeEach(func() {
- befSuite = newBefSuite("BefSuite", true)
- aftSuite = newBefSuite("AftSuite", false)
-
- skipped := newSpec("Skipped", noneFlag, false)
- skipped.Skip()
-
- runner = newRunner(
- config.GinkgoConfigType{},
- befSuite,
- aftSuite,
- newSpec("A", noneFlag, false),
- newSpec("B", noneFlag, false),
- newSpec("Pending", pendingFlag, false),
- skipped,
- )
- success = runner.Run()
- })
-
- It("should not run the specs, but it should run the AfterSuite", func() {
- Ω(thingsThatRan).Should(Equal([]string{"BefSuite", "AftSuite"}))
- })
-
- It("should report about the BeforeSuite", func() {
- Ω(reporter1.BeforeSuiteSummary).Should(Equal(befSuite.Summary()))
- })
-
- It("should report about the AfterSuite", func() {
- Ω(reporter1.AfterSuiteSummary).Should(Equal(aftSuite.Summary()))
- })
-
- It("should report failure", func() {
- Ω(success).Should(BeFalse())
- Ω(reporter1.EndSummary.SuiteSucceeded).Should(BeFalse())
- Ω(reporter1.EndSummary.NumberOfFailedSpecs).Should(Equal(2))
- Ω(reporter1.EndSummary.NumberOfSpecsThatWillBeRun).Should(Equal(2))
- })
-
- It("should dump the writer", func() {
- Ω(writer.EventStream).Should(ContainElement("DUMP"))
- })
- })
-
- Context("when some other test fails", func() {
- BeforeEach(func() {
- aftSuite = newBefSuite("AftSuite", false)
-
- runner = newRunner(
- config.GinkgoConfigType{},
- nil,
- aftSuite,
- newSpec("A", noneFlag, true),
- )
- success = runner.Run()
- })
-
- It("should still run the AfterSuite", func() {
- Ω(thingsThatRan).Should(Equal([]string{"A", "AftSuite"}))
- })
-
- It("should report about the AfterSuite", func() {
- Ω(reporter1.AfterSuiteSummary).Should(Equal(aftSuite.Summary()))
- })
-
- It("should report failure", func() {
- Ω(success).Should(BeFalse())
- Ω(reporter1.EndSummary.SuiteSucceeded).Should(BeFalse())
- Ω(reporter1.EndSummary.NumberOfFailedSpecs).Should(Equal(1))
- Ω(reporter1.EndSummary.NumberOfSpecsThatWillBeRun).Should(Equal(1))
- })
- })
-
- Context("when the AfterSuite fails", func() {
- BeforeEach(func() {
- befSuite = newBefSuite("BefSuite", false)
- aftSuite = newBefSuite("AftSuite", true)
- runner = newRunner(
- config.GinkgoConfigType{},
- befSuite,
- aftSuite,
- newSpec("A", noneFlag, false),
- newSpec("B", noneFlag, false),
- )
- success = runner.Run()
- })
-
- It("should run everything", func() {
- Ω(thingsThatRan).Should(Equal([]string{"BefSuite", "A", "B", "AftSuite"}))
- })
-
- It("should report about the BeforeSuite", func() {
- Ω(reporter1.BeforeSuiteSummary).Should(Equal(befSuite.Summary()))
- })
-
- It("should report about the AfterSuite", func() {
- Ω(reporter1.AfterSuiteSummary).Should(Equal(aftSuite.Summary()))
- })
-
- It("should report failure", func() {
- Ω(success).Should(BeFalse())
- Ω(reporter1.EndSummary.SuiteSucceeded).Should(BeFalse())
- Ω(reporter1.EndSummary.NumberOfFailedSpecs).Should(Equal(0))
- })
-
- It("should dump the writer", func() {
- Ω(writer.EventStream).Should(ContainElement("DUMP"))
- })
- })
- })
-
- Describe("When instructed to fail fast", func() {
- BeforeEach(func() {
- conf := config.GinkgoConfigType{
- FailFast: true,
- }
- runner = newRunner(conf, nil, newAftSuite("after-suite", false), newSpec("passing", noneFlag, false), newSpec("failing", noneFlag, true), newSpec("dont-see", noneFlag, true), newSpec("dont-see", noneFlag, true))
- })
-
- It("should return false, report failure, and not run anything past the failing test", func() {
- Ω(runner.Run()).Should(BeFalse())
- Ω(reporter1.EndSummary.SuiteSucceeded).Should(BeFalse())
- Ω(thingsThatRan).Should(Equal([]string{"passing", "failing", "after-suite"}))
- })
-
- It("should announce the subsequent specs as skipped", func() {
- runner.Run()
- Ω(reporter1.SpecSummaries).Should(HaveLen(4))
- Ω(reporter1.SpecSummaries[2].State).Should(Equal(types.SpecStateSkipped))
- Ω(reporter1.SpecSummaries[3].State).Should(Equal(types.SpecStateSkipped))
- })
-
- It("should mark all subsequent specs as skipped", func() {
- runner.Run()
- Ω(reporter1.EndSummary.NumberOfSkippedSpecs).Should(Equal(2))
- })
- })
-
- Describe("Marking failure and success", func() {
- Context("when all tests pass", func() {
- BeforeEach(func() {
- runner = newRunner(config.GinkgoConfigType{}, nil, nil, newSpec("passing", noneFlag, false), newSpec("pending", pendingFlag, false))
- })
-
- It("should return true and report success", func() {
- Ω(runner.Run()).Should(BeTrue())
- Ω(reporter1.EndSummary.SuiteSucceeded).Should(BeTrue())
- })
- })
-
- Context("when a test fails", func() {
- BeforeEach(func() {
- runner = newRunner(config.GinkgoConfigType{}, nil, nil, newSpec("failing", noneFlag, true), newSpec("pending", pendingFlag, false))
- })
-
- It("should return false and report failure", func() {
- Ω(runner.Run()).Should(BeFalse())
- Ω(reporter1.EndSummary.SuiteSucceeded).Should(BeFalse())
- })
- })
-
- Context("when there is a pending test, but pendings count as failures", func() {
- BeforeEach(func() {
- runner = newRunner(config.GinkgoConfigType{FailOnPending: true}, nil, nil, newSpec("passing", noneFlag, false), newSpec("pending", pendingFlag, false))
- })
-
- It("should return false and report failure", func() {
- Ω(runner.Run()).Should(BeFalse())
- Ω(reporter1.EndSummary.SuiteSucceeded).Should(BeFalse())
- })
- })
- })
-
- Describe("Managing the writer", func() {
- BeforeEach(func() {
- runner = newRunner(
- config.GinkgoConfigType{},
- nil,
- nil,
- newSpec("A", noneFlag, false),
- newSpec("B", noneFlag, true),
- newSpec("C", noneFlag, false),
- )
- reporter1.SpecWillRunStub = func(specSummary *types.SpecSummary) {
- writer.AddEvent("R1.WillRun")
- }
- reporter2.SpecWillRunStub = func(specSummary *types.SpecSummary) {
- writer.AddEvent("R2.WillRun")
- }
- reporter1.SpecDidCompleteStub = func(specSummary *types.SpecSummary) {
- writer.AddEvent("R1.DidComplete")
- }
- reporter2.SpecDidCompleteStub = func(specSummary *types.SpecSummary) {
- writer.AddEvent("R2.DidComplete")
- }
- runner.Run()
- })
-
- It("should truncate between tests, but only dump if a test fails", func() {
- Ω(writer.EventStream).Should(Equal([]string{
- "TRUNCATE",
- "R1.WillRun",
- "R2.WillRun",
- "A",
- "R2.DidComplete",
- "R1.DidComplete",
- "TRUNCATE",
- "R1.WillRun",
- "R2.WillRun",
- "B",
- "BYTES",
- "R2.DidComplete",
- "DUMP",
- "R1.DidComplete",
- "TRUNCATE",
- "R1.WillRun",
- "R2.WillRun",
- "C",
- "R2.DidComplete",
- "R1.DidComplete",
- }))
- })
- })
-
- Describe("CurrentSpecSummary", func() {
- It("should return the spec summary for the currently running spec", func() {
- var summary *types.SpecSummary
- runner = newRunner(
- config.GinkgoConfigType{},
- nil,
- nil,
- newSpec("A", noneFlag, false),
- newSpecWithBody("B", func() {
- var ok bool
- summary, ok = runner.CurrentSpecSummary()
- Ω(ok).Should(BeTrue())
- }),
- newSpec("C", noneFlag, false),
- )
- runner.Run()
-
- Ω(summary.ComponentTexts).Should(Equal([]string{"B"}))
-
- summary, ok := runner.CurrentSpecSummary()
- Ω(summary).Should(BeNil())
- Ω(ok).Should(BeFalse())
- })
- })
-
- Describe("generating a suite id", func() {
- It("should generate an id randomly", func() {
- runnerA := newRunner(config.GinkgoConfigType{}, nil, nil)
- runnerA.Run()
- IDA := reporter1.BeginSummary.SuiteID
-
- runnerB := newRunner(config.GinkgoConfigType{}, nil, nil)
- runnerB.Run()
- IDB := reporter1.BeginSummary.SuiteID
-
- IDRegexp := "[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}"
- Ω(IDA).Should(MatchRegexp(IDRegexp))
- Ω(IDB).Should(MatchRegexp(IDRegexp))
-
- Ω(IDA).ShouldNot(Equal(IDB))
- })
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/internal/suite/suite_suite_test.go b/vendor/github.com/onsi/ginkgo/internal/suite/suite_suite_test.go
deleted file mode 100644
index 06fe1d12a..000000000
--- a/vendor/github.com/onsi/ginkgo/internal/suite/suite_suite_test.go
+++ /dev/null
@@ -1,35 +0,0 @@
-package suite_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-
- "testing"
-)
-
-func Test(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "Suite")
-}
-
-var numBeforeSuiteRuns = 0
-var numAfterSuiteRuns = 0
-
-var _ = BeforeSuite(func() {
- numBeforeSuiteRuns++
-})
-
-var _ = AfterSuite(func() {
- numAfterSuiteRuns++
- Ω(numBeforeSuiteRuns).Should(Equal(1))
- Ω(numAfterSuiteRuns).Should(Equal(1))
-})
-
-//Fakes
-type fakeTestingT struct {
- didFail bool
-}
-
-func (fakeT *fakeTestingT) Fail() {
- fakeT.didFail = true
-}
diff --git a/vendor/github.com/onsi/ginkgo/internal/suite/suite_test.go b/vendor/github.com/onsi/ginkgo/internal/suite/suite_test.go
deleted file mode 100644
index fd2d11dc3..000000000
--- a/vendor/github.com/onsi/ginkgo/internal/suite/suite_test.go
+++ /dev/null
@@ -1,385 +0,0 @@
-package suite_test
-
-import (
- "bytes"
-
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/ginkgo/internal/suite"
- . "github.com/onsi/gomega"
-
- "math/rand"
- "time"
-
- "github.com/onsi/ginkgo/config"
- "github.com/onsi/ginkgo/internal/codelocation"
- Failer "github.com/onsi/ginkgo/internal/failer"
- Writer "github.com/onsi/ginkgo/internal/writer"
- "github.com/onsi/ginkgo/reporters"
- "github.com/onsi/ginkgo/types"
-)
-
-var _ = Describe("Suite", func() {
- var (
- specSuite *Suite
- fakeT *fakeTestingT
- fakeR *reporters.FakeReporter
- writer *Writer.FakeGinkgoWriter
- failer *Failer.Failer
- )
-
- BeforeEach(func() {
- writer = Writer.NewFake()
- fakeT = &fakeTestingT{}
- fakeR = reporters.NewFakeReporter()
- failer = Failer.New()
- specSuite = New(failer)
- })
-
- Describe("running a suite", func() {
- var (
- runOrder []string
- randomizeAllSpecs bool
- randomSeed int64
- focusString string
- parallelNode int
- parallelTotal int
- runResult bool
- hasProgrammaticFocus bool
- )
-
- var f = func(runText string) func() {
- return func() {
- runOrder = append(runOrder, runText)
- }
- }
-
- BeforeEach(func() {
- randomizeAllSpecs = false
- randomSeed = 11
- parallelNode = 1
- parallelTotal = 1
- focusString = ""
-
- runOrder = make([]string, 0)
- specSuite.SetBeforeSuiteNode(f("BeforeSuite"), codelocation.New(0), 0)
- specSuite.PushBeforeEachNode(f("top BE"), codelocation.New(0), 0)
- specSuite.PushJustBeforeEachNode(f("top JBE"), codelocation.New(0), 0)
- specSuite.PushAfterEachNode(f("top AE"), codelocation.New(0), 0)
-
- specSuite.PushContainerNode("container", func() {
- specSuite.PushBeforeEachNode(f("BE"), codelocation.New(0), 0)
- specSuite.PushJustBeforeEachNode(f("JBE"), codelocation.New(0), 0)
- specSuite.PushAfterEachNode(f("AE"), codelocation.New(0), 0)
- specSuite.PushItNode("it", f("IT"), types.FlagTypeNone, codelocation.New(0), 0)
-
- specSuite.PushContainerNode("inner container", func() {
- specSuite.PushItNode("inner it", f("inner IT"), types.FlagTypeNone, codelocation.New(0), 0)
- }, types.FlagTypeNone, codelocation.New(0))
- }, types.FlagTypeNone, codelocation.New(0))
-
- specSuite.PushContainerNode("container 2", func() {
- specSuite.PushBeforeEachNode(f("BE 2"), codelocation.New(0), 0)
- specSuite.PushItNode("it 2", f("IT 2"), types.FlagTypeNone, codelocation.New(0), 0)
- }, types.FlagTypeNone, codelocation.New(0))
-
- specSuite.PushItNode("top level it", f("top IT"), types.FlagTypeNone, codelocation.New(0), 0)
-
- specSuite.SetAfterSuiteNode(f("AfterSuite"), codelocation.New(0), 0)
- })
-
- JustBeforeEach(func() {
- runResult, hasProgrammaticFocus = specSuite.Run(fakeT, "suite description", []reporters.Reporter{fakeR}, writer, config.GinkgoConfigType{
- RandomSeed: randomSeed,
- RandomizeAllSpecs: randomizeAllSpecs,
- FocusString: focusString,
- ParallelNode: parallelNode,
- ParallelTotal: parallelTotal,
- })
- })
-
- It("provides the config and suite description to the reporter", func() {
- Ω(fakeR.Config.RandomSeed).Should(Equal(int64(randomSeed)))
- Ω(fakeR.Config.RandomizeAllSpecs).Should(Equal(randomizeAllSpecs))
- Ω(fakeR.BeginSummary.SuiteDescription).Should(Equal("suite description"))
- })
-
- It("reports that the BeforeSuite node ran", func() {
- Ω(fakeR.BeforeSuiteSummary).ShouldNot(BeNil())
- })
-
- It("reports that the AfterSuite node ran", func() {
- Ω(fakeR.AfterSuiteSummary).ShouldNot(BeNil())
- })
-
- It("provides information about the current test", func() {
- description := CurrentGinkgoTestDescription()
- Ω(description.ComponentTexts).Should(Equal([]string{"Suite", "running a suite", "provides information about the current test"}))
- Ω(description.FullTestText).Should(Equal("Suite running a suite provides information about the current test"))
- Ω(description.TestText).Should(Equal("provides information about the current test"))
- Ω(description.IsMeasurement).Should(BeFalse())
- Ω(description.FileName).Should(ContainSubstring("suite_test.go"))
- Ω(description.LineNumber).Should(BeNumerically(">", 50))
- Ω(description.LineNumber).Should(BeNumerically("<", 150))
- Ω(description.Failed).Should(BeFalse())
- Ω(description.Duration).Should(BeNumerically(">", 0))
- })
-
- Measure("should run measurements", func(b Benchmarker) {
- r := rand.New(rand.NewSource(time.Now().UnixNano()))
-
- runtime := b.Time("sleeping", func() {
- sleepTime := time.Duration(r.Float64() * 0.01 * float64(time.Second))
- time.Sleep(sleepTime)
- })
- Ω(runtime.Seconds()).Should(BeNumerically("<=", 1))
- Ω(runtime.Seconds()).Should(BeNumerically(">=", 0))
-
- randomValue := r.Float64() * 10.0
- b.RecordValue("random value", randomValue)
- Ω(randomValue).Should(BeNumerically("<=", 10.0))
- Ω(randomValue).Should(BeNumerically(">=", 0.0))
-
- b.RecordValueWithPrecision("specific value", 123.4567, "ms", 2)
- b.RecordValueWithPrecision("specific value", 234.5678, "ms", 2)
- }, 10)
-
- It("creates a node hierarchy, converts it to a spec collection, and runs it", func() {
- Ω(runOrder).Should(Equal([]string{
- "BeforeSuite",
- "top BE", "BE", "top JBE", "JBE", "IT", "AE", "top AE",
- "top BE", "BE", "top JBE", "JBE", "inner IT", "AE", "top AE",
- "top BE", "BE 2", "top JBE", "IT 2", "top AE",
- "top BE", "top JBE", "top IT", "top AE",
- "AfterSuite",
- }))
- })
- Context("when in an AfterEach block", func() {
- AfterEach(func() {
- description := CurrentGinkgoTestDescription()
- Ω(description.IsMeasurement).Should(BeFalse())
- Ω(description.FileName).Should(ContainSubstring("suite_test.go"))
- Ω(description.Failed).Should(BeFalse())
- Ω(description.Duration).Should(BeNumerically(">", 0))
- })
-
- It("still provides information about the current test", func() {
- Ω(true).To(BeTrue())
- })
- })
-
- Context("when told to randomize all specs", func() {
- BeforeEach(func() {
- randomizeAllSpecs = true
- })
-
- It("does", func() {
- Ω(runOrder).Should(Equal([]string{
- "BeforeSuite",
- "top BE", "top JBE", "top IT", "top AE",
- "top BE", "BE", "top JBE", "JBE", "inner IT", "AE", "top AE",
- "top BE", "BE", "top JBE", "JBE", "IT", "AE", "top AE",
- "top BE", "BE 2", "top JBE", "IT 2", "top AE",
- "AfterSuite",
- }))
- })
- })
-
- Context("when provided with a filter", func() {
- BeforeEach(func() {
- focusString = `inner|\d`
- })
-
- It("converts the filter to a regular expression and uses it to filter the running specs", func() {
- Ω(runOrder).Should(Equal([]string{
- "BeforeSuite",
- "top BE", "BE", "top JBE", "JBE", "inner IT", "AE", "top AE",
- "top BE", "BE 2", "top JBE", "IT 2", "top AE",
- "AfterSuite",
- }))
- })
-
- It("should not report a programmatic focus", func() {
- Ω(hasProgrammaticFocus).Should(BeFalse())
- })
- })
-
- Context("with a programatically focused spec", func() {
- BeforeEach(func() {
- specSuite.PushItNode("focused it", f("focused it"), types.FlagTypeFocused, codelocation.New(0), 0)
-
- specSuite.PushContainerNode("focused container", func() {
- specSuite.PushItNode("inner focused it", f("inner focused it"), types.FlagTypeFocused, codelocation.New(0), 0)
- specSuite.PushItNode("inner unfocused it", f("inner unfocused it"), types.FlagTypeNone, codelocation.New(0), 0)
- }, types.FlagTypeFocused, codelocation.New(0))
-
- })
-
- It("should only run the focused test, applying backpropagation to favor most deeply focused leaf nodes", func() {
- Ω(runOrder).Should(Equal([]string{
- "BeforeSuite",
- "top BE", "top JBE", "focused it", "top AE",
- "top BE", "top JBE", "inner focused it", "top AE",
- "AfterSuite",
- }))
- })
-
- It("should report a programmatic focus", func() {
- Ω(hasProgrammaticFocus).Should(BeTrue())
- })
- })
-
- Context("when the specs pass", func() {
- It("doesn't report a failure", func() {
- Ω(fakeT.didFail).Should(BeFalse())
- })
-
- It("should return true", func() {
- Ω(runResult).Should(BeTrue())
- })
- })
-
- Context("when a spec fails", func() {
- var location types.CodeLocation
- BeforeEach(func() {
- specSuite.PushItNode("top level it", func() {
- location = codelocation.New(0)
- failer.Fail("oops!", location)
- }, types.FlagTypeNone, codelocation.New(0), 0)
- })
-
- It("should return false", func() {
- Ω(runResult).Should(BeFalse())
- })
-
- It("reports a failure", func() {
- Ω(fakeT.didFail).Should(BeTrue())
- })
-
- It("generates the correct failure data", func() {
- Ω(fakeR.SpecSummaries[0].Failure.Message).Should(Equal("oops!"))
- Ω(fakeR.SpecSummaries[0].Failure.Location).Should(Equal(location))
- })
- })
-
- Context("when runnable nodes are nested within other runnable nodes", func() {
- Context("when an It is nested", func() {
- BeforeEach(func() {
- specSuite.PushItNode("top level it", func() {
- specSuite.PushItNode("nested it", f("oops"), types.FlagTypeNone, codelocation.New(0), 0)
- }, types.FlagTypeNone, codelocation.New(0), 0)
- })
-
- It("should fail", func() {
- Ω(fakeT.didFail).Should(BeTrue())
- })
- })
-
- Context("when a Measure is nested", func() {
- BeforeEach(func() {
- specSuite.PushItNode("top level it", func() {
- specSuite.PushMeasureNode("nested measure", func(Benchmarker) {}, types.FlagTypeNone, codelocation.New(0), 10)
- }, types.FlagTypeNone, codelocation.New(0), 0)
- })
-
- It("should fail", func() {
- Ω(fakeT.didFail).Should(BeTrue())
- })
- })
-
- Context("when a BeforeEach is nested", func() {
- BeforeEach(func() {
- specSuite.PushItNode("top level it", func() {
- specSuite.PushBeforeEachNode(f("nested bef"), codelocation.New(0), 0)
- }, types.FlagTypeNone, codelocation.New(0), 0)
- })
-
- It("should fail", func() {
- Ω(fakeT.didFail).Should(BeTrue())
- })
- })
-
- Context("when a JustBeforeEach is nested", func() {
- BeforeEach(func() {
- specSuite.PushItNode("top level it", func() {
- specSuite.PushJustBeforeEachNode(f("nested jbef"), codelocation.New(0), 0)
- }, types.FlagTypeNone, codelocation.New(0), 0)
- })
-
- It("should fail", func() {
- Ω(fakeT.didFail).Should(BeTrue())
- })
- })
-
- Context("when a AfterEach is nested", func() {
- BeforeEach(func() {
- specSuite.PushItNode("top level it", func() {
- specSuite.PushAfterEachNode(f("nested aft"), codelocation.New(0), 0)
- }, types.FlagTypeNone, codelocation.New(0), 0)
- })
-
- It("should fail", func() {
- Ω(fakeT.didFail).Should(BeTrue())
- })
- })
- })
- })
-
- Describe("BeforeSuite", func() {
- Context("when setting BeforeSuite more than once", func() {
- It("should panic", func() {
- specSuite.SetBeforeSuiteNode(func() {}, codelocation.New(0), 0)
-
- Ω(func() {
- specSuite.SetBeforeSuiteNode(func() {}, codelocation.New(0), 0)
- }).Should(Panic())
-
- })
- })
- })
-
- Describe("AfterSuite", func() {
- Context("when setting AfterSuite more than once", func() {
- It("should panic", func() {
- specSuite.SetAfterSuiteNode(func() {}, codelocation.New(0), 0)
-
- Ω(func() {
- specSuite.SetAfterSuiteNode(func() {}, codelocation.New(0), 0)
- }).Should(Panic())
- })
- })
- })
-
- Describe("By", func() {
- It("writes to the GinkgoWriter", func() {
- originalGinkgoWriter := GinkgoWriter
- buffer := &bytes.Buffer{}
-
- GinkgoWriter = buffer
- By("Saying Hello GinkgoWriter")
- GinkgoWriter = originalGinkgoWriter
-
- Ω(buffer.String()).Should(ContainSubstring("STEP"))
- Ω(buffer.String()).Should(ContainSubstring(": Saying Hello GinkgoWriter\n"))
- })
-
- It("calls the passed-in callback if present", func() {
- a := 0
- By("calling the callback", func() {
- a = 1
- })
- Ω(a).Should(Equal(1))
- })
-
- It("panics if there is more than one callback", func() {
- Ω(func() {
- By("registering more than one callback", func() {}, func() {})
- }).Should(Panic())
- })
- })
-
- Describe("GinkgoRandomSeed", func() {
- It("returns the current config's random seed", func() {
- Ω(GinkgoRandomSeed()).Should(Equal(config.GinkgoConfig.RandomSeed))
- })
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/internal/writer/writer_suite_test.go b/vendor/github.com/onsi/ginkgo/internal/writer/writer_suite_test.go
deleted file mode 100644
index e20657791..000000000
--- a/vendor/github.com/onsi/ginkgo/internal/writer/writer_suite_test.go
+++ /dev/null
@@ -1,13 +0,0 @@
-package writer_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-
- "testing"
-)
-
-func TestWriter(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "Writer Suite")
-}
diff --git a/vendor/github.com/onsi/ginkgo/internal/writer/writer_test.go b/vendor/github.com/onsi/ginkgo/internal/writer/writer_test.go
deleted file mode 100644
index 3e1d17c6d..000000000
--- a/vendor/github.com/onsi/ginkgo/internal/writer/writer_test.go
+++ /dev/null
@@ -1,75 +0,0 @@
-package writer_test
-
-import (
- "github.com/onsi/gomega/gbytes"
-
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/ginkgo/internal/writer"
- . "github.com/onsi/gomega"
-)
-
-var _ = Describe("Writer", func() {
- var writer *Writer
- var out *gbytes.Buffer
-
- BeforeEach(func() {
- out = gbytes.NewBuffer()
- writer = New(out)
- })
-
- It("should stream directly to the outbuffer by default", func() {
- writer.Write([]byte("foo"))
- Ω(out).Should(gbytes.Say("foo"))
- })
-
- It("should not emit the header when asked to DumpOutWitHeader", func() {
- writer.Write([]byte("foo"))
- writer.DumpOutWithHeader("my header")
- Ω(out).ShouldNot(gbytes.Say("my header"))
- Ω(out).Should(gbytes.Say("foo"))
- })
-
- Context("when told not to stream", func() {
- BeforeEach(func() {
- writer.SetStream(false)
- })
-
- It("should only write to the buffer when told to DumpOut", func() {
- writer.Write([]byte("foo"))
- Ω(out).ShouldNot(gbytes.Say("foo"))
- writer.DumpOut()
- Ω(out).Should(gbytes.Say("foo"))
- })
-
- It("should truncate the internal buffer when told to truncate", func() {
- writer.Write([]byte("foo"))
- writer.Truncate()
- writer.DumpOut()
- Ω(out).ShouldNot(gbytes.Say("foo"))
-
- writer.Write([]byte("bar"))
- writer.DumpOut()
- Ω(out).Should(gbytes.Say("bar"))
- })
-
- Describe("emitting a header", func() {
- Context("when the buffer has content", func() {
- It("should emit the header followed by the content", func() {
- writer.Write([]byte("foo"))
- writer.DumpOutWithHeader("my header")
-
- Ω(out).Should(gbytes.Say("my header"))
- Ω(out).Should(gbytes.Say("foo"))
- })
- })
-
- Context("when the buffer has no content", func() {
- It("should not emit the header", func() {
- writer.DumpOutWithHeader("my header")
-
- Ω(out).ShouldNot(gbytes.Say("my header"))
- })
- })
- })
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/reporters/default_reporter_test.go b/vendor/github.com/onsi/ginkgo/reporters/default_reporter_test.go
deleted file mode 100644
index 2dcf276d3..000000000
--- a/vendor/github.com/onsi/ginkgo/reporters/default_reporter_test.go
+++ /dev/null
@@ -1,433 +0,0 @@
-package reporters_test
-
-import (
- "time"
-
- . "github.com/onsi/ginkgo"
- "github.com/onsi/ginkgo/config"
- "github.com/onsi/ginkgo/reporters"
- st "github.com/onsi/ginkgo/reporters/stenographer"
- "github.com/onsi/ginkgo/types"
- . "github.com/onsi/gomega"
-)
-
-var _ = Describe("DefaultReporter", func() {
- var (
- reporter *reporters.DefaultReporter
- reporterConfig config.DefaultReporterConfigType
- stenographer *st.FakeStenographer
-
- ginkgoConfig config.GinkgoConfigType
- suite *types.SuiteSummary
- spec *types.SpecSummary
- )
-
- BeforeEach(func() {
- stenographer = st.NewFakeStenographer()
- reporterConfig = config.DefaultReporterConfigType{
- NoColor: false,
- SlowSpecThreshold: 0.1,
- NoisyPendings: false,
- NoisySkippings: false,
- Verbose: true,
- FullTrace: true,
- }
-
- reporter = reporters.NewDefaultReporter(reporterConfig, stenographer)
- })
-
- call := func(method string, args ...interface{}) st.FakeStenographerCall {
- return st.NewFakeStenographerCall(method, args...)
- }
-
- Describe("SpecSuiteWillBegin", func() {
- BeforeEach(func() {
- suite = &types.SuiteSummary{
- SuiteDescription: "A Sweet Suite",
- NumberOfTotalSpecs: 10,
- NumberOfSpecsThatWillBeRun: 8,
- }
-
- ginkgoConfig = config.GinkgoConfigType{
- RandomSeed: 1138,
- RandomizeAllSpecs: true,
- }
- })
-
- Context("when a serial (non-parallel) suite begins", func() {
- BeforeEach(func() {
- ginkgoConfig.ParallelTotal = 1
-
- reporter.SpecSuiteWillBegin(ginkgoConfig, suite)
- })
-
- It("should announce the suite, then announce the number of specs", func() {
- Ω(stenographer.Calls()).Should(HaveLen(2))
- Ω(stenographer.Calls()[0]).Should(Equal(call("AnnounceSuite", "A Sweet Suite", ginkgoConfig.RandomSeed, true, false)))
- Ω(stenographer.Calls()[1]).Should(Equal(call("AnnounceNumberOfSpecs", 8, 10, false)))
- })
- })
-
- Context("when a parallel suite begins", func() {
- BeforeEach(func() {
- ginkgoConfig.ParallelTotal = 2
- ginkgoConfig.ParallelNode = 1
- suite.NumberOfSpecsBeforeParallelization = 20
-
- reporter.SpecSuiteWillBegin(ginkgoConfig, suite)
- })
-
- It("should announce the suite, announce that it's a parallel run, then announce the number of specs", func() {
- Ω(stenographer.Calls()).Should(HaveLen(2))
- Ω(stenographer.Calls()[0]).Should(Equal(call("AnnounceSuite", "A Sweet Suite", ginkgoConfig.RandomSeed, true, false)))
- Ω(stenographer.Calls()[1]).Should(Equal(call("AnnounceParallelRun", 1, 2, false)))
- })
- })
- })
-
- Describe("BeforeSuiteDidRun", func() {
- Context("when the BeforeSuite passes", func() {
- It("should announce nothing", func() {
- reporter.BeforeSuiteDidRun(&types.SetupSummary{
- State: types.SpecStatePassed,
- })
-
- Ω(stenographer.Calls()).Should(BeEmpty())
- })
- })
-
- Context("when the BeforeSuite fails", func() {
- It("should announce the failure", func() {
- summary := &types.SetupSummary{
- State: types.SpecStateFailed,
- }
- reporter.BeforeSuiteDidRun(summary)
-
- Ω(stenographer.Calls()).Should(HaveLen(1))
- Ω(stenographer.Calls()[0]).Should(Equal(call("AnnounceBeforeSuiteFailure", summary, false, true)))
- })
- })
- })
-
- Describe("AfterSuiteDidRun", func() {
- Context("when the AfterSuite passes", func() {
- It("should announce nothing", func() {
- reporter.AfterSuiteDidRun(&types.SetupSummary{
- State: types.SpecStatePassed,
- })
-
- Ω(stenographer.Calls()).Should(BeEmpty())
- })
- })
-
- Context("when the AfterSuite fails", func() {
- It("should announce the failure", func() {
- summary := &types.SetupSummary{
- State: types.SpecStateFailed,
- }
- reporter.AfterSuiteDidRun(summary)
-
- Ω(stenographer.Calls()).Should(HaveLen(1))
- Ω(stenographer.Calls()[0]).Should(Equal(call("AnnounceAfterSuiteFailure", summary, false, true)))
- })
- })
- })
-
- Describe("SpecWillRun", func() {
- Context("When running in verbose mode", func() {
- Context("and the spec will run", func() {
- BeforeEach(func() {
- spec = &types.SpecSummary{}
- reporter.SpecWillRun(spec)
- })
-
- It("should announce that the spec will run", func() {
- Ω(stenographer.Calls()).Should(HaveLen(1))
- Ω(stenographer.Calls()[0]).Should(Equal(call("AnnounceSpecWillRun", spec)))
- })
- })
-
- Context("and the spec will not run", func() {
- Context("because it is pending", func() {
- BeforeEach(func() {
- spec = &types.SpecSummary{
- State: types.SpecStatePending,
- }
- reporter.SpecWillRun(spec)
- })
-
- It("should announce nothing", func() {
- Ω(stenographer.Calls()).Should(BeEmpty())
- })
- })
-
- Context("because it is skipped", func() {
- BeforeEach(func() {
- spec = &types.SpecSummary{
- State: types.SpecStateSkipped,
- }
- reporter.SpecWillRun(spec)
- })
-
- It("should announce nothing", func() {
- Ω(stenographer.Calls()).Should(BeEmpty())
- })
- })
- })
- })
-
- Context("When running in verbose & succinct mode", func() {
- BeforeEach(func() {
- reporterConfig.Succinct = true
- reporter = reporters.NewDefaultReporter(reporterConfig, stenographer)
- spec = &types.SpecSummary{}
- reporter.SpecWillRun(spec)
- })
-
- It("should announce nothing", func() {
- Ω(stenographer.Calls()).Should(BeEmpty())
- })
- })
-
- Context("When not running in verbose mode", func() {
- BeforeEach(func() {
- reporterConfig.Verbose = false
- reporter = reporters.NewDefaultReporter(reporterConfig, stenographer)
- spec = &types.SpecSummary{}
- reporter.SpecWillRun(spec)
- })
-
- It("should announce nothing", func() {
- Ω(stenographer.Calls()).Should(BeEmpty())
- })
- })
- })
-
- Describe("SpecDidComplete", func() {
- JustBeforeEach(func() {
- reporter.SpecDidComplete(spec)
- })
-
- BeforeEach(func() {
- spec = &types.SpecSummary{}
- })
-
- Context("When the spec passed", func() {
- BeforeEach(func() {
- spec.State = types.SpecStatePassed
- })
-
- Context("When the spec was a measurement", func() {
- BeforeEach(func() {
- spec.IsMeasurement = true
- })
-
- It("should announce the measurement", func() {
- Ω(stenographer.Calls()[0]).Should(Equal(call("AnnounceSuccesfulMeasurement", spec, false)))
- })
- })
-
- Context("When the spec is slow", func() {
- BeforeEach(func() {
- spec.RunTime = time.Second
- })
-
- It("should announce that it was slow", func() {
- Ω(stenographer.Calls()[0]).Should(Equal(call("AnnounceSuccesfulSlowSpec", spec, false)))
- })
- })
-
- Context("Otherwise", func() {
- It("should announce the succesful spec", func() {
- Ω(stenographer.Calls()[0]).Should(Equal(call("AnnounceSuccesfulSpec", spec)))
- })
- })
- })
-
- Context("When the spec is pending", func() {
- BeforeEach(func() {
- spec.State = types.SpecStatePending
- })
-
- It("should announce the pending spec, succinctly", func() {
- Ω(stenographer.Calls()[0]).Should(Equal(call("AnnouncePendingSpec", spec, false)))
- })
- })
-
- Context("When the spec is skipped", func() {
- BeforeEach(func() {
- spec.State = types.SpecStateSkipped
- })
-
- It("should announce the skipped spec, succinctly", func() {
- Ω(stenographer.Calls()[0]).Should(Equal(call("AnnounceSkippedSpec", spec, true, true)))
- })
- })
-
- Context("When the spec timed out", func() {
- BeforeEach(func() {
- spec.State = types.SpecStateTimedOut
- })
-
- It("should announce the timedout spec", func() {
- Ω(stenographer.Calls()[0]).Should(Equal(call("AnnounceSpecTimedOut", spec, false, true)))
- })
- })
-
- Context("When the spec panicked", func() {
- BeforeEach(func() {
- spec.State = types.SpecStatePanicked
- })
-
- It("should announce the panicked spec", func() {
- Ω(stenographer.Calls()[0]).Should(Equal(call("AnnounceSpecPanicked", spec, false, true)))
- })
- })
-
- Context("When the spec failed", func() {
- BeforeEach(func() {
- spec.State = types.SpecStateFailed
- })
-
- It("should announce the failed spec", func() {
- Ω(stenographer.Calls()[0]).Should(Equal(call("AnnounceSpecFailed", spec, false, true)))
- })
- })
-
- Context("in noisy pendings mode", func() {
- BeforeEach(func() {
- reporterConfig.Succinct = false
- reporterConfig.NoisyPendings = true
- reporter = reporters.NewDefaultReporter(reporterConfig, stenographer)
- })
-
- Context("When the spec is pending", func() {
- BeforeEach(func() {
- spec.State = types.SpecStatePending
- })
-
- It("should announce the pending spec, noisily", func() {
- Ω(stenographer.Calls()[0]).Should(Equal(call("AnnouncePendingSpec", spec, true)))
- })
- })
- })
-
- Context("in noisy skippings mode", func() {
- BeforeEach(func() {
- reporterConfig.Succinct = false
- reporterConfig.NoisySkippings = true
- reporter = reporters.NewDefaultReporter(reporterConfig, stenographer)
- })
-
- Context("When the spec is skipped", func() {
- BeforeEach(func() {
- spec.State = types.SpecStateSkipped
- })
-
- It("should announce the skipped spec, noisily", func() {
- Ω(stenographer.Calls()[0]).Should(Equal(call("AnnounceSkippedSpec", spec, false, true)))
- })
- })
- })
-
- Context("in succinct mode", func() {
- BeforeEach(func() {
- reporterConfig.Succinct = true
- reporter = reporters.NewDefaultReporter(reporterConfig, stenographer)
- })
-
- Context("When the spec passed", func() {
- BeforeEach(func() {
- spec.State = types.SpecStatePassed
- })
-
- Context("When the spec was a measurement", func() {
- BeforeEach(func() {
- spec.IsMeasurement = true
- })
-
- It("should announce the measurement", func() {
- Ω(stenographer.Calls()[0]).Should(Equal(call("AnnounceSuccesfulMeasurement", spec, true)))
- })
- })
-
- Context("When the spec is slow", func() {
- BeforeEach(func() {
- spec.RunTime = time.Second
- })
-
- It("should announce that it was slow", func() {
- Ω(stenographer.Calls()[0]).Should(Equal(call("AnnounceSuccesfulSlowSpec", spec, true)))
- })
- })
-
- Context("Otherwise", func() {
- It("should announce the succesful spec", func() {
- Ω(stenographer.Calls()[0]).Should(Equal(call("AnnounceSuccesfulSpec", spec)))
- })
- })
- })
-
- Context("When the spec is pending", func() {
- BeforeEach(func() {
- spec.State = types.SpecStatePending
- })
-
- It("should announce the pending spec, succinctly", func() {
- Ω(stenographer.Calls()[0]).Should(Equal(call("AnnouncePendingSpec", spec, false)))
- })
- })
-
- Context("When the spec is skipped", func() {
- BeforeEach(func() {
- spec.State = types.SpecStateSkipped
- })
-
- It("should announce the skipped spec", func() {
- Ω(stenographer.Calls()[0]).Should(Equal(call("AnnounceSkippedSpec", spec, true, true)))
- })
- })
-
- Context("When the spec timed out", func() {
- BeforeEach(func() {
- spec.State = types.SpecStateTimedOut
- })
-
- It("should announce the timedout spec", func() {
- Ω(stenographer.Calls()[0]).Should(Equal(call("AnnounceSpecTimedOut", spec, true, true)))
- })
- })
-
- Context("When the spec panicked", func() {
- BeforeEach(func() {
- spec.State = types.SpecStatePanicked
- })
-
- It("should announce the panicked spec", func() {
- Ω(stenographer.Calls()[0]).Should(Equal(call("AnnounceSpecPanicked", spec, true, true)))
- })
- })
-
- Context("When the spec failed", func() {
- BeforeEach(func() {
- spec.State = types.SpecStateFailed
- })
-
- It("should announce the failed spec", func() {
- Ω(stenographer.Calls()[0]).Should(Equal(call("AnnounceSpecFailed", spec, true, true)))
- })
- })
- })
- })
-
- Describe("SpecSuiteDidEnd", func() {
- BeforeEach(func() {
- suite = &types.SuiteSummary{}
- reporter.SpecSuiteDidEnd(suite)
- })
-
- It("should announce the spec run's completion", func() {
- Ω(stenographer.Calls()[1]).Should(Equal(call("AnnounceSpecRunCompletion", suite, false)))
- })
- })
-})
diff --git a/vendor/github.com/onsi/ginkgo/reporters/junit_reporter_test.go b/vendor/github.com/onsi/ginkgo/reporters/junit_reporter_test.go
deleted file mode 100644
index 9b75dc006..000000000
--- a/vendor/github.com/onsi/ginkgo/reporters/junit_reporter_test.go
+++ /dev/null
@@ -1,258 +0,0 @@
-package reporters_test
-
-import (
- "encoding/xml"
- "io/ioutil"
- "os"
- "time"
-
- . "github.com/onsi/ginkgo"
- "github.com/onsi/ginkgo/config"
- "github.com/onsi/ginkgo/internal/codelocation"
- "github.com/onsi/ginkgo/reporters"
- "github.com/onsi/ginkgo/types"
- . "github.com/onsi/gomega"
-)
-
-var _ = Describe("JUnit Reporter", func() {
- var (
- outputFile string
- reporter Reporter
- )
- testSuiteTime := 12456999 * time.Microsecond
- reportedSuiteTime := 12.456
-
- readOutputFile := func() reporters.JUnitTestSuite {
- bytes, err := ioutil.ReadFile(outputFile)
- Ω(err).ShouldNot(HaveOccurred())
- var suite reporters.JUnitTestSuite
- err = xml.Unmarshal(bytes, &suite)
- Ω(err).ShouldNot(HaveOccurred())
- return suite
- }
-
- BeforeEach(func() {
- f, err := ioutil.TempFile("", "output")
- Ω(err).ShouldNot(HaveOccurred())
- f.Close()
- outputFile = f.Name()
-
- reporter = reporters.NewJUnitReporter(outputFile)
-
- reporter.SpecSuiteWillBegin(config.GinkgoConfigType{}, &types.SuiteSummary{
- SuiteDescription: "My test suite",
- NumberOfSpecsThatWillBeRun: 1,
- })
- })
-
- AfterEach(func() {
- os.RemoveAll(outputFile)
- })
-
- Describe("a passing test", func() {
- BeforeEach(func() {
- beforeSuite := &types.SetupSummary{
- State: types.SpecStatePassed,
- }
- reporter.BeforeSuiteDidRun(beforeSuite)
-
- afterSuite := &types.SetupSummary{
- State: types.SpecStatePassed,
- }
- reporter.AfterSuiteDidRun(afterSuite)
-
- spec := &types.SpecSummary{
- ComponentTexts: []string{"[Top Level]", "A", "B", "C"},
- State: types.SpecStatePassed,
- RunTime: 5 * time.Second,
- }
- reporter.SpecWillRun(spec)
- reporter.SpecDidComplete(spec)
-
- reporter.SpecSuiteDidEnd(&types.SuiteSummary{
- NumberOfSpecsThatWillBeRun: 1,
- NumberOfFailedSpecs: 0,
- RunTime: testSuiteTime,
- })
- })
-
- It("should record the test as passing", func() {
- output := readOutputFile()
- Ω(output.Name).Should(Equal("My test suite"))
- Ω(output.Tests).Should(Equal(1))
- Ω(output.Failures).Should(Equal(0))
- Ω(output.Time).Should(Equal(reportedSuiteTime))
- Ω(output.Errors).Should(Equal(0))
- Ω(output.TestCases).Should(HaveLen(1))
- Ω(output.TestCases[0].Name).Should(Equal("A B C"))
- Ω(output.TestCases[0].ClassName).Should(Equal("My test suite"))
- Ω(output.TestCases[0].FailureMessage).Should(BeNil())
- Ω(output.TestCases[0].Skipped).Should(BeNil())
- Ω(output.TestCases[0].Time).Should(Equal(5.0))
- })
- })
-
- Describe("when the BeforeSuite fails", func() {
- var beforeSuite *types.SetupSummary
-
- BeforeEach(func() {
- beforeSuite = &types.SetupSummary{
- State: types.SpecStateFailed,
- RunTime: 3 * time.Second,
- Failure: types.SpecFailure{
- Message: "failed to setup",
- ComponentCodeLocation: codelocation.New(0),
- Location: codelocation.New(2),
- },
- }
- reporter.BeforeSuiteDidRun(beforeSuite)
-
- reporter.SpecSuiteDidEnd(&types.SuiteSummary{
- NumberOfSpecsThatWillBeRun: 1,
- NumberOfFailedSpecs: 1,
- RunTime: testSuiteTime,
- })
- })
-
- It("should record the test as having failed", func() {
- output := readOutputFile()
- Ω(output.Name).Should(Equal("My test suite"))
- Ω(output.Tests).Should(Equal(1))
- Ω(output.Failures).Should(Equal(1))
- Ω(output.Time).Should(Equal(reportedSuiteTime))
- Ω(output.Errors).Should(Equal(0))
- Ω(output.TestCases[0].Name).Should(Equal("BeforeSuite"))
- Ω(output.TestCases[0].Time).Should(Equal(3.0))
- Ω(output.TestCases[0].ClassName).Should(Equal("My test suite"))
- Ω(output.TestCases[0].FailureMessage.Type).Should(Equal("Failure"))
- Ω(output.TestCases[0].FailureMessage.Message).Should(ContainSubstring("failed to setup"))
- Ω(output.TestCases[0].FailureMessage.Message).Should(ContainSubstring(beforeSuite.Failure.ComponentCodeLocation.String()))
- Ω(output.TestCases[0].FailureMessage.Message).Should(ContainSubstring(beforeSuite.Failure.Location.String()))
- Ω(output.TestCases[0].Skipped).Should(BeNil())
- })
- })
-
- Describe("when the AfterSuite fails", func() {
- var afterSuite *types.SetupSummary
-
- BeforeEach(func() {
- afterSuite = &types.SetupSummary{
- State: types.SpecStateFailed,
- RunTime: 3 * time.Second,
- Failure: types.SpecFailure{
- Message: "failed to setup",
- ComponentCodeLocation: codelocation.New(0),
- Location: codelocation.New(2),
- },
- }
- reporter.AfterSuiteDidRun(afterSuite)
-
- reporter.SpecSuiteDidEnd(&types.SuiteSummary{
- NumberOfSpecsThatWillBeRun: 1,
- NumberOfFailedSpecs: 1,
- RunTime: testSuiteTime,
- })
- })
-
- It("should record the test as having failed", func() {
- output := readOutputFile()
- Ω(output.Name).Should(Equal("My test suite"))
- Ω(output.Tests).Should(Equal(1))
- Ω(output.Failures).Should(Equal(1))
- Ω(output.Time).Should(Equal(reportedSuiteTime))
- Ω(output.Errors).Should(Equal(0))
- Ω(output.TestCases[0].Name).Should(Equal("AfterSuite"))
- Ω(output.TestCases[0].Time).Should(Equal(3.0))
- Ω(output.TestCases[0].ClassName).Should(Equal("My test suite"))
- Ω(output.TestCases[0].FailureMessage.Type).Should(Equal("Failure"))
- Ω(output.TestCases[0].FailureMessage.Message).Should(ContainSubstring("failed to setup"))
- Ω(output.TestCases[0].FailureMessage.Message).Should(ContainSubstring(afterSuite.Failure.ComponentCodeLocation.String()))
- Ω(output.TestCases[0].FailureMessage.Message).Should(ContainSubstring(afterSuite.Failure.Location.String()))
- Ω(output.TestCases[0].Skipped).Should(BeNil())
- })
- })
-
- specStateCases := []struct {
- state types.SpecState
- message string
- }{
- {types.SpecStateFailed, "Failure"},
- {types.SpecStateTimedOut, "Timeout"},
- {types.SpecStatePanicked, "Panic"},
- }
-
- for _, specStateCase := range specStateCases {
- specStateCase := specStateCase
- Describe("a failing test", func() {
- var spec *types.SpecSummary
- BeforeEach(func() {
- spec = &types.SpecSummary{
- ComponentTexts: []string{"[Top Level]", "A", "B", "C"},
- State: specStateCase.state,
- RunTime: 5 * time.Second,
- Failure: types.SpecFailure{
- ComponentCodeLocation: codelocation.New(0),
- Location: codelocation.New(2),
- Message: "I failed",
- },
- }
- reporter.SpecWillRun(spec)
- reporter.SpecDidComplete(spec)
-
- reporter.SpecSuiteDidEnd(&types.SuiteSummary{
- NumberOfSpecsThatWillBeRun: 1,
- NumberOfFailedSpecs: 1,
- RunTime: testSuiteTime,
- })
- })
-
- It("should record test as failing", func() {
- output := readOutputFile()
- Ω(output.Name).Should(Equal("My test suite"))
- Ω(output.Tests).Should(Equal(1))
- Ω(output.Failures).Should(Equal(1))
- Ω(output.Time).Should(Equal(reportedSuiteTime))
- Ω(output.Errors).Should(Equal(0))
- Ω(output.TestCases[0].Name).Should(Equal("A B C"))
- Ω(output.TestCases[0].ClassName).Should(Equal("My test suite"))
- Ω(output.TestCases[0].FailureMessage.Type).Should(Equal(specStateCase.message))
- Ω(output.TestCases[0].FailureMessage.Message).Should(ContainSubstring("I failed"))
- Ω(output.TestCases[0].FailureMessage.Message).Should(ContainSubstring(spec.Failure.ComponentCodeLocation.String()))
- Ω(output.TestCases[0].FailureMessage.Message).Should(ContainSubstring(spec.Failure.Location.String()))
- Ω(output.TestCases[0].Skipped).Should(BeNil())
- })
- })
- }
-
- for _, specStateCase := range []types.SpecState{types.SpecStatePending, types.SpecStateSkipped} {
- specStateCase := specStateCase
- Describe("a skipped test", func() {
- var spec *types.SpecSummary
- BeforeEach(func() {
- spec = &types.SpecSummary{
- ComponentTexts: []string{"[Top Level]", "A", "B", "C"},
- State: specStateCase,
- RunTime: 5 * time.Second,
- }
- reporter.SpecWillRun(spec)
- reporter.SpecDidComplete(spec)
-
- reporter.SpecSuiteDidEnd(&types.SuiteSummary{
- NumberOfSpecsThatWillBeRun: 1,
- NumberOfFailedSpecs: 0,
- RunTime: testSuiteTime,
- })
- })
-
- It("should record test as failing", func() {
- output := readOutputFile()
- Ω(output.Tests).Should(Equal(1))
- Ω(output.Failures).Should(Equal(0))
- Ω(output.Time).Should(Equal(reportedSuiteTime))
- Ω(output.Errors).Should(Equal(0))
- Ω(output.TestCases[0].Name).Should(Equal("A B C"))
- Ω(output.TestCases[0].Skipped).ShouldNot(BeNil())
- })
- })
- }
-})
diff --git a/vendor/github.com/onsi/ginkgo/reporters/reporters_suite_test.go b/vendor/github.com/onsi/ginkgo/reporters/reporters_suite_test.go
deleted file mode 100644
index cec5a4dbf..000000000
--- a/vendor/github.com/onsi/ginkgo/reporters/reporters_suite_test.go
+++ /dev/null
@@ -1,13 +0,0 @@
-package reporters_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-
- "testing"
-)
-
-func TestReporters(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "Reporters Suite")
-}
diff --git a/vendor/github.com/onsi/ginkgo/reporters/stenographer/support/README.md b/vendor/github.com/onsi/ginkgo/reporters/stenographer/support/README.md
deleted file mode 100644
index 37de454f4..000000000
--- a/vendor/github.com/onsi/ginkgo/reporters/stenographer/support/README.md
+++ /dev/null
@@ -1,6 +0,0 @@
-## Colorize Windows
-
-These packages are used for colorize on Windows and contributed by mattn.jp@gmail.com
-
- * go-colorable: <https://github.com/mattn/go-colorable>
- * go-isatty: <https://github.com/mattn/go-isatty>
diff --git a/vendor/github.com/onsi/ginkgo/reporters/teamcity_reporter_test.go b/vendor/github.com/onsi/ginkgo/reporters/teamcity_reporter_test.go
deleted file mode 100644
index b45d5db01..000000000
--- a/vendor/github.com/onsi/ginkgo/reporters/teamcity_reporter_test.go
+++ /dev/null
@@ -1,214 +0,0 @@
-package reporters_test
-
-import (
- "bytes"
- "fmt"
- "time"
-
- . "github.com/onsi/ginkgo"
- "github.com/onsi/ginkgo/config"
- "github.com/onsi/ginkgo/internal/codelocation"
- "github.com/onsi/ginkgo/reporters"
- "github.com/onsi/ginkgo/types"
- . "github.com/onsi/gomega"
-)
-
-var _ = Describe("TeamCity Reporter", func() {
- var (
- buffer bytes.Buffer
- reporter Reporter
- )
-
- BeforeEach(func() {
- buffer.Truncate(0)
- reporter = reporters.NewTeamCityReporter(&buffer)
- reporter.SpecSuiteWillBegin(config.GinkgoConfigType{}, &types.SuiteSummary{
- SuiteDescription: "Foo's test suite",
- NumberOfSpecsThatWillBeRun: 1,
- })
- })
-
- Describe("a passing test", func() {
- BeforeEach(func() {
- beforeSuite := &types.SetupSummary{
- State: types.SpecStatePassed,
- }
- reporter.BeforeSuiteDidRun(beforeSuite)
-
- afterSuite := &types.SetupSummary{
- State: types.SpecStatePassed,
- }
- reporter.AfterSuiteDidRun(afterSuite)
-
- spec := &types.SpecSummary{
- ComponentTexts: []string{"[Top Level]", "A", "B", "C"},
- State: types.SpecStatePassed,
- RunTime: 5 * time.Second,
- }
- reporter.SpecWillRun(spec)
- reporter.SpecDidComplete(spec)
-
- reporter.SpecSuiteDidEnd(&types.SuiteSummary{
- NumberOfSpecsThatWillBeRun: 1,
- NumberOfFailedSpecs: 0,
- RunTime: 10 * time.Second,
- })
- })
-
- It("should record the test as passing", func() {
- actual := buffer.String()
- expected :=
- "##teamcity[testSuiteStarted name='Foo|'s test suite']" +
- "##teamcity[testStarted name='A B C']" +
- "##teamcity[testFinished name='A B C' duration='5000']" +
- "##teamcity[testSuiteFinished name='Foo|'s test suite']"
- Ω(actual).Should(Equal(expected))
- })
- })
-
- Describe("when the BeforeSuite fails", func() {
- var beforeSuite *types.SetupSummary
-
- BeforeEach(func() {
- beforeSuite = &types.SetupSummary{
- State: types.SpecStateFailed,
- RunTime: 3 * time.Second,
- Failure: types.SpecFailure{
- Message: "failed to setup\n",
- ComponentCodeLocation: codelocation.New(0),
- },
- }
- reporter.BeforeSuiteDidRun(beforeSuite)
-
- reporter.SpecSuiteDidEnd(&types.SuiteSummary{
- NumberOfSpecsThatWillBeRun: 1,
- NumberOfFailedSpecs: 1,
- RunTime: 10 * time.Second,
- })
- })
-
- It("should record the test as having failed", func() {
- actual := buffer.String()
- expected := fmt.Sprintf(
- "##teamcity[testSuiteStarted name='Foo|'s test suite']"+
- "##teamcity[testStarted name='BeforeSuite']"+
- "##teamcity[testFailed name='BeforeSuite' message='%s' details='failed to setup|n']"+
- "##teamcity[testFinished name='BeforeSuite' duration='3000']"+
- "##teamcity[testSuiteFinished name='Foo|'s test suite']", beforeSuite.Failure.ComponentCodeLocation.String(),
- )
- Ω(actual).Should(Equal(expected))
- })
- })
-
- Describe("when the AfterSuite fails", func() {
- var afterSuite *types.SetupSummary
-
- BeforeEach(func() {
- afterSuite = &types.SetupSummary{
- State: types.SpecStateFailed,
- RunTime: 3 * time.Second,
- Failure: types.SpecFailure{
- Message: "failed to setup\n",
- ComponentCodeLocation: codelocation.New(0),
- },
- }
- reporter.AfterSuiteDidRun(afterSuite)
-
- reporter.SpecSuiteDidEnd(&types.SuiteSummary{
- NumberOfSpecsThatWillBeRun: 1,
- NumberOfFailedSpecs: 1,
- RunTime: 10 * time.Second,
- })
- })
-
- It("should record the test as having failed", func() {
- actual := buffer.String()
- expected := fmt.Sprintf(
- "##teamcity[testSuiteStarted name='Foo|'s test suite']"+
- "##teamcity[testStarted name='AfterSuite']"+
- "##teamcity[testFailed name='AfterSuite' message='%s' details='failed to setup|n']"+
- "##teamcity[testFinished name='AfterSuite' duration='3000']"+
- "##teamcity[testSuiteFinished name='Foo|'s test suite']", afterSuite.Failure.ComponentCodeLocation.String(),
- )
- Ω(actual).Should(Equal(expected))
- })
- })
- specStateCases := []struct {
- state types.SpecState
- message string
- }{
- {types.SpecStateFailed, "Failure"},
- {types.SpecStateTimedOut, "Timeout"},
- {types.SpecStatePanicked, "Panic"},
- }
-
- for _, specStateCase := range specStateCases {
- specStateCase := specStateCase
- Describe("a failing test", func() {
- var spec *types.SpecSummary
- BeforeEach(func() {
- spec = &types.SpecSummary{
- ComponentTexts: []string{"[Top Level]", "A", "B", "C"},
- State: specStateCase.state,
- RunTime: 5 * time.Second,
- Failure: types.SpecFailure{
- ComponentCodeLocation: codelocation.New(0),
- Message: "I failed",
- },
- }
- reporter.SpecWillRun(spec)
- reporter.SpecDidComplete(spec)
-
- reporter.SpecSuiteDidEnd(&types.SuiteSummary{
- NumberOfSpecsThatWillBeRun: 1,
- NumberOfFailedSpecs: 1,
- RunTime: 10 * time.Second,
- })
- })
-
- It("should record test as failing", func() {
- actual := buffer.String()
- expected :=
- fmt.Sprintf("##teamcity[testSuiteStarted name='Foo|'s test suite']"+
- "##teamcity[testStarted name='A B C']"+
- "##teamcity[testFailed name='A B C' message='%s' details='I failed']"+
- "##teamcity[testFinished name='A B C' duration='5000']"+
- "##teamcity[testSuiteFinished name='Foo|'s test suite']", spec.Failure.ComponentCodeLocation.String())
- Ω(actual).Should(Equal(expected))
- })
- })
- }
-
- for _, specStateCase := range []types.SpecState{types.SpecStatePending, types.SpecStateSkipped} {
- specStateCase := specStateCase
- Describe("a skipped test", func() {
- var spec *types.SpecSummary
- BeforeEach(func() {
- spec = &types.SpecSummary{
- ComponentTexts: []string{"[Top Level]", "A", "B", "C"},
- State: specStateCase,
- RunTime: 5 * time.Second,
- }
- reporter.SpecWillRun(spec)
- reporter.SpecDidComplete(spec)
-
- reporter.SpecSuiteDidEnd(&types.SuiteSummary{
- NumberOfSpecsThatWillBeRun: 1,
- NumberOfFailedSpecs: 0,
- RunTime: 10 * time.Second,
- })
- })
-
- It("should record test as ignored", func() {
- actual := buffer.String()
- expected :=
- "##teamcity[testSuiteStarted name='Foo|'s test suite']" +
- "##teamcity[testStarted name='A B C']" +
- "##teamcity[testIgnored name='A B C']" +
- "##teamcity[testFinished name='A B C' duration='5000']" +
- "##teamcity[testSuiteFinished name='Foo|'s test suite']"
- Ω(actual).Should(Equal(expected))
- })
- })
- }
-})
diff --git a/vendor/github.com/onsi/ginkgo/types/types_suite_test.go b/vendor/github.com/onsi/ginkgo/types/types_suite_test.go
deleted file mode 100644
index b026169c1..000000000
--- a/vendor/github.com/onsi/ginkgo/types/types_suite_test.go
+++ /dev/null
@@ -1,13 +0,0 @@
-package types_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-
- "testing"
-)
-
-func TestTypes(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "Types Suite")
-}
diff --git a/vendor/github.com/onsi/ginkgo/types/types_test.go b/vendor/github.com/onsi/ginkgo/types/types_test.go
deleted file mode 100644
index a0e161c88..000000000
--- a/vendor/github.com/onsi/ginkgo/types/types_test.go
+++ /dev/null
@@ -1,99 +0,0 @@
-package types_test
-
-import (
- . "github.com/onsi/ginkgo/types"
-
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-)
-
-var specStates = []SpecState{
- SpecStatePassed,
- SpecStateTimedOut,
- SpecStatePanicked,
- SpecStateFailed,
- SpecStatePending,
- SpecStateSkipped,
-}
-
-func verifySpecSummary(caller func(SpecSummary) bool, trueStates ...SpecState) {
- summary := SpecSummary{}
- trueStateLookup := map[SpecState]bool{}
- for _, state := range trueStates {
- trueStateLookup[state] = true
- summary.State = state
- Ω(caller(summary)).Should(BeTrue())
- }
-
- for _, state := range specStates {
- if trueStateLookup[state] {
- continue
- }
- summary.State = state
- Ω(caller(summary)).Should(BeFalse())
- }
-}
-
-var _ = Describe("Types", func() {
- Describe("IsFailureState", func() {
- It("knows when it is in a failure-like state", func() {
- verifySpecSummary(func(summary SpecSummary) bool {
- return summary.State.IsFailure()
- }, SpecStateTimedOut, SpecStatePanicked, SpecStateFailed)
- })
- })
-
- Describe("SpecSummary", func() {
- It("knows when it is in a failure-like state", func() {
- verifySpecSummary(func(summary SpecSummary) bool {
- return summary.HasFailureState()
- }, SpecStateTimedOut, SpecStatePanicked, SpecStateFailed)
- })
-
- It("knows when it passed", func() {
- verifySpecSummary(func(summary SpecSummary) bool {
- return summary.Passed()
- }, SpecStatePassed)
- })
-
- It("knows when it has failed", func() {
- verifySpecSummary(func(summary SpecSummary) bool {
- return summary.Failed()
- }, SpecStateFailed)
- })
-
- It("knows when it has panicked", func() {
- verifySpecSummary(func(summary SpecSummary) bool {
- return summary.Panicked()
- }, SpecStatePanicked)
- })
-
- It("knows when it has timed out", func() {
- verifySpecSummary(func(summary SpecSummary) bool {
- return summary.TimedOut()
- }, SpecStateTimedOut)
- })
-
- It("knows when it is pending", func() {
- verifySpecSummary(func(summary SpecSummary) bool {
- return summary.Pending()
- }, SpecStatePending)
- })
-
- It("knows when it is skipped", func() {
- verifySpecSummary(func(summary SpecSummary) bool {
- return summary.Skipped()
- }, SpecStateSkipped)
- })
- })
-
- Describe("SpecMeasurement", func() {
- It("knows how to format values when the precision is 0", func() {
- Ω(SpecMeasurement{}.PrecisionFmt()).Should(Equal("%f"))
- })
-
- It("knows how to format the values when the precision is 3", func() {
- Ω(SpecMeasurement{Precision: 3}.PrecisionFmt()).Should(Equal("%.3f"))
- })
- })
-})