[Beta] Open Cloud Engine API for Executing Luau

Are we going to get an OAuth2 scope for this?

1 Like

would i be able to use websocket for this?

if no will this ever support websocket?

Need a way to determine running in cloud environment and a way to determine if a service is available in cloud environment


The script runs in Server context only right?


cc @DevelopmentDeadline , @PureBigMadBoatMan, @icemountainrbx

2 Likes

Iā€™m using this API to bootstrap TestEZ tests in my game. How do I determine if Iā€™m currently in a testing environment? For example, I want to use a mock datastore in my tests instead of DataStoreService, because itā€™s not supported.

RunService wonā€™t provide any useful information (IsStudio() returns false, but thatā€™s probably expected.)

@DevelopmentDeadline

1 Like

This might be janky, but I just put this at the top of the source I was sending:
workspace:SetAttribute("IS_AUTO_TEST_ENVIRONMENT", true)

3 Likes

Iā€™m finding the docs rather confusing; if not for the example scripts provided, Iā€™m not sure Iā€™d actually know how to use this.

I canā€™t really give a specific example of whatā€™s wrong with them beyond saying that itā€™s really not clear what the actual format of requests are and what the results are. Iā€¦ assume that LuauExecutionSessionTask is the request format and then itā€™s reused for the result, but with the fields that are marked as ā€œOutput Onlyā€ included? If this is the case, why would it not be documented as two distinct structs? It feels like an implementation detail being leaked to users.

Some clarification would be helpful!

2 Likes

Something Iā€™ve noticed is that the LuauExecutionSessionTaskLog seems to not differentiate between the types of output that can exist.

You can run code like this, which should put 4 different types of text in the Output:

local TestService = game:GetService("TestService")
TestService:Message("test blue")
warn("test yellow")
TestService:Error("test red")
print("test normal")

However, theyā€™re all indistinguishable from one another when retrieved with the OpenCloud Luau Execution Task Logs endpoint (quite a mouthful). Is this something that can change?

Itā€™d be cool if I could e.g. omit warnings from the output.

1 Like

That is correct.

Thanks for the feedback! Iā€™ll take this back to the team and see how we can make the docs clearer.

2 Likes

Thanks for reporting this. Having the MessageType in the log output definitely makes a lot of sense. We are going to work on adding it.

2 Likes

I would use this mostly for E2E testing of my scripts.
I would like this to have a way to recorded tests like most E2E testing frameworks. This is to speed up the process and make it easier to start E2E testing for everyone. Since your first E2E tests could just be recordings without any edits.

I would use player object it for the following reasons and test ceases:
1: It would detect if the game is fully broken and in an unplayable state.
2: I would use end-to-end tests on my player interactions. From start to finish
Examples would be team selectors. I can test if the GUI works as expected, but I canā€™t test if it actually changed the playerā€™s team without mocking the player
Other examples would be car spawners, entering and leaving the car, Tool givers, character customization and so on. Aka tests that all interactions that are in the game are working as intended and are functional.

1 Like

How will rate limiting work on this endpoint, and will any future saves be recorded as individual versions in the placeā€™s history?

1 Like

Good news, weā€™ve just enabled access to the Source property of scripts via open cloud Luau execution.

Weā€™re working to update the API docs site to make clear that script.Source is only accessible from the Open Cloud Luau Execution API and Plugins.

For anyone who is curious what this means - Robloxā€™s automated Lua test framework Jest-Roblox now supports module mocking via the script.Source property. One this change makes it into the community fork jsdotlua/jest-lua you will be able to use Jest via the Open Cloud Luau Execution API.

4 Likes

Weā€™ve since fixed this, though weā€™re still aware of some known issues with the docs that weā€™re still working on fixing. Thanks for calling this out.

2 Likes

Could we see Player as a creatable instance for testing? Or at least have PlayerAdded fired with a mock player?
Itā€™d be useful for being able to test so much more, like Product purchases, badges, character loading like applying scaling effects to make all characters have a consistent scale GitHub - EgoMoose/rbx-rthro-scaler: A Roblox module that adjusts the height of avatars and retains their proportions., ect.

1 Like

Hi everyone,

Thank you for trying out the beta release of the OpenCloud API for Luau Execution.

As you might know, when running a script inside a Luau Execution task, some engine APIs are blocked. We implemented this to prevent accidental modification of production data.

We are now planning to remove this restriction, so that all engine APIs available to game scripts can be used from Luau Execution task scripts.

To ensure that this change does not happen without your knowledge, we will be removing the universe.place.luau-execution-session:write scope from all API keys that have been used to call the OpenCloud API for Luau Execution, unless you explicitly opt-out. Removal of said scope from a key will prevent it from creating new tasks.

We have already sent out DMs regarding this, but in case you didnā€™t get one, feel free to DM me if you wish to opt-out.

If you choose to opt-out, then any Luau Execution Session Tasks created by any existing API keys that you own will gain access to previously blocked engine APIs. These engine APIs can access and modify data stored in the cloud. (See the documentation for the complete list of such APIs.)

We will begin removing the scope from API keys tomorrow November 20th at 1pm PST. The engine API restrictions will be lifted shortly after.

2 Likes

The engine API restrictions have been lifted.

For historical reference, this was the list of APIs that were blocked (which are now accessible from task scripts):

  * AssetService:CreatePlaceAsync()
  * AssetService:SavePlaceAsync()
  * DataStoreService:GetDataStore()
  * DataStoreService:GetGlobalDataStore()
  * DataStoreService:GetOrderedDataStore()
  * MemoryStoreService:GetHashMap()
  * MemoryStoreService:GetQueue()
  * MemoryStoreService:GetSortedMap()
  * Players:BanAsync()
  * Players:UnbanAsync()
  * Players:GetBanHistoryAsync()
  * HttpService:GetAsync()
  * HttpService:PostAsync()
  * HttpService:RequestAsync()
  * MessagingService:PublishAsync()
  * MessagingService:SubscribeAsync()
  * DataModel:SavePlace()

@Noble_Draconian @Kampfkarren @pyxfluff @RuizuKun_Dev @ChipioIndustries @ChasingSpace

9 Likes

Thank you, this makes the feature way better now.

Will we see a way to trigger RbxScriptSignals like MouseButton1Click, PlayerAdded, etc anytime soon? Iā€™d love to be able to emulate clicks

2 Likes

Weā€™re thinking about how best to support client testing. What youā€™re describing sounds a little like connecting an emulated player to the server the task is running in. Would love to learn a bit more.

In this case Iā€™m mostly just interested in emulating player clicks and common actions theyā€™d take for better testing workflows (for example i can setup a button, click it, then check the text and if it doesnā€™t change to an expected value we can expect an error happened). Full client emulations would be cool for testing full on games (like moving the character to a position) but my use case is more for testing something like a shop UI ingame.