You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running Suite: Test Suite - /home/andrew/git/src/github.com/meln5674/test
==============================================================================
Random Seed: 1675107707
Will run 2 of 2 specs
------------------------------
foo should print foo
/home/andrew/git/src/github.com/meln5674/test/test_suite_test.go:16
foo
• [0.000 seconds]
------------------------------
foobar should print foobar
/home/andrew/git/src/github.com/meln5674/test/test_suite_test.go:22
foobar
• [0.000 seconds]
------------------------------
Ran 2 of 2 Specs in 0.000 seconds
SUCCESS! -- 2 Passed | 0 Failed | 0 Pending | 0 Skipped
PASS
Ginkgo ran 1 suite in 665.589296ms
Test Suite Passed
while running
ginkgo run -v --focus '^foo$'.
produces
Running Suite: Test Suite - /home/andrew/git/src/github.com/meln5674/test
==============================================================================
Random Seed: 1675107815
Will run 0 of 2 specs
SS
Ran 0 of 2 Specs in 0.000 seconds
SUCCESS! -- 0 Passed | 0 Failed | 0 Pending | 2 Skipped
PASS
Ginkgo ran 1 suite in 723.955755ms
Test Suite Passed
There doesn't appear to be a way to run foo but not foobar using --focus.
The text was updated successfully, but these errors were encountered:
hey - thanks for posting this here in addition to slack.
It took me a minute to recall why this wouldn't work, but - in short: when given a --focus filter Ginkgo will apply the regexp to the "full text" of a spec, which is the concatenation of the container strings + spec string. In this case there are two specs with full texts that look like:
"foo it should print foo"
"foobar should print foobar"
The regexp foo matches both of these. but ^foo$ matches neither.
I looked into it and, thankfully, you can use the word boundary regexp to require matching specs to strictly contain only foo:
ginkgo run -v --focus '\bfoo\b'
produces
Running Suite: Bar Suite - /Users/onsi/code/ginkgo/bar
======================================================
Random Seed: 1675108347
Will run 1 of 2 specs
------------------------------
foo should print foo
/Users/onsi/code/ginkgo/bar/bar_suite_test.go:16
foo
• [0.000 seconds]
------------------------------
S
Ran 1 of 2 Specs in 0.001 seconds
SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 1 Skipped
PASS
Given
running
produces
while running
produces
There doesn't appear to be a way to run
foo
but notfoobar
using--focus
.The text was updated successfully, but these errors were encountered: