-
Notifications
You must be signed in to change notification settings - Fork 52
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
Convert to native test API #90
base: main
Are you sure you want to change the base?
Conversation
Awesome! Do you want a review now (well, now-ish, I definitely won't get to it tonight) or should I wait until it's out of the draft state? |
Wow that's fast! 😁 You're welcome to take a look if you'd like, but I still need to go through the framework specific parts of the test runner and update the tests I also probably need to put the sorting code back in, during test loading but it's commented for now to keep things simpler until I get it running I hope that it's ok that I'm rearranging things a fair bit. I'll update the PR description with an in-depth description of the changes once it's closer to being ready as well The short version is:
I think that's most of it :) But yeah, as implied by what description is already there I got a bit fed up with it having to reload all the tests every time I changed one and I wanted to fix that. Long story short, the fact that the native API makes it much easier to manipulate the list of tests means this seemed like it was worth doing first |
I guess most of that didn't really answer the question... No rush at all! I like to make draft PRs early so I can check the diffs, and in case anyone wants to see the in progress work, but it's draft because it's still a fair way off being something I'd put up for review |
… on startup using glob I can actually run tests with it and have it go green again \o/
For some reason I can't revert to the released version so I need to be able to run tests again on my work laptop >_<
I haven't abandoned this. I broke a rib and haven't been able to code much outside of work since, and work itself has been pretty busy. I intend to finish it :) |
😱 I hope you're recovering well! No rush, thank you for the update! |
Still need to resolve the conflicts but I've applied the same fix so that the behaviour works in both branches at least :) |
@Tabby Thank you for taking a stab at this. This is amazing! |
Thanks for all this work! Need more beta testers? Do I check out the PR branch and build the extension and then install it? |
@navels Beta testers would be great, though there's a few known issues to be aware of that I've not had time to fix yet. I think they're all listed in this conversation somewhere, and I've added them to the TODO checklist in the description. I need to move them somewhere more easily readable, but I'd rather just fix them. I'm hoping to soon get some time to make some good progress. Off the top of my head, major known issues are (in rough order of my prioritisation for fixing them):
Pretty sure those last two are also issues in the main branch, but I want to get them sorted And yes, to try it just check out this branch and run the following commands from the repository folder to build:
That should give you a |
Great, I'll give it a go. None of those issues are a blocker for me. |
Running tests works, but first try to debug a single test seems hung with this in the log:
FYI I am using the extension in a docker container through the Dev Containers extension. Stop button no workie, extension claims to be running tests, had to reload vscode and open a shell in the container and kill the still-running Tried again, same result. |
Thanks for the report! I've still yet to check debugging tests, or running in a Dev container at all actually (same goes for any other kind of remote workspace) so either of those might just be broken at the moment, but I'll make a note to look into it as they're all things that will need to work :) |
Is it straightforward to run/debug the extension itself from vscode? I'd be happy to help. |
Good question >_> I'm not actually sure. I generally try and write unit/integration tests for things that aren't working, get them passing and then look at logs while trying to use the extension normally to figure out if it's doing the right thing. I've not actually tried running/debugging it from the project, largely because then I can test while doing my day job. I can have a look later and try it, and write up some instructions if that's helpful? And if you want to and can help then please do :D. Though the next change I need to make will be a potentially quite big refactor, so it might be best to wait until that's in, and I will try and get that done this week |
Gotcha, gotcha . . . I will try to get up to speed on either approach but won't try to do much with it given a refactor is coming. And I also have a day job that is keeping me particularly busy atm so take your time responding to my questions, I am not spinning my wheels waiting to work on this :-) |
I can make a slack/discord for coordinating on this (unless @connorshea would rather do so) as that might be easier than trying to communicate in this thread What do y'all think? |
I was thinking the same. Prefer slack over discord but either works, just that I can go for days without remembering to open Discord :-) |
I'm fine either way 👍 |
I've made a Slack for this, invite link is https://join.slack.com/t/slack-ozc7095/shared_invite/zt-1to8gtadd-n~RYAg6XZmp4gfczRFdryw I'm also going to create Issues (in my fork) for the various major changes that need doing on this PR so separate out discussions a bit more and make it easier to find relevant context. I'll make sure to detail what my thoughts are on how I was planning on approaching each one, but if others have ideas on how to do things better then we can totally discuss them. I'm not arrogant enough to think my plans are going to be perfect :P And lastly, I'm hoping to get at least the worst parts of the refactoring I want to do done today so that it's in a better place for having more collaborators which it needs because I'm kinda burning out a little on this but I really want to see it through >_> |
Fixes the issue of test loads blocking test runs - now the two can happen in parallel
Hey, that's amazing, would love to see this shipped such that the native Test API is used! Are there any updates? At least, we now have the native Test UI since
At MaMpf, I've written this Python file. We use the following setting to point the extension to this file and execute it for the tests:
It works flawlessly for us with proper error reporting if tests fail. |
I've not had a chance to work on this for a while as I got kinda burned out and couldn't get any clear feedback on what needed to be done for it to be considered mergeable, but I agree that it would be great to get it finished off. I'll try and carve out some time to make some more progress on it soon :) |
No worries, your health is for sure top priority. Take your time. |
Rewrite the extension to use the new native test API in Visual Studio Code, instead of the Test Explorer Extension API
Why?
Mostly the first one. I think this will allow some massive time savings in only re-checking test files that have changed and updating a subset of the list of tests when a file save event is received, instead of reloading the entire list
Changes
TestController
and one or more (2 in this case, run and debug) run configurations. The run configurations each get passed a lambda on construction which is called when the user runs/debugs the testsitems
which replaces the root node and should be populated after subscription.controller.items
is aTestItemCollection
(essentially aTestItem[]
but more limited, and presumably the methods available are thread safe)TestInfo
s have becomeTestItem
s, and so haveTestInfoSuite
s asTestItem
has achildren
field which is also aTestItemCollection
so we no longer need to distinguish between tests and suitesrequest
object with a list of tests to include and exclude (if include is empty, run all tests), aTestRun
object for signalling test statuses instead of the events that were fired before, and a cancellation token which should make cancelling easierTODO
Refactor test runs to also use the queue and simplify cancellation handlingAllow test loads to happen in parallel to test runs by not using a TestRunProfile for them