-
Notifications
You must be signed in to change notification settings - Fork 4
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
CLI runner support #15
Comments
There is no CLI at the moment. However, the VS Code extension and the Roblox Studio plugin are separate. If you are interested in building something of the sort, you can use the existing Studio extension, and then implement a HTTP server with the API similar to here: Hope this info is of help 🙂 Unfortunately, at the moment not focusing on Roblox so much. |
@tacheometry Is there any chance you could document the API surface for me? I'm interested in making a standalone server in Rust to resolve this issue, since I don't use VSCode anymore, but I'm having a hard time parsing the JS server code in this project. |
Terminology:
The Studio source code should also be of use: https://github.com/tacheometry/testez-companion/blob/main/plugin/src/plugin.server.lua - that's where all the requests are made, and it's only ever Studio -> localhost, not the other way around. Whenever the user wants to run tests in a place, the HTTP server starts listening. After it gets test results or a couple hundred milliseconds pass, it closes. This has been done this way (opposed to having a server constantly open) to support having multiple VSCode windows and multiple Studio windows open at the same time, since each VSCode window runs its own instance of the Companion extension, and each Studio instance runs its own plugin instance, but you're only ever running tests in a single project at once. If multiple Studio instances are open, the user is prompted to select which one to run tests in. In a loop, the Studio plugin calls GET to The server keeps the requests from each Studio place hanging, while also keeping the place identifiers in memory. After ~900 milliseconds pass since pressing the "run tests" button and starting the server, it responds to each request. By this time, the extension/user should have decided which place to run tests in (by choosing a
After the Studio plugin gets the OK response, it starts running the tests. Either way, it keeps polling the address with While the tests run, if any Studio console logs are printed, each log will get POSTed to the {
"message": "Hello world",
"messageType": 0
} For the Once TestEZ finishes running the tests, it forwards the results to the plugin, which will then POST to For an example of what gets sent to Finally, now that results have been received, the HTTP server can close and they can be displayed in the interface/CLI... This is the Studio place I used to test the project, with failing/passing/skipped tests: https://github.com/tacheometry/testez-basic-place. Check it out - should save some time instead of scaffolding one yourself. Summary:
(again) These are the files I definitely recommend looking at:
Hope this helps 👍 If you make the project public I can definitely link it in Companion's README |
Thank you for this write up! I really appreciate your time effort here. I am getting to work on this soon. |
@tacheometry https://github.com/jackTabsCode/testez-companion-cli It's not finished quite yet (doesn't support logging, and probably should install the plugin for you), but the basic functionality should be there! |
@jackTabsCode This is great! I added it to the README |
BTW, don't forget to add a license file 👌 |
Whoops, that got missed! |
Hello, how can I run a test file from CLI command?
The text was updated successfully, but these errors were encountered: