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

Provide command to skip a test #178

Open
blueyed opened this issue Sep 3, 2018 · 3 comments
Open

Provide command to skip a test #178

blueyed opened this issue Sep 3, 2018 · 3 comments

Comments

@blueyed
Copy link
Collaborator

blueyed commented Sep 3, 2018

This should add a log message.
Internally it likely should throw an exception that gets caught/handled by Vader then, e.g. VaderSkipTest: reason.

Should be done on top of #107 .

@MisanthropicBit
Copy link

I recently needed this exact functionality and started a fork that provides a SkipIf command. I would greatly appreciate some feedback if you've already given this some thoughts. Here are mine so far.

  • So far eval is used to evaluate the condition for skipping. Although this is generally frowned upon in other languages, it is ok here since you did write the tests yourself.
  • The s:execute function does not really work here since we need the result of evaluating an expression not the result of sourcing a file. Alternatively, one could use something like Assert and friends to evaluate the condition given as argument.

The SkipIf command works for my tests right now and looks like this:

SkipIf (<reason for skipping>):
  <expression to evaluate, test is skipped if it returns 1>

The output appears in the quickfix window after running the Vader command and skipped tests are correctly marked as pending.

test.vader|72 S| reason for skipping: <reason for skipping goes here>

I don't throw an exception right now but simply use a continue in the loop over each test case. The next step is to write some tests for the command itself.

@blueyed
Copy link
Collaborator Author

blueyed commented Sep 25, 2019

@MisanthropicBit
Thanks!
Please consider creating a PR already to better see the code etc.
Also pay attention to the summary / count, of course (if you have not already).

@MisanthropicBit
Copy link

Please consider creating a PR already to better see the code etc.

Sure. I'll fix up the code to make it a bit more PR-worthy.

Also pay attention to the summary / count, of course (if you have not already).

Yes, that should already work correctly but I'll double-check to make sure.

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

2 participants