-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
go-concourse: split tests based on the client type used #800
Conversation
"github.com/tedsuo/rata" | ||
) | ||
|
||
var _ = Describe("HTTPAgent Client", func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I want to do the equivalent of go test -run Foo
, is there a way with ginko? Would it use this name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will check, but I am not invoking ginkgo directly... I am invoking go test...
so in internal_suite_test.go
we have:
func TestInternal(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Internal Suite")
}
so the test name is actually: TestInternal
and it contains actually all these 16 "specs".. So in my understanding you can't actually run only HTTPAgent Client
without running also: ATC Connection
.
I manage to run only these 16 specs by using:
go test -v ./go-concourse/... --run TestInternal
I didn't yet manage to achieve the same with ginkgo...
> ginkgo --focus "TestInternal" ./go-concourse/...
runs all... 16 specs from TestInternal
and TestApi
...
and furthermore, I for sure didn't manage to run a single test (or "spec" how they call it)
Update:
- this seems to work...
go test -v -count=1 -short -coverprofile=.coverprofile.out ./go-concourse/... -ginkgo.focus "HTTPAgent"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh finallly... I had wrong version of ginkgo installed... I was still at v1... while our tests require v2...
With v2 -focus flag works fine...
ginkgo -v -focus "HTTPAgent Client" -r ./go-concourse/...
See: onsi/ginkgo#1189
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK thanks. I think that it will be helpful to add a section to the README of the ci repo on how to run Ginko tests.
Now, if we can instead always invoke go test -run X
, where X is a special string that matches ginko, we can write also that command for sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
go-concourse: split tests based on the client type used
commit 1: connection fakes are unused. lets removed them and never generate them
commit 2: remove HTTP agent test from connection test suite
commit 3: create
go-concourse/concourse/internal/http_agent_test.go
and add back the test removed in commit 2Test coverage percentage remained the same...
I like this PR because if connection client is deprecated, its even more important to keep the test for the HTTPAgent separate and clean... If they are mixed like there were before, its easy to remove the HTTPAgent test by accident when connection client really gets removed..
I didn't change a single line... stuff were just moved or removed...