Skip to content
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

An option to run a specific section would be great #629

Closed
Eyenseo opened this issue Apr 2, 2016 · 8 comments
Closed

An option to run a specific section would be great #629

Eyenseo opened this issue Apr 2, 2016 · 8 comments

Comments

@Eyenseo
Copy link

Eyenseo commented Apr 2, 2016

Hello

I searched the tutorial and reference section but could not find anything about this.

I would like to be able to run a single section - meaning execute all 'parent' sections and don't execute the child sections.

My usecase is, that I setup the test data and test different things on the same setup. Once a test fails I need to fix that test, but if all sections are executed it is cumbersome to use breakpoints as most have to be skipped until the section of interest.

If there is a better test setup, please tell me.

Thank you!

@TorstenRobitzki
Copy link

Maybe it could be possible to make one test/section explicitly to be executed. I've tried to do this with add a tag, but it looks like that tags are only sampled at the highes level?

@Eyenseo
Copy link
Author

Eyenseo commented Apr 19, 2016

Yes ist seems that Tags are only applied to TEST_CASE but not SECTION, Tags would be a great way to implement my Request.

@tombh
Copy link

tombh commented Jan 13, 2017

I agree.

Should not the definition of a 'test' be any block from within which you enter the codebase you're testing? So if you can run main(), object.do() or whatever in a SECTION then so too should you be able to isolate execution of that test.

I would actually argue that without this TDD is, by principle, not possible.

@philsquared
Copy link
Collaborator

This has been a long standing and common (and understandable) request.
There are some problems with it that mean there is no ideal solution, but the basic principle of "only go into sections that I have specified" is possible - and indeed I have now implemented this on a locally branch and am testing it out!

The mechanism is via a new command line option, --section or -c. Each time you use this you can follow it with a section name, so for nested sections use multiple options. This is not terribly convenient for writing by hand (at least not with long section names), but at least gets us the first step of making it possible (and it turns out to be really useful for machine consumption - i.e. by test runner tools).

It doesn't currently support wildcards or tags - but I'll look at adding those later.

I'll be pushing - probably to a branch to begin with - soon.

@horenmar
Copy link
Member

This has shown up many times over the time, so I am linking some duplicates I found: #110, #276

@ruipacheco
Copy link

Do we have an ETA for the release of this feature?

@horenmar
Copy link
Member

horenmar commented Feb 1, 2017

@ruipacheco Partial support is in, see current release notes, or CLI documentation.

@philsquared
Copy link
Collaborator

While more could be done, I believe the feature that is in (with -c) is sufficient to close this ticket now (reopen if you disagree).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants