Luau open cloud execution should provide an environment similar to Studio

As a Roblox developer, it is currently quite difficult to write tests for plugins that run in CI. The Luau execution endpoints that let you run code in Roblox’s engine using open cloud would be ideal for this, but unfortunately it is not a good fit for Roblox plugins. This is because Studio’s environment is different than that of a game server in several key ways, and so it’s not possible for code that runs in Studio to run in a normal server.

Earlier today, I tried to get the tests for Rojo’s plugins running in CI because we currently do not have them running automatically… Which means they really don’t get run except whenever someone remembers. Ideally, we would just run them automatically, so I wrote some code to do just that. Happily, it worked… but it revealed that we cannot actually use it without modifying plugin code.

Right now, we are running into trouble because a few services we use don’t exist in a normal server:


We also run into trouble because these scripts are being ran as normal scripts rather than as a plugin:
image

We can fix these issues, but it is a hindrance and requires modifying our code so that tests can run in CI when we can run them locally just fine. I want Roblox to instead provide us an environment where this code could run as if it was in Studio and not error.

If Roblox were to add an environment that mimicked Roblox Studio to the open cloud Luau execution endpoint, it would improve my life as a developer because I wouldn’t have to code around running code with these endpoints, and I could instead just focus on improving the plugin.

5 Likes

Are you asking for a Headless Studio? That would be great honestly, if they’d let us choose which environment we’d want for cloud run

No, I’m asking for a studio-like environment for the opencloud execution stuff. Don’t get it twisted.

Aren’t there certain plugin APIs that Rojo uses that simply wouldn’t work on a headless client, like serialization and webhooks? Or do you expect those to somehow be emulated?

A lot of the code we test isn’t actually related to any of that, it just happens to depend upon code that indexes stuff that doesn’t work in a live game. We can fix that, but it’s time consuming and tedious work that doesn’t accomplish anything except making testing easier. In the case of stuff like services, it would also require us to just not follow best practices by inlining GetService, which sucks.

Networking is its own challenge but the theory there is that we could just run tests assuming the web endpoints responded with certain inputs rather than having to use Rojo’s server. We don’t do that at the moment but it’s reasonable enough to mock.

Again, I’m not really asking for a headless client. I mostly just want to not have to change our code and jump through hoops to run our tests in open cloud.

1 Like