Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
57f62976
Commit
57f62976
authored
Jun 22, 2015
by
Karl Isenberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Ginkgo
- Adds support for Skip()
parent
7855d99b
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
321 additions
and
28 deletions
+321
-28
Godeps.json
Godeps/Godeps.json
+2
-2
.travis.yml
Godeps/_workspace/src/github.com/onsi/ginkgo/.travis.yml
+2
-0
CHANGELOG.md
Godeps/_workspace/src/github.com/onsi/ginkgo/CHANGELOG.md
+12
-0
README.md
Godeps/_workspace/src/github.com/onsi/ginkgo/README.md
+1
-1
config.go
...ps/_workspace/src/github.com/onsi/ginkgo/config/config.go
+1
-1
notifications.go
...kspace/src/github.com/onsi/ginkgo/ginkgo/notifications.go
+40
-0
run_watch_and_build_command_flags.go
...m/onsi/ginkgo/ginkgo/run_watch_and_build_command_flags.go
+2
-0
suite_runner.go
...rkspace/src/github.com/onsi/ginkgo/ginkgo/suite_runner.go
+1
-0
test_runner.go
...c/github.com/onsi/ginkgo/ginkgo/testrunner/test_runner.go
+19
-0
ginkgo_dsl.go
Godeps/_workspace/src/github.com/onsi/ginkgo/ginkgo_dsl.go
+11
-0
run_test.go
...kspace/src/github.com/onsi/ginkgo/integration/run_test.go
+8
-8
skip_test.go
...space/src/github.com/onsi/ginkgo/integration/skip_test.go
+43
-0
suite_command_test.go
.../github.com/onsi/ginkgo/integration/suite_command_test.go
+63
-0
failer.go
...pace/src/github.com/onsi/ginkgo/internal/failer/failer.go
+13
-0
failer_test.go
...src/github.com/onsi/ginkgo/internal/failer/failer_test.go
+16
-0
runner.go
...e/src/github.com/onsi/ginkgo/internal/leafnodes/runner.go
+8
-2
shared_runner_test.go
....com/onsi/ginkgo/internal/leafnodes/shared_runner_test.go
+35
-0
aggregator.go
.../src/github.com/onsi/ginkgo/internal/remote/aggregator.go
+1
-1
default_reporter.go
.../src/github.com/onsi/ginkgo/reporters/default_reporter.go
+1
-1
default_reporter_test.go
...github.com/onsi/ginkgo/reporters/default_reporter_test.go
+24
-6
fake_stenographer.go
...m/onsi/ginkgo/reporters/stenographer/fake_stenographer.go
+2
-2
stenographer.go
...ub.com/onsi/ginkgo/reporters/stenographer/stenographer.go
+16
-4
No files found.
Godeps/Godeps.json
View file @
57f62976
...
@@ -423,8 +423,8 @@
...
@@ -423,8 +423,8 @@
},
},
{
{
"ImportPath"
:
"github.com/onsi/ginkgo"
,
"ImportPath"
:
"github.com/onsi/ginkgo"
,
"Comment"
:
"v1.2.0-
beta-9-gfbb6632
"
,
"Comment"
:
"v1.2.0-
6-gd981d36
"
,
"Rev"
:
"
fbb663242655b700c623e9629d7781db98957501
"
"Rev"
:
"
d981d36e9884231afa909627b9c275e4ba678f90
"
},
},
{
{
"ImportPath"
:
"github.com/onsi/gomega"
,
"ImportPath"
:
"github.com/onsi/gomega"
,
...
...
Godeps/_workspace/src/github.com/onsi/ginkgo/.travis.yml
View file @
57f62976
language
:
go
language
:
go
go
:
go
:
-
1.3
-
1.4
-
1.4
-
tip
install
:
install
:
-
go get -v ./...
-
go get -v ./...
...
...
Godeps/_workspace/src/github.com/onsi/ginkgo/CHANGELOG.md
View file @
57f62976
## HEAD
## HEAD
Improvements:
-
`Skip(message)`
can be used to skip the current test.
Bug Fixes:
-
Ginkgo tests now fail when you
`panic(nil)`
(#167)
## 1.2.0 5/31/2015
Improvements
Improvements
-
`ginkgo -coverpkg`
calls down to
`go test -coverpkg`
(#160)
-
`ginkgo -coverpkg`
calls down to
`go test -coverpkg`
(#160)
-
`ginkgo -afterSuiteHook COMMAND`
invokes the passed-in
`COMMAND`
after a test suite completes (#152)
-
Relaxed requirement for Go 1.4+.
`ginkgo`
now works with Go v1.3+ (#166)
## 1.2.0-beta
## 1.2.0-beta
...
...
Godeps/_workspace/src/github.com/onsi/ginkgo/README.md
View file @
57f62976
...
@@ -59,7 +59,7 @@ Agouti allows you run WebDriver integration tests. Learn more about Agouti [her
...
@@ -59,7 +59,7 @@ Agouti allows you run WebDriver integration tests. Learn more about Agouti [her
## Set Me Up!
## Set Me Up!
You'll need Golang v1.
4
+ (Ubuntu users: you probably have Golang v1.0 -- you'll need to upgrade!)
You'll need Golang v1.
3
+ (Ubuntu users: you probably have Golang v1.0 -- you'll need to upgrade!)
```
bash
```
bash
...
...
Godeps/_workspace/src/github.com/onsi/ginkgo/config/config.go
View file @
57f62976
...
@@ -20,7 +20,7 @@ import (
...
@@ -20,7 +20,7 @@ import (
"fmt"
"fmt"
)
)
const
VERSION
=
"1.2.0
-beta
"
const
VERSION
=
"1.2.0"
type
GinkgoConfigType
struct
{
type
GinkgoConfigType
struct
{
RandomSeed
int64
RandomSeed
int64
...
...
Godeps/_workspace/src/github.com/onsi/ginkgo/ginkgo/notifications.go
View file @
57f62976
...
@@ -4,8 +4,11 @@ import (
...
@@ -4,8 +4,11 @@ import (
"fmt"
"fmt"
"os"
"os"
"os/exec"
"os/exec"
"regexp"
"runtime"
"runtime"
"strings"
"github.com/onsi/ginkgo/config"
"github.com/onsi/ginkgo/ginkgo/testsuite"
"github.com/onsi/ginkgo/ginkgo/testsuite"
)
)
...
@@ -99,3 +102,40 @@ func (n *Notifier) SendNotification(title string, subtitle string) {
...
@@ -99,3 +102,40 @@ func (n *Notifier) SendNotification(title string, subtitle string) {
}
}
}
}
}
}
func
(
n
*
Notifier
)
RunCommand
(
suite
testsuite
.
TestSuite
,
suitePassed
bool
)
{
command
:=
n
.
commandFlags
.
AfterSuiteHook
if
command
!=
""
{
// Allow for string replacement to pass input to the command
passed
:=
"[FAIL]"
if
suitePassed
{
passed
=
"[PASS]"
}
command
=
strings
.
Replace
(
command
,
"(ginkgo-suite-passed)"
,
passed
,
-
1
)
command
=
strings
.
Replace
(
command
,
"(ginkgo-suite-name)"
,
suite
.
PackageName
,
-
1
)
// Must break command into parts
splitArgs
:=
regexp
.
MustCompile
(
`'.+'|".+"|\S+`
)
parts
:=
splitArgs
.
FindAllString
(
command
,
-
1
)
output
,
err
:=
exec
.
Command
(
parts
[
0
],
parts
[
1
:
]
...
)
.
CombinedOutput
()
if
err
!=
nil
{
fmt
.
Println
(
"Post-suite command failed:"
)
if
config
.
DefaultReporterConfig
.
NoColor
{
fmt
.
Printf
(
"
\t
%s
\n
"
,
output
)
}
else
{
fmt
.
Printf
(
"
\t
%s%s%s
\n
"
,
redColor
,
string
(
output
),
defaultStyle
)
}
n
.
SendNotification
(
"Ginkgo [ERROR]"
,
fmt
.
Sprintf
(
`After suite command "%s" failed`
,
n
.
commandFlags
.
AfterSuiteHook
))
}
else
{
fmt
.
Println
(
"Post-suite command succeeded:"
)
if
config
.
DefaultReporterConfig
.
NoColor
{
fmt
.
Printf
(
"
\t
%s
\n
"
,
output
)
}
else
{
fmt
.
Printf
(
"
\t
%s%s%s
\n
"
,
greenColor
,
string
(
output
),
defaultStyle
)
}
}
}
}
Godeps/_workspace/src/github.com/onsi/ginkgo/ginkgo/run_watch_and_build_command_flags.go
View file @
57f62976
...
@@ -20,6 +20,7 @@ type RunWatchAndBuildCommandFlags struct {
...
@@ -20,6 +20,7 @@ type RunWatchAndBuildCommandFlags struct {
NumCompilers
int
NumCompilers
int
ParallelStream
bool
ParallelStream
bool
Notify
bool
Notify
bool
AfterSuiteHook
string
AutoNodes
bool
AutoNodes
bool
//only for run command
//only for run command
...
@@ -105,6 +106,7 @@ func (c *RunWatchAndBuildCommandFlags) flags(mode int) {
...
@@ -105,6 +106,7 @@ func (c *RunWatchAndBuildCommandFlags) flags(mode int) {
if
!
onWindows
{
if
!
onWindows
{
c
.
FlagSet
.
BoolVar
(
&
(
c
.
Notify
),
"notify"
,
false
,
"Send desktop notifications when a test run completes"
)
c
.
FlagSet
.
BoolVar
(
&
(
c
.
Notify
),
"notify"
,
false
,
"Send desktop notifications when a test run completes"
)
}
}
c
.
FlagSet
.
StringVar
(
&
(
c
.
AfterSuiteHook
),
"afterSuiteHook"
,
""
,
"Run a command when a suite test run completes"
)
}
}
if
mode
==
runMode
{
if
mode
==
runMode
{
...
...
Godeps/_workspace/src/github.com/onsi/ginkgo/ginkgo/suite_runner.go
View file @
57f62976
...
@@ -129,6 +129,7 @@ func (r *SuiteRunner) RunSuites(runners []*testrunner.TestRunner, numCompilers i
...
@@ -129,6 +129,7 @@ func (r *SuiteRunner) RunSuites(runners []*testrunner.TestRunner, numCompilers i
suiteRunResult
=
compilationOutput
.
runner
.
Run
()
suiteRunResult
=
compilationOutput
.
runner
.
Run
()
}
}
r
.
notifier
.
SendSuiteCompletionNotification
(
compilationOutput
.
runner
.
Suite
,
suiteRunResult
.
Passed
)
r
.
notifier
.
SendSuiteCompletionNotification
(
compilationOutput
.
runner
.
Suite
,
suiteRunResult
.
Passed
)
r
.
notifier
.
RunCommand
(
compilationOutput
.
runner
.
Suite
,
suiteRunResult
.
Passed
)
runResult
=
runResult
.
Merge
(
suiteRunResult
)
runResult
=
runResult
.
Merge
(
suiteRunResult
)
if
!
suiteRunResult
.
Passed
{
if
!
suiteRunResult
.
Passed
{
suitesThatFailed
=
append
(
suitesThatFailed
,
compilationOutput
.
runner
.
Suite
)
suitesThatFailed
=
append
(
suitesThatFailed
,
compilationOutput
.
runner
.
Suite
)
...
...
Godeps/_workspace/src/github.com/onsi/ginkgo/ginkgo/testrunner/test_runner.go
View file @
57f62976
...
@@ -100,11 +100,30 @@ func (t *TestRunner) CompileTo(path string) error {
...
@@ -100,11 +100,30 @@ func (t *TestRunner) CompileTo(path string) error {
return
fmt
.
Errorf
(
"Failed to compile %s"
,
t
.
Suite
.
PackageName
)
return
fmt
.
Errorf
(
"Failed to compile %s"
,
t
.
Suite
.
PackageName
)
}
}
if
fileExists
(
path
)
==
false
{
compiledFile
:=
filepath
.
Join
(
t
.
Suite
.
Path
,
t
.
Suite
.
PackageName
+
".test"
)
if
fileExists
(
compiledFile
)
{
// seems like we are on an old go version that does not support the -o flag on go test
// move the compiled test file to the desired location by hand
err
=
os
.
Rename
(
compiledFile
,
path
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"Failed to move compiled file: %s"
,
err
)
}
}
else
{
return
fmt
.
Errorf
(
"Failed to compile %s: output file %q could not be found"
,
t
.
Suite
.
PackageName
,
path
)
}
}
t
.
compiled
=
true
t
.
compiled
=
true
return
nil
return
nil
}
}
func
fileExists
(
path
string
)
bool
{
_
,
err
:=
os
.
Stat
(
path
)
return
err
==
nil
||
os
.
IsNotExist
(
err
)
==
false
}
/*
/*
go test -c -i spits package.test out into the cwd. there's no way to change this.
go test -c -i spits package.test out into the cwd. there's no way to change this.
...
...
Godeps/_workspace/src/github.com/onsi/ginkgo/ginkgo_dsl.go
View file @
57f62976
...
@@ -222,6 +222,17 @@ func buildDefaultReporter() Reporter {
...
@@ -222,6 +222,17 @@ func buildDefaultReporter() Reporter {
}
}
}
}
//Skip notifies Ginkgo that the current spec should be skipped.
func
Skip
(
message
string
,
callerSkip
...
int
)
{
skip
:=
0
if
len
(
callerSkip
)
>
0
{
skip
=
callerSkip
[
0
]
}
globalFailer
.
Skip
(
message
,
codelocation
.
New
(
skip
+
1
))
panic
(
GINKGO_PANIC
)
}
//Fail notifies Ginkgo that the current spec has failed. (Gomega will call Fail for you automatically when an assertion fails.)
//Fail notifies Ginkgo that the current spec has failed. (Gomega will call Fail for you automatically when an assertion fails.)
func
Fail
(
message
string
,
callerSkip
...
int
)
{
func
Fail
(
message
string
,
callerSkip
...
int
)
{
skip
:=
0
skip
:=
0
...
...
Godeps/_workspace/src/github.com/onsi/ginkgo/integration/run_test.go
View file @
57f62976
...
@@ -217,7 +217,7 @@ var _ = Describe("Running Specs", func() {
...
@@ -217,7 +217,7 @@ var _ = Describe("Running Specs", func() {
Eventually
(
session
)
.
Should
(
gexec
.
Exit
(
0
))
Eventually
(
session
)
.
Should
(
gexec
.
Exit
(
0
))
output
:=
string
(
session
.
Out
.
Contents
())
output
:=
string
(
session
.
Out
.
Contents
())
Ω
(
output
)
.
Should
(
MatchRegexp
(
`\[\d+\] Passing_ginkgo_tests Suite - 4/4 specs - 2 nodes •••• SUCCESS!
[\d.µs]+
`
))
Ω
(
output
)
.
Should
(
MatchRegexp
(
`\[\d+\] Passing_ginkgo_tests Suite - 4/4 specs - 2 nodes •••• SUCCESS!
\d+(\.\d+)?[muµ]s
`
))
Ω
(
output
)
.
Should
(
ContainSubstring
(
"Test Suite Passed"
))
Ω
(
output
)
.
Should
(
ContainSubstring
(
"Test Suite Passed"
))
})
})
})
})
...
@@ -232,7 +232,7 @@ var _ = Describe("Running Specs", func() {
...
@@ -232,7 +232,7 @@ var _ = Describe("Running Specs", func() {
if
nodes
>
4
{
if
nodes
>
4
{
nodes
=
nodes
-
1
nodes
=
nodes
-
1
}
}
Ω
(
output
)
.
Should
(
MatchRegexp
(
`\[\d+\] Passing_ginkgo_tests Suite - 4/4 specs - %d nodes •••• SUCCESS!
[\d.µs]+
`
,
nodes
))
Ω
(
output
)
.
Should
(
MatchRegexp
(
`\[\d+\] Passing_ginkgo_tests Suite - 4/4 specs - %d nodes •••• SUCCESS!
\d+(\.\d+)?[muµ]s
`
,
nodes
))
Ω
(
output
)
.
Should
(
ContainSubstring
(
"Test Suite Passed"
))
Ω
(
output
)
.
Should
(
ContainSubstring
(
"Test Suite Passed"
))
})
})
})
})
...
@@ -272,8 +272,8 @@ var _ = Describe("Running Specs", func() {
...
@@ -272,8 +272,8 @@ var _ = Describe("Running Specs", func() {
output
:=
string
(
session
.
Out
.
Contents
())
output
:=
string
(
session
.
Out
.
Contents
())
outputLines
:=
strings
.
Split
(
output
,
"
\n
"
)
outputLines
:=
strings
.
Split
(
output
,
"
\n
"
)
Ω
(
outputLines
[
0
])
.
Should
(
MatchRegexp
(
`\[\d+\] Passing_ginkgo_tests Suite - 4/4 specs •••• SUCCESS!
[\d.µs]+
PASS`
))
Ω
(
outputLines
[
0
])
.
Should
(
MatchRegexp
(
`\[\d+\] Passing_ginkgo_tests Suite - 4/4 specs •••• SUCCESS!
\d+(\.\d+)?[muµ]s
PASS`
))
Ω
(
outputLines
[
1
])
.
Should
(
MatchRegexp
(
`\[\d+\] More_ginkgo_tests Suite - 2/2 specs •• SUCCESS!
[\d.µs]+
PASS`
))
Ω
(
outputLines
[
1
])
.
Should
(
MatchRegexp
(
`\[\d+\] More_ginkgo_tests Suite - 2/2 specs •• SUCCESS!
\d+(\.\d+)?[muµ]s
PASS`
))
Ω
(
output
)
.
Should
(
ContainSubstring
(
"Test Suite Passed"
))
Ω
(
output
)
.
Should
(
ContainSubstring
(
"Test Suite Passed"
))
})
})
})
})
...
@@ -290,7 +290,7 @@ var _ = Describe("Running Specs", func() {
...
@@ -290,7 +290,7 @@ var _ = Describe("Running Specs", func() {
output
:=
string
(
session
.
Out
.
Contents
())
output
:=
string
(
session
.
Out
.
Contents
())
outputLines
:=
strings
.
Split
(
output
,
"
\n
"
)
outputLines
:=
strings
.
Split
(
output
,
"
\n
"
)
Ω
(
outputLines
[
0
])
.
Should
(
MatchRegexp
(
`\[\d+\] Passing_ginkgo_tests Suite - 4/4 specs •••• SUCCESS!
[\d.µs]+
PASS`
))
Ω
(
outputLines
[
0
])
.
Should
(
MatchRegexp
(
`\[\d+\] Passing_ginkgo_tests Suite - 4/4 specs •••• SUCCESS!
\d+(\.\d+)?[muµ]s
PASS`
))
Ω
(
outputLines
[
1
])
.
Should
(
MatchRegexp
(
`\[\d+\] Failing_ginkgo_tests Suite - 2/2 specs`
))
Ω
(
outputLines
[
1
])
.
Should
(
MatchRegexp
(
`\[\d+\] Failing_ginkgo_tests Suite - 2/2 specs`
))
Ω
(
output
)
.
Should
(
ContainSubstring
(
"• Failure"
))
Ω
(
output
)
.
Should
(
ContainSubstring
(
"• Failure"
))
Ω
(
output
)
.
ShouldNot
(
ContainSubstring
(
"More_ginkgo_tests Suite"
))
Ω
(
output
)
.
ShouldNot
(
ContainSubstring
(
"More_ginkgo_tests Suite"
))
...
@@ -313,7 +313,7 @@ var _ = Describe("Running Specs", func() {
...
@@ -313,7 +313,7 @@ var _ = Describe("Running Specs", func() {
output
:=
string
(
session
.
Out
.
Contents
())
output
:=
string
(
session
.
Out
.
Contents
())
outputLines
:=
strings
.
Split
(
output
,
"
\n
"
)
outputLines
:=
strings
.
Split
(
output
,
"
\n
"
)
Ω
(
outputLines
[
0
])
.
Should
(
MatchRegexp
(
`\[\d+\] Passing_ginkgo_tests Suite - 4/4 specs •••• SUCCESS!
[\d.µs]+
PASS`
))
Ω
(
outputLines
[
0
])
.
Should
(
MatchRegexp
(
`\[\d+\] Passing_ginkgo_tests Suite - 4/4 specs •••• SUCCESS!
\d+(\.\d+)?[muµ]s
PASS`
))
Ω
(
outputLines
[
1
])
.
Should
(
ContainSubstring
(
"Failed to compile C:"
))
Ω
(
outputLines
[
1
])
.
Should
(
ContainSubstring
(
"Failed to compile C:"
))
Ω
(
output
)
.
ShouldNot
(
ContainSubstring
(
"More_ginkgo_tests Suite"
))
Ω
(
output
)
.
ShouldNot
(
ContainSubstring
(
"More_ginkgo_tests Suite"
))
Ω
(
output
)
.
Should
(
ContainSubstring
(
"Test Suite Failed"
))
Ω
(
output
)
.
Should
(
ContainSubstring
(
"Test Suite Failed"
))
...
@@ -335,11 +335,11 @@ var _ = Describe("Running Specs", func() {
...
@@ -335,11 +335,11 @@ var _ = Describe("Running Specs", func() {
output
:=
string
(
session
.
Out
.
Contents
())
output
:=
string
(
session
.
Out
.
Contents
())
outputLines
:=
strings
.
Split
(
output
,
"
\n
"
)
outputLines
:=
strings
.
Split
(
output
,
"
\n
"
)
Ω
(
outputLines
[
0
])
.
Should
(
MatchRegexp
(
`\[\d+\] Passing_ginkgo_tests Suite - 4/4 specs •••• SUCCESS!
[\d.µs]+
PASS`
))
Ω
(
outputLines
[
0
])
.
Should
(
MatchRegexp
(
`\[\d+\] Passing_ginkgo_tests Suite - 4/4 specs •••• SUCCESS!
\d+(\.\d+)?[muµ]s
PASS`
))
Ω
(
outputLines
[
1
])
.
Should
(
ContainSubstring
(
"Failed to compile B:"
))
Ω
(
outputLines
[
1
])
.
Should
(
ContainSubstring
(
"Failed to compile B:"
))
Ω
(
output
)
.
Should
(
MatchRegexp
(
`\[\d+\] Failing_ginkgo_tests Suite - 2/2 specs`
))
Ω
(
output
)
.
Should
(
MatchRegexp
(
`\[\d+\] Failing_ginkgo_tests Suite - 2/2 specs`
))
Ω
(
output
)
.
Should
(
ContainSubstring
(
"• Failure"
))
Ω
(
output
)
.
Should
(
ContainSubstring
(
"• Failure"
))
Ω
(
output
)
.
Should
(
MatchRegexp
(
`\[\d+\] More_ginkgo_tests Suite - 2/2 specs •• SUCCESS!
[\d.µs]+
PASS`
))
Ω
(
output
)
.
Should
(
MatchRegexp
(
`\[\d+\] More_ginkgo_tests Suite - 2/2 specs •• SUCCESS!
\d+(\.\d+)?[muµ]s
PASS`
))
Ω
(
output
)
.
Should
(
ContainSubstring
(
"Test Suite Failed"
))
Ω
(
output
)
.
Should
(
ContainSubstring
(
"Test Suite Failed"
))
})
})
})
})
...
...
Godeps/_workspace/src/github.com/onsi/ginkgo/integration/skip_test.go
0 → 100644
View file @
57f62976
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
(
"skip_fixture"
,
pathToTest
)
})
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"
))
})
})
Godeps/_workspace/src/github.com/onsi/ginkgo/integration/suite_command_test.go
0 → 100644
View file @
57f62976
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
(
"suite_command_tests"
,
pathToTest
)
})
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
))
})
})
Godeps/_workspace/src/github.com/onsi/ginkgo/internal/failer/failer.go
View file @
57f62976
...
@@ -77,3 +77,16 @@ func (f *Failer) Drain(componentType types.SpecComponentType, componentIndex int
...
@@ -77,3 +77,16 @@ func (f *Failer) Drain(componentType types.SpecComponentType, componentIndex int
return
failure
,
outcome
return
failure
,
outcome
}
}
func
(
f
*
Failer
)
Skip
(
message
string
,
location
types
.
CodeLocation
)
{
f
.
lock
.
Lock
()
defer
f
.
lock
.
Unlock
()
if
f
.
state
==
types
.
SpecStatePassed
{
f
.
state
=
types
.
SpecStateSkipped
f
.
failure
=
types
.
SpecFailure
{
Message
:
message
,
Location
:
location
,
}
}
}
Godeps/_workspace/src/github.com/onsi/ginkgo/internal/failer/failer_test.go
View file @
57f62976
...
@@ -30,6 +30,22 @@ var _ = Describe("Failer", func() {
...
@@ -30,6 +30,22 @@ var _ = Describe("Failer", func() {
})
})
})
})
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
()
{
Describe
(
"Fail"
,
func
()
{
It
(
"should handle failures"
,
func
()
{
It
(
"should handle failures"
,
func
()
{
failer
.
Fail
(
"something failed"
,
codeLocationA
)
failer
.
Fail
(
"something failed"
,
codeLocationA
)
...
...
Godeps/_workspace/src/github.com/onsi/ginkgo/internal/leafnodes/runner.go
View file @
57f62976
...
@@ -68,8 +68,10 @@ func (r *runner) runAsync() (outcome types.SpecState, failure types.SpecFailure)
...
@@ -68,8 +68,10 @@ func (r *runner) runAsync() (outcome types.SpecState, failure types.SpecFailure)
done
:=
make
(
chan
interface
{},
1
)
done
:=
make
(
chan
interface
{},
1
)
go
func
()
{
go
func
()
{
finished
:=
false
defer
func
()
{
defer
func
()
{
if
e
:=
recover
();
e
!=
nil
{
if
e
:=
recover
();
e
!=
nil
||
!
finished
{
r
.
failer
.
Panic
(
codelocation
.
New
(
2
),
e
)
r
.
failer
.
Panic
(
codelocation
.
New
(
2
),
e
)
select
{
select
{
case
<-
done
:
case
<-
done
:
...
@@ -81,6 +83,7 @@ func (r *runner) runAsync() (outcome types.SpecState, failure types.SpecFailure)
...
@@ -81,6 +83,7 @@ func (r *runner) runAsync() (outcome types.SpecState, failure types.SpecFailure)
}()
}()
r
.
asyncFunc
(
done
)
r
.
asyncFunc
(
done
)
finished
=
true
}()
}()
select
{
select
{
...
@@ -93,8 +96,10 @@ func (r *runner) runAsync() (outcome types.SpecState, failure types.SpecFailure)
...
@@ -93,8 +96,10 @@ func (r *runner) runAsync() (outcome types.SpecState, failure types.SpecFailure)
return
return
}
}
func
(
r
*
runner
)
runSync
()
(
outcome
types
.
SpecState
,
failure
types
.
SpecFailure
)
{
func
(
r
*
runner
)
runSync
()
(
outcome
types
.
SpecState
,
failure
types
.
SpecFailure
)
{
finished
:=
false
defer
func
()
{
defer
func
()
{
if
e
:=
recover
();
e
!=
nil
{
if
e
:=
recover
();
e
!=
nil
||
!
finished
{
r
.
failer
.
Panic
(
codelocation
.
New
(
2
),
e
)
r
.
failer
.
Panic
(
codelocation
.
New
(
2
),
e
)
}
}
...
@@ -102,6 +107,7 @@ func (r *runner) runSync() (outcome types.SpecState, failure types.SpecFailure)
...
@@ -102,6 +107,7 @@ func (r *runner) runSync() (outcome types.SpecState, failure types.SpecFailure)
}()
}()
r
.
syncFunc
()
r
.
syncFunc
()
finished
=
true
return
return
}
}
Godeps/_workspace/src/github.com/onsi/ginkgo/internal/leafnodes/shared_runner_test.go
View file @
57f62976
...
@@ -96,6 +96,24 @@ func SynchronousSharedRunnerBehaviors(build func(body interface{}, timeout time.
...
@@ -96,6 +96,24 @@ func SynchronousSharedRunnerBehaviors(build func(body interface{}, timeout time.
Ω
(
failure
.
ForwardedPanic
)
.
Should
(
Equal
(
"ack!"
))
Ω
(
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>"
))
})
})
})
})
}
}
...
@@ -230,6 +248,23 @@ func AsynchronousSharedRunnerBehaviors(build func(body interface{}, timeout time
...
@@ -230,6 +248,23 @@ func AsynchronousSharedRunnerBehaviors(build func(body interface{}, timeout time
Ω
(
failure
.
ForwardedPanic
)
.
Should
(
Equal
(
"ack!"
))
Ω
(
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>"
))
})
})
})
})
}
}
...
...
Godeps/_workspace/src/github.com/onsi/ginkgo/internal/remote/aggregator.go
View file @
57f62976
...
@@ -209,7 +209,7 @@ func (aggregator *Aggregator) announceSpec(specSummary *types.SpecSummary) {
...
@@ -209,7 +209,7 @@ func (aggregator *Aggregator) announceSpec(specSummary *types.SpecSummary) {
case
types
.
SpecStatePending
:
case
types
.
SpecStatePending
:
aggregator
.
stenographer
.
AnnouncePendingSpec
(
specSummary
,
aggregator
.
config
.
NoisyPendings
&&
!
aggregator
.
config
.
Succinct
)
aggregator
.
stenographer
.
AnnouncePendingSpec
(
specSummary
,
aggregator
.
config
.
NoisyPendings
&&
!
aggregator
.
config
.
Succinct
)
case
types
.
SpecStateSkipped
:
case
types
.
SpecStateSkipped
:
aggregator
.
stenographer
.
AnnounceSkippedSpec
(
specSummary
)
aggregator
.
stenographer
.
AnnounceSkippedSpec
(
specSummary
,
aggregator
.
config
.
Succinct
,
aggregator
.
config
.
FullTrace
)
case
types
.
SpecStateTimedOut
:
case
types
.
SpecStateTimedOut
:
aggregator
.
stenographer
.
AnnounceSpecTimedOut
(
specSummary
,
aggregator
.
config
.
Succinct
,
aggregator
.
config
.
FullTrace
)
aggregator
.
stenographer
.
AnnounceSpecTimedOut
(
specSummary
,
aggregator
.
config
.
Succinct
,
aggregator
.
config
.
FullTrace
)
case
types
.
SpecStatePanicked
:
case
types
.
SpecStatePanicked
:
...
...
Godeps/_workspace/src/github.com/onsi/ginkgo/reporters/default_reporter.go
View file @
57f62976
...
@@ -65,7 +65,7 @@ func (reporter *DefaultReporter) SpecDidComplete(specSummary *types.SpecSummary)
...
@@ -65,7 +65,7 @@ func (reporter *DefaultReporter) SpecDidComplete(specSummary *types.SpecSummary)
case
types
.
SpecStatePending
:
case
types
.
SpecStatePending
:
reporter
.
stenographer
.
AnnouncePendingSpec
(
specSummary
,
reporter
.
config
.
NoisyPendings
&&
!
reporter
.
config
.
Succinct
)
reporter
.
stenographer
.
AnnouncePendingSpec
(
specSummary
,
reporter
.
config
.
NoisyPendings
&&
!
reporter
.
config
.
Succinct
)
case
types
.
SpecStateSkipped
:
case
types
.
SpecStateSkipped
:
reporter
.
stenographer
.
AnnounceSkippedSpec
(
specSummary
)
reporter
.
stenographer
.
AnnounceSkippedSpec
(
specSummary
,
reporter
.
config
.
Succinct
,
reporter
.
config
.
FullTrace
)
case
types
.
SpecStateTimedOut
:
case
types
.
SpecStateTimedOut
:
reporter
.
stenographer
.
AnnounceSpecTimedOut
(
specSummary
,
reporter
.
config
.
Succinct
,
reporter
.
config
.
FullTrace
)
reporter
.
stenographer
.
AnnounceSpecTimedOut
(
specSummary
,
reporter
.
config
.
Succinct
,
reporter
.
config
.
FullTrace
)
case
types
.
SpecStatePanicked
:
case
types
.
SpecStatePanicked
:
...
...
Godeps/_workspace/src/github.com/onsi/ginkgo/reporters/default_reporter_test.go
View file @
57f62976
...
@@ -27,7 +27,7 @@ var _ = Describe("DefaultReporter", func() {
...
@@ -27,7 +27,7 @@ var _ = Describe("DefaultReporter", func() {
reporterConfig
=
config
.
DefaultReporterConfigType
{
reporterConfig
=
config
.
DefaultReporterConfigType
{
NoColor
:
false
,
NoColor
:
false
,
SlowSpecThreshold
:
0.1
,
SlowSpecThreshold
:
0.1
,
NoisyPendings
:
tru
e
,
NoisyPendings
:
fals
e
,
Verbose
:
true
,
Verbose
:
true
,
FullTrace
:
true
,
FullTrace
:
true
,
}
}
...
@@ -249,8 +249,8 @@ var _ = Describe("DefaultReporter", func() {
...
@@ -249,8 +249,8 @@ var _ = Describe("DefaultReporter", func() {
spec
.
State
=
types
.
SpecStatePending
spec
.
State
=
types
.
SpecStatePending
})
})
It
(
"should announce the pending spec"
,
func
()
{
It
(
"should announce the pending spec
, succinctly
"
,
func
()
{
Ω
(
stenographer
.
Calls
()[
0
])
.
Should
(
Equal
(
call
(
"AnnouncePendingSpec"
,
spec
,
tru
e
)))
Ω
(
stenographer
.
Calls
()[
0
])
.
Should
(
Equal
(
call
(
"AnnouncePendingSpec"
,
spec
,
fals
e
)))
})
})
})
})
...
@@ -260,7 +260,7 @@ var _ = Describe("DefaultReporter", func() {
...
@@ -260,7 +260,7 @@ var _ = Describe("DefaultReporter", func() {
})
})
It
(
"should announce the skipped spec"
,
func
()
{
It
(
"should announce the skipped spec"
,
func
()
{
Ω
(
stenographer
.
Calls
()[
0
])
.
Should
(
Equal
(
call
(
"AnnounceSkippedSpec"
,
spec
)))
Ω
(
stenographer
.
Calls
()[
0
])
.
Should
(
Equal
(
call
(
"AnnounceSkippedSpec"
,
spec
,
false
,
true
)))
})
})
})
})
...
@@ -294,6 +294,24 @@ var _ = Describe("DefaultReporter", func() {
...
@@ -294,6 +294,24 @@ var _ = Describe("DefaultReporter", func() {
})
})
})
})
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 succinct mode"
,
func
()
{
Context
(
"in succinct mode"
,
func
()
{
BeforeEach
(
func
()
{
BeforeEach
(
func
()
{
reporterConfig
.
Succinct
=
true
reporterConfig
.
Succinct
=
true
...
@@ -337,7 +355,7 @@ var _ = Describe("DefaultReporter", func() {
...
@@ -337,7 +355,7 @@ var _ = Describe("DefaultReporter", func() {
spec
.
State
=
types
.
SpecStatePending
spec
.
State
=
types
.
SpecStatePending
})
})
It
(
"should announce the pending spec,
but never noisi
ly"
,
func
()
{
It
(
"should announce the pending spec,
succinct
ly"
,
func
()
{
Ω
(
stenographer
.
Calls
()[
0
])
.
Should
(
Equal
(
call
(
"AnnouncePendingSpec"
,
spec
,
false
)))
Ω
(
stenographer
.
Calls
()[
0
])
.
Should
(
Equal
(
call
(
"AnnouncePendingSpec"
,
spec
,
false
)))
})
})
})
})
...
@@ -348,7 +366,7 @@ var _ = Describe("DefaultReporter", func() {
...
@@ -348,7 +366,7 @@ var _ = Describe("DefaultReporter", func() {
})
})
It
(
"should announce the skipped spec"
,
func
()
{
It
(
"should announce the skipped spec"
,
func
()
{
Ω
(
stenographer
.
Calls
()[
0
])
.
Should
(
Equal
(
call
(
"AnnounceSkippedSpec"
,
spec
)))
Ω
(
stenographer
.
Calls
()[
0
])
.
Should
(
Equal
(
call
(
"AnnounceSkippedSpec"
,
spec
,
true
,
true
)))
})
})
})
})
...
...
Godeps/_workspace/src/github.com/onsi/ginkgo/reporters/stenographer/fake_stenographer.go
View file @
57f62976
...
@@ -117,8 +117,8 @@ func (stenographer *FakeStenographer) AnnouncePendingSpec(spec *types.SpecSummar
...
@@ -117,8 +117,8 @@ func (stenographer *FakeStenographer) AnnouncePendingSpec(spec *types.SpecSummar
stenographer
.
registerCall
(
"AnnouncePendingSpec"
,
spec
,
noisy
)
stenographer
.
registerCall
(
"AnnouncePendingSpec"
,
spec
,
noisy
)
}
}
func
(
stenographer
*
FakeStenographer
)
AnnounceSkippedSpec
(
spec
*
types
.
SpecSummary
)
{
func
(
stenographer
*
FakeStenographer
)
AnnounceSkippedSpec
(
spec
*
types
.
SpecSummary
,
succinct
bool
,
fullTrace
bool
)
{
stenographer
.
registerCall
(
"AnnounceSkippedSpec"
,
spec
)
stenographer
.
registerCall
(
"AnnounceSkippedSpec"
,
spec
,
succinct
,
fullTrace
)
}
}
func
(
stenographer
*
FakeStenographer
)
AnnounceSpecTimedOut
(
spec
*
types
.
SpecSummary
,
succinct
bool
,
fullTrace
bool
)
{
func
(
stenographer
*
FakeStenographer
)
AnnounceSpecTimedOut
(
spec
*
types
.
SpecSummary
,
succinct
bool
,
fullTrace
bool
)
{
...
...
Godeps/_workspace/src/github.com/onsi/ginkgo/reporters/stenographer/stenographer.go
View file @
57f62976
...
@@ -49,7 +49,7 @@ type Stenographer interface {
...
@@ -49,7 +49,7 @@ type Stenographer interface {
AnnounceSuccesfulMeasurement
(
spec
*
types
.
SpecSummary
,
succinct
bool
)
AnnounceSuccesfulMeasurement
(
spec
*
types
.
SpecSummary
,
succinct
bool
)
AnnouncePendingSpec
(
spec
*
types
.
SpecSummary
,
noisy
bool
)
AnnouncePendingSpec
(
spec
*
types
.
SpecSummary
,
noisy
bool
)
AnnounceSkippedSpec
(
spec
*
types
.
SpecSummary
)
AnnounceSkippedSpec
(
spec
*
types
.
SpecSummary
,
succinct
bool
,
fullTrace
bool
)
AnnounceSpecTimedOut
(
spec
*
types
.
SpecSummary
,
succinct
bool
,
fullTrace
bool
)
AnnounceSpecTimedOut
(
spec
*
types
.
SpecSummary
,
succinct
bool
,
fullTrace
bool
)
AnnounceSpecPanicked
(
spec
*
types
.
SpecSummary
,
succinct
bool
,
fullTrace
bool
)
AnnounceSpecPanicked
(
spec
*
types
.
SpecSummary
,
succinct
bool
,
fullTrace
bool
)
...
@@ -252,9 +252,21 @@ func (s *consoleStenographer) AnnouncePendingSpec(spec *types.SpecSummary, noisy
...
@@ -252,9 +252,21 @@ func (s *consoleStenographer) AnnouncePendingSpec(spec *types.SpecSummary, noisy
}
}
}
}
func
(
s
*
consoleStenographer
)
AnnounceSkippedSpec
(
spec
*
types
.
SpecSummary
)
{
func
(
s
*
consoleStenographer
)
AnnounceSkippedSpec
(
spec
*
types
.
SpecSummary
,
succinct
bool
,
fullTrace
bool
)
{
s
.
print
(
0
,
s
.
colorize
(
cyanColor
,
"S"
))
// Skips at runtime will have a non-empty spec.Failure. All others should be succinct.
s
.
stream
()
if
succinct
||
spec
.
Failure
==
(
types
.
SpecFailure
{})
{
s
.
print
(
0
,
s
.
colorize
(
cyanColor
,
"S"
))
s
.
stream
()
}
else
{
s
.
startBlock
()
s
.
println
(
0
,
s
.
colorize
(
cyanColor
+
boldStyle
,
"S [SKIPPING]%s [%.3f seconds]"
,
s
.
failureContext
(
spec
.
Failure
.
ComponentType
),
spec
.
RunTime
.
Seconds
()))
indentation
:=
s
.
printCodeLocationBlock
(
spec
.
ComponentTexts
,
spec
.
ComponentCodeLocations
,
spec
.
Failure
.
ComponentType
,
spec
.
Failure
.
ComponentIndex
,
true
,
succinct
)
s
.
printNewLine
()
s
.
printFailure
(
indentation
,
spec
.
State
,
spec
.
Failure
,
fullTrace
)
s
.
endBlock
()
}
}
}
func
(
s
*
consoleStenographer
)
AnnounceSpecTimedOut
(
spec
*
types
.
SpecSummary
,
succinct
bool
,
fullTrace
bool
)
{
func
(
s
*
consoleStenographer
)
AnnounceSpecTimedOut
(
spec
*
types
.
SpecSummary
,
succinct
bool
,
fullTrace
bool
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment