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

Report skipped Mocha tests as "Skipped" #1557

Merged
merged 3 commits into from
May 18, 2017

Conversation

ozyx
Copy link
Contributor

@ozyx ozyx commented May 4, 2017

Issue #1555

Bug

Skipped Mocha tests using it.skip() are reported as "Failed" by TestExecutor

Fix

Use Mocha pending event to enable TestExecutor to report skipped Mocha tests as "Skipped"

Testing

Create some Mocha tests such as:

var assert = require('assert');
var mocha = require('mocha');

describe('Test Suite 1', function () {

    it.skip('SkipTest', function () {
        assert.ok(true, "This shouldn't fail");
    });

    it('NotSkipTest', function () {
        assert.ok(true, "This shouldn't fail");
    });

    it('FailTest', function () {
        assert.ok(false, "This should fail");
    });

    it.skip('AlsoSkipTest', function () {
        assert.ok(true, "This shouldn't fail");
    });
})

Run tests using TestExplorer (RunAll or individually)
Tests marked with it.skip() should be reported as "Skipped"

@fforjan
Copy link

fforjan commented May 4, 2017

@ozyx do you know where TestOutcome.Skipped is coming from ?
When I look at the MSDN, https://msdn.microsoft.com/en-us/library/microsoft.visualstudio.testtools.common.testoutcome.aspx, I wasn't able to find this specific enum value

@ozyx
Copy link
Contributor Author

ozyx commented May 5, 2017

TestOutcome.Skipped is coming from Microsoft.VisualStudio.TestPlatform.ObjectModel.

@paulvanbrenk paulvanbrenk requested a review from billti May 5, 2017 19:44
@paulvanbrenk paulvanbrenk self-assigned this May 5, 2017
@fforjan
Copy link

fforjan commented May 15, 2017

@paulvanbrenk @billti I was wondering, what is your expected timeline while answering to pull request like this from the community ? We've allocated some time to our team members, typically @ozyx previously to contribute and work with you but it's difficult to explain to our management team that, yes, the code we have contributed is pushed for more than a sprint and we can't claim that the code is merge and accepted by the Microsoft team.
What should we expect from you (as a project) ?

@paulvanbrenk
Copy link
Contributor

First of all, I want to say thank you for your contributions, we do really appreciate them.

The reason we're hesitant in taking this particular PR, is that the testadapter is at a crossroads. One of our partner teams has taken the code, and they are in the process to make it work with other projects, e.g. ASP.NET and UWP, and such take it out of the NTVS package. While, at the same time we're stabilizing the 1.3 release. So, as you can imagine, we're a little hesitant to take any changes there.

So, long story short. This particular PR, happens to come at an unfortunate moment in the development cycle, but in general we should get back to you within the week.

@billti
Copy link
Member

billti commented May 15, 2017

I'd also add that while appreciated and helpful, contributions are not "free" on this end. For example, the previous contribution you allude to above was great to get in the product, but it still took days of work to get the code tested and working in all required scenarios before I could merge it.

Accepting/merging any non-trivial change has a cost on the team, and thus if it's not a feature or fix we already had planned for the milestone, has to be prioritized with other work we already have on our plate.

Apologies for the delay. We'll try and look at it shortly.

@fforjan
Copy link

fforjan commented May 15, 2017

Thanks, it wasn't clear from your side of the status on this one.
Just a small word on the previous contribution, we work with you guys to address your feedback, it was initially started in October, last modification in December without feedback and merge recently....
Meaning It took 6 months for us to claim that work done- meaning we could have also help you to complete the work if it was requested on time :)

On our side we are interested to provide inputs, for those 2 contributions, there is one other defect under my name we will try to correct. But unfortunately, I cannot use this a good example about our contributions to this project :(

Let's say both of those are coming at the wrong time (the previous one before VS2017 stabilization) and this one before your 1.3 stabilization. Is there any 'windows' for stabilizing or when pull request will be in filter mode available somewhere ? Or is it something you could consider to make visible ?

PS: not trying to defend we did all good or saying you're doing the bad job, but as we did allocate resources on the previous pull request, I don't have a good track record a the moment :/

}
break;
case "pending":
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing whitespace on this line. Please remove.

result.EndTime = DateTimeOffset.Now;
result.Duration = result.EndTime - result.StartTime;
result.Outcome = resultObject.passed ? TestOutcome.Passed : TestOutcome.Failed;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove trailing whitespace

@@ -162,29 +178,21 @@ var run_tests = function (testCases, callback) {
post({
type: 'result',
title: result.title,
result: result
result: result,
pending: false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to report the 'pending' property here, it is unused. It is only used from the 'result' object.

});

runner.on('fail', function (test, err) {
result.passed = false;
post({
type: 'result',
title: result.title,
result: result
result: result,
pending: false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above - 'pending' property is superfluous and unused. Please remove.

@billti
Copy link
Member

billti commented May 18, 2017

A couple of minor changes, else looks good. Please port the the v1.3.x branch too.

Thanks!!

@billti billti merged commit 0d5fab7 into microsoft:master May 18, 2017
@ozyx
Copy link
Contributor Author

ozyx commented May 18, 2017

@billti Awesome, thanks. Just a clarification -- by "port the v1.3.x branch" you mean request to merge these changes into that branch, as well? Just want to make sure before doing anything.

@billti
Copy link
Member

billti commented May 18, 2017

We can do that tomorrow. No problem.

The 1.3 release we just did for VS 2015 was going to be our last. Are you guys on VS2017 yet, or still VS 2015. If you need this for VS 2015 we can spin one more official build with it.

@ozyx
Copy link
Contributor Author

ozyx commented May 18, 2017

Yes the team is using VS2015 and will be for the foreseeable future, so getting a build with these changes included will be tremendously helpful. Thanks much!

@fforjan
Copy link

fforjan commented May 19, 2017

@billti @paulvanbrenk Thanks for the merge ! Next time you're in orange county, CA, beers are on me !

@paulvanbrenk
Copy link
Contributor

I noticed you have created #1561 too, is this something you want to take a crack at?

I want to hold off on doing another build till sometime next week, to see if we have more critical feedback we should address.

Thanks!

@ozyx
Copy link
Contributor Author

ozyx commented May 19, 2017

@paulvanbrenk Yes, if we could get that fix in the next build also that would be ideal. I've already started work on a potential fix, so I'll just open another PR when that's ready.

Thanks again for all your help.

@ozyx ozyx deleted the mocha-skip-support branch August 14, 2024 20:23
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.

5 participants