-
Notifications
You must be signed in to change notification settings - Fork 256
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
tests in different folders - godog with more than one TestMain #291
Comments
Currently it looks like I can choose between two options
I'm going with option 1 - at least the features are well separated, even if the implementations are not |
Hi, sorry for not answering here as well, but I guess we took it in real life. As I understand the problem; @martin-flower could you elaborate a bit more on why you need multiple TestMain? |
Let me see .. this was some time ago. The question I think was splitting up the tests into different go packages. At the moment all tests are in the same package. I would like to organise my code in different folders that focus on different parts of the application under test. And to be able to execute these tests from continuous integration with the test results visible in the test result tab. As happens with In addition, there was the question about not having the godog runtime in the build artifact. In summary, I think the outcome of the investigation was to have all godog tests in the same package - sharing one TestMain. |
It's imho violating separation-of-concerns to keep everything in a single package... In a reasonably large golang application, I definitely want my go source to be partitioned into several packages - but want to keep my specifications and features for the application in a single features directory... I did not get that to work - having multiple _test.go files with godog glue code results in
So it seems I can only put ALL step definitions into one (very very large) _test.go file (oops - don't want to do that), |
I ended up creating different directories per test suite: https://github.com/elastic/e2e-testing/tree/master/e2e/_suites
|
your e2e repo is an awesome example - thanx for this pointer!! |
I can run tests using the command
godog
, andgo test
(with TestMain)If I have two feature files, I can put them in separate folders, and run each one separately in their folder with
godog
orgo test
.I can run both from the parent folder using
go test ./...
I don't seem to be able to run all tests from the parent folder (was hoping that
godog ./...
would do this).I am prevented from having all my tests in the same folder due to having more than one TestMain.
How can I split up my tests into different files and folders?
In order to run the tests in the release pipeline, I would like to build everything into one executable using
godog -o
What is the best way forward?
The text was updated successfully, but these errors were encountered: