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

[Pester 4.0.2] Gherkin scenario counts are broken #714

Closed
Jaykul opened this issue Jan 30, 2017 · 9 comments
Closed

[Pester 4.0.2] Gherkin scenario counts are broken #714

Jaykul opened this issue Jan 30, 2017 · 9 comments
Milestone

Comments

@Jaykul
Copy link
Contributor

Jaykul commented Jan 30, 2017

The changes to how Describe and Context are handled in Pester 4 broke the output for Gherkin by flipping the values of "Context" and "Describe" in the $Pester.TestResult ...

I need to investigate further -- just wanted to log this here so we can be sure to fix it before release.

Any thoughts about how to include tests that fail so that I can test the result of failing tests ... without ... failing tests? (Wow, that's confusing).

@nohwnd nohwnd added this to the V4 milestone Jan 30, 2017
@Jaykul
Copy link
Contributor Author

Jaykul commented Jan 31, 2017

Just an update: I'm still working on this -- I updated Gherkin with the new options on Invoke-Pester, but the exact nature of how the Context and Describe are wrong eluded me today.

I did spend a little time playing with scoping in Gherkin to see if I can figure out how to make mocks and indeed, variables persist through the scopes that they should -- will need to work on that a little more.

@nohwnd
Copy link
Member

nohwnd commented Jan 31, 2017

I was just wondering how to tell that you are done with this, so just let me know when you feel like it's ready. Just a head up, as highlighted in #697 the mocks are currently working only for the first describe if the function is defined inside of describe, it's a bug, so don't get tripped by it.

@Jaykul
Copy link
Contributor Author

Jaykul commented Feb 6, 2017

As discussed in #721, I've changed Gherkin to run each "Scenario" as a "Describe" (aka Context), which I think work around that mocking problem and makes variable scoping work roughly the way I wanted it to.

The work for this is done now. All the tests pass on my box, so I'll wait for the build on the PR ;-)

I clearly need to add some additional tests, because I found a couple of things by running the gherkin tests on the dev branch of Configuration. I had to fix a few tests, because of the scoping changes, but I feel really good about that, because they were mostly sloppy scoping problems.

@Jaykul
Copy link
Contributor Author

Jaykul commented Feb 11, 2017

Ok, this is fixed @nohwnd, even works on PS2 now...

@ronaldborman
Copy link

Should this work in 4.0.3-rc? Because Scenarios Passed is 0 in a simple single scenario, although all steps passed. I'll try to investigate further if it should work.

@Jaykul
Copy link
Contributor Author

Jaykul commented May 22, 2017

Just saw this note -- I've been ignoring email. 😉 I'll look into it.

@nohwnd
Copy link
Member

nohwnd commented Aug 12, 2017

@Jaykul could you have a look pls?

@dlwyatt
Copy link
Member

dlwyatt commented Aug 13, 2017

The changes to how Describe and Context are handled in Pester 4 broke the output for Gherkin by flipping the values of "Context" and "Describe" in the $Pester.TestResult ...

Wait, what? Did they used to be backwards? Looks correct now:

ErrorRecord            :
ParameterizedSuiteName :
Describe               : PesterContain
Parameters             : {}
Passed                 : True
Show                   : All
FailureMessage         :
Time                   : 00:00:00.1634025
Name                   : returns true if the file contains the specified content
Result                 : Passed
Context                : when testing file contents
StackTrace             :


    Describe "PesterContain" {
        Context "when testing file contents" {
            Setup -File "test.txt" "this is line 1`nrush is awesome`nAnd this is Unicode: ☺"
            It "returns true if the file contains the specified content" {

@Jaykul
Copy link
Contributor Author

Jaykul commented Aug 15, 2017

I'm pretty sure this is fixed. There's a test in Gherkin.Tests.ps1 to ensure it stays that way. Need repro otherwise @ronaldborman

@Jaykul Jaykul closed this as completed Aug 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants