Skip to content

add task runner for Pester #97

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

Merged
merged 1 commit into from
Feb 13, 2016
Merged

add task runner for Pester #97

merged 1 commit into from
Feb 13, 2016

Conversation

mgreenegit
Copy link
Member

Adding to the example seems to be the best option?

@msftclas
Copy link

Hi @mgreenegit, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!


It looks like you're a Microsoft contributor (Michael Greene). If you're full-time, we DON'T require a Contribution License Agreement. If you are a vendor, please DO sign the electronic Contribution License Agreement. It will take 2 minutes and there's no faxing! https://cla.microsoft.com.

TTYL, MSBOT;

@rkeithhill
Copy link
Contributor

Cool. We just added support for debugging in either a 32-bit or 64-bit host process. Do you think it would be useful to have two tasks? One that is architecture neutral (run 64-bit PowerShell on a 64-bit OS and 32-bit PowerShell on a 32-bit OS) where I think you use sysnative and then also have a x86 runner that on a 64-bit OS invokes PowerShell from the SysWOW64 dir.

Also, seems like it would be useful to set the current working directory in the PowerShell process. I'm not sure if you could pluck the "cwd" value from the launch.json file or maybe we just use ${workspaceRoot} or you add a user configurable cwd property in the tasks.json file? Thoughts?

@daviwil
Copy link
Contributor

daviwil commented Feb 11, 2016

Yep, I was also about to comment about the c:\Windows\sysnative bit. Probably good to have separate x64/x86 tasks. I would guess that the VS Code workspace variables apply but the task may need to have its own cwd variable if necessary.

@rkeithhill
Copy link
Contributor

I'm still learning about tasks. I see this PR puts a tasks.json file in the examples\.vscode dir. So does the user have to create this tasks.json file all the time? Is there a way to "auto-generate" the file into their .vscode directory like the launch.json does?

@rkeithhill
Copy link
Contributor

I'm working on a problemMatcher for this but Pester's output is note conducive to working well with VSCode problemMatchers. I filed an issue with Pester. But this would be cool (if it worked consistently):
vscodepesterproblemmatcher

Also @mgreenegit, could you change the path to powershell slightly. Try using:

    // Start PowerShell
    "command": "${env.windir}\\sysnative\\windowspowershell\\v1.0\\PowerShell.exe",

As for the bit on 32-bit vs 64-bit, let's hold off on that until the VSCode team implements variations of OS support that include winx86.

@rkeithhill
Copy link
Contributor

OK I'm going to merge this. This is a great examples of using a task in VSCode. I will tweak it a bit to add some problem matchers.

rkeithhill added a commit that referenced this pull request Feb 13, 2016
@rkeithhill rkeithhill merged commit dfa0d00 into PowerShell:master Feb 13, 2016
@daviwil
Copy link
Contributor

daviwil commented Feb 13, 2016

Sorry I didn't respond sooner, merging it seems to be the right thing to do for now. We can figure out how to enable this as a standard task later.

@rkeithhill
Copy link
Contributor

I have a comment into an existing VSCode issue. Looks like this isn't supported yet. microsoft/vscode#2263

@rkeithhill
Copy link
Contributor

Woudn't it be better to use -ExecutionPolicy Bypass as additional argument to -NoProfile ?

FYI, I'm going to get this change in for 0.5.0. I'm also working with @dlwyatt to try to get an updated output format for Pester that works better with VSCode's problem matchers. See pester/Pester#479.

@daviwil
Copy link
Contributor

daviwil commented Feb 29, 2016

👍 💯

@dfinke
Copy link
Contributor

dfinke commented Feb 29, 2016

@rkeithhill Just want to be sure. If I were to fully demo this, I'd need the latest bits from vscode-powershell and pester and they'd need to all come from github?

@daviwil
Copy link
Contributor

daviwil commented Feb 29, 2016

Dave says he'll release a Pester update tonight with the new changes to enable VS Code markers. That would just require the vscode-powershell changes from GitHub. You won't need to change Editor Services.

@dfinke
Copy link
Contributor

dfinke commented Feb 29, 2016

Great. Will he publish it to the gallery?

@daviwil
Copy link
Contributor

daviwil commented Feb 29, 2016

I believe so, yeah.

@rkeithhill
Copy link
Contributor

And I need to update the example\tasks.json to use the new Pester option and new problemMatcher. I would like to test with the official Pester 3.4.0 before checking this in, but @dfinke if you need it sooner, I could email the file to you.

@dfinke
Copy link
Contributor

dfinke commented Mar 1, 2016

No rush. Prepping a demo for 3/25

@dlwyatt
Copy link

dlwyatt commented Mar 1, 2016

Trying to publish Pester 3.4.0 now, but that build step is suddenly failing (complaining about calling ShouldContinue in NonInteractiveMode. Publish-Module behavior has changed, I think.) Should have it sorted out soon.

@dlwyatt
Copy link

dlwyatt commented Mar 1, 2016

Done: http://www.powershellgallery.com/packages/Pester/3.4.0 . Publish-Module put up a good fight, but I beat it into submission eventually. ;)

@rkeithhill
Copy link
Contributor

Way cool. Thanks! I look forward to continuing to improve the VSCode/PowerShell/Pester integration. VSCode still has a ways to go but we will keep chipping away at it. I'm looking forward to a VSCode release when they will have a better story for allowing extensions to contribute to the configuration of tasks.json files. :-)

@daviwil
Copy link
Contributor

daviwil commented Mar 1, 2016

Thanks a lot for the integration help, Dave! I'd eventually love to wire up test coverage markers for Pester like Wallaby.js has:

Wallaby.js

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

Successfully merging this pull request may close these issues.

6 participants