Testing at scale: cloud CI, bots and soak tests

Close the biggest gap in most Roblox CI pipelines: execute real Roblox tests in CI via Open Cloud Luau Execution, maintain a migration fixture corpus, simulate two-server locks and bots, and write the rules a nightly soak gate would apply.

Project lesson, about 65 minutes, 10 steps

By the end you can

  • Run automated Luau tests against a built staging place from GitHub Actions using Open Cloud Luau Execution
  • Build a frozen migration fixture corpus and contract tests that prove every historical save shape upgrades cleanly and idempotently
  • Test two-server session handoffs, DataStore failure injection and multi-client storms with StudioTestService and synthetic bots
  • Write a soak gate's rules (warm-up exclusion, memory growth, p95 frame time) as a pure function, plus a disciplined flaky-test quarantine policy

Before this: Continuous integration: every check, blocking, Deploying with Open Cloud: staging and production, Unit tests with Jest-Lua, Integration playtests, Performance: MicroProfiler, memory, network

Step 1 of 10

What Beacon Yard's CI skips today

Open .github/workflows/ci.yml at m14-ship. The build job builds both default.project.json and test.project.json, then uploads beacon-yard.rbxlx. Notice what never runs: beacon-yard-tests.rbxlx is built and immediately discarded.

      - name: rojo build
        run: |
          mkdir -p build
          rojo build default.project.json -o build/beacon-yard.rbxlx
      - name: rojo build the unit-test place
        run: rojo build test.project.json -o build/beacon-yard-tests.rbxlx
      - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
        with:
          name: beacon-yard-rbxlx
          path: build/beacon-yard.rbxlx

Static checks catch syntax errors, bad types and lint issues in seconds. They cannot catch a broken DataMigration formula, a ReceiptRules edge case, or a runtime error when ServerScriptService modules require each other inside Roblox.

Both sidesAutomated cloud CI, bots and soak tests is a wind tunnel and crash-test sled run before every flight.
In the pictureIn Roblox
The wind tunnelOpen Cloud Luau Execution running checks against the exact built place
The crash-test dummySimulated players and bot storms testing joins, leaves and lock handoffs
The strain gaugeSoak-test heap slope and p95 tick-time gates that block regressions

See the whole analogy cast

Think of an aircraft before its first flight. It goes through a wind tunnel, a crash-test sled carries dummies through every impact the team can think of, and strain gauges record how the frame bends over hours of stress. None of that is the flight, but each test catches a failure before a passenger would. Here the wind tunnel is Luau Execution running the built place, the dummies are bots and simulated players, and the strain gauges are the soak test's memory and frame-time numbers.

Think of it as A wind tunnel and crash-test sled run before every flight

Choose one

In Beacon Yard's .github/workflows/ci.yml at m14-ship, what happens to build/beacon-yard-tests.rbxlx after rojo build creates it?

In Beacon Yard's .github/workflows/ci.yml at m14-ship, what happens to build/beacon-yard-tests.rbxlx after rojo build creates it?

Press 1 to 4 to choose, Enter to check.

Link to this step · This confused me

Step 2 of 10

Running Roblox tests in CI with Luau Execution

In Deploying with Open Cloud: staging and production, you ran a four-check tasks/smoke.luau script against a published staging version using Open Cloud Luau Execution (universe.place.luau-execution-session:write)1. At m15-scale, the luau-execution job targets a dedicated CI test experience on pushes and same-repository pull requests when the test credentials are configured.

Cloud CI test pipelineFour boxes in sequence: Static Checks, Publish CI Place, Luau Execution Task, and Log Verdict Parser leading to Merge Gate.Static CIlint + typesPublish CItest placeLuau Execrun testsLog GatePASS + DONE
Run cheap static checks first, then publish and execute the built place in Open Cloud.

Two critical details make cloud CI safe and reliable:

  1. Protect your Open Cloud secret on pull requests. Never expose TEST_ROBLOX_API_KEY, an Open Cloud key for a test experience only, to untrusted fork pull requests (pull_request_target with checkout is a classic secret leak)2. Static and Lune checks run without the cloud credentials. The tagged cloud job only runs on pushes and same-repository pull requests.
  2. Parse the log strictly. A Luau Execution task ends in state COMPLETE whenever the script finishes without throwing, even if it printed TEST FAIL or zero tests ran. The tagged runner requires COMPLETE, a configured completion marker and no configured failure marker. Jest uses UNIT SUITE DONE and UNIT SUITE FAILED. Smoke uses SMOKE DONE and SMOKE FAILED. The challenge later in this lesson uses a stricter rule with its own TEST SUITE DONE marker and a positive pass count.

Be clear about which job actually gates a merge at m15-scale. The first tier is the specs job: it runs every Jest spec in Lune, with a small Jest shim, on every push, along with the boot check and the smoke script. The cloud job is the second tier. The tag's own tasks/run-specs.luau says it is not verified yet whether Jest-Lua can load modules inside a Luau Execution task, so treat the cloud result as advisory until it has passed once.

  specs:
    name: unit specs (lune)
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
      - uses: CompeyDev/setup-rokit@1d9390883f7ebce19d48f5b8d006e11d387c92ab # v0.2.1
        with:
          version: v1.2.0
      - name: lune run scripts/lune/specs
        run: lune run scripts/lune/specs
      - name: lune run scripts/lune/check-challenge-modules
        run: lune run scripts/lune/check-challenge-modules
      - name: lune run scripts/lune/check-boot
        run: lune run scripts/lune/check-boot
      - name: lune run scripts/lune/smoke
        run: lune run scripts/lune/smoke

Also check your Jest package choice: Beacon Yard currently pins jsdotlua/jest@3.10.0 (MIT, last release December 2024)3. Roblox's own Roblox/jest-roblox repo (MIT, active) now publishes directly to Wally as roblox/jest@3.21.0 and roblox/jest-globals@3.21.04. Keep in mind that Jest.runCLI relies on debug.loadmodule (documented for Edit mode in unit/run.server.luau) and Luau Execution does not start normal game scripts or physics. The tagged tasks/run-specs.luau calls Jest.runCLI on the test place's specs. tasks/smoke.luau checks module contracts directly. Keep RunGameTests for Studio Play sessions.

Choose one

A Luau Execution task finishes with state COMPLETE and logs: ["Booting", "TEST PASS migration_v1"]. It crashes silently before printing TEST SUITE DONE. What must your CI gate return?

A Luau Execution task finishes with state COMPLETE and logs: ["Booting", "TEST PASS migration_v1"]. It crashes silently before printing TEST SUITE DONE. What must your CI gate return?

Press 1 to 4 to choose, Enter to check.

Link to this step · This confused me

Step 3 of 10

A migration fixture corpus and data contracts

Look at unit/specs/DataMigration.spec.luau at m14-ship: five unit tests cover DataMigration.apply for BeaconYard_v1. That is a strong start, yet once a game ships ten updates over two years, engineers forget what version 2 or version 4 profiles actually looked like on disk.

function DataMigration.apply(data: ProfileData, raw: unknown): boolean
	if data.legacyImported then
		return false
	end
	data.legacyImported = true
	local legacy = DataMigration.readLegacy(raw)
	if legacy == nil then
		return false
	end
	data.coins += legacy.coins
	data.speedOwned = data.speedOwned or legacy.speedOwned
	return true

Studios solve this with a migration corpusMigration corpusA frozen collection of real historical save shapes used to verify every data migration runs safely and idempotently.Think of it as a museum of every old bank form the vault still has to honour.: a folder of immutable fixture records, one for every schema version ever written to production plus known corrupt shapes (empty nil, NaN coins, negative numbers, string booleans, missing arrays, extra fields from a rolled-back future version)5. Never edit an old fixture once it has shipped; only add new ones.

Every CI run checks two contracts on every fixture:

  • No silent loss: expected coins and unlocked items survive the upgrade intact.
  • Idempotence: running migrate(migrate(raw)) produces the exact same output as migrate(raw), so a retry after a network blip never grants a bonus twice.
Luau
Ctrl Enter runs the cell. Checked against the expected output
Choose one

A v4 migration gives returning v3 players a one-time 50-coin thank-you bonus, but forgets to record a flag or bump the version field. Which corpus check catches the bug immediately?

A v4 migration gives returning v3 players a one-time 50-coin thank-you bonus, but forgets to record a flag or bump the version field. Which corpus check catches the bug immediately?

Press 1 to 4 to choose, Enter to check.

Link to this step · This confused me

Step 4 of 10

Two-server session tests and failure injection

Beacon Yard's DataService.luau uses ProfileStore's StartSessionAsync and listens to session.OnSessionEnd so a player whose lock moves to another server is kicked instead of spending coins twice. How do you test that without launching two live Roblox servers and timing a teleport by hand?

Build a pure-Luau two-server lock simulator and inject failures on purpose:

  • Server A acquires the lease on Player_42. Server B attempts to acquire while the lease is active and must wait or fail.
  • Server A releases the lock cleanly (or crashes until the lease expires). Server B acquires it.
  • Server A attempts a stale write after losing the lock: the guard must reject it so coins cannot be duplicated across servers.
  • Inject a DataStore throttle error (502 / request budget exhausted) during a receipt grant or save: verify ProcessReceipt returns NotProcessedYet and never drops or double-grants the purchase.
Luau
Ctrl Enter runs the cell. Checked against the expected output
Predict the output

In the Run cell above, suppose Server B's lease was 60 seconds starting at t=125 (so expiresAt = 185). Server B hangs and misses its heartbeat. At t=190, Server C calls acquire("Player_42", "srvC", 190, 60), then Server B wakes up at t=191 and calls writeCoins("Player_42", "srvB", 191, 25). What happens?

local c = acquire("Player_42", "srvC", 190, 60)
local b = writeCoins("Player_42", "srvB", 191, 25)
print(c, b, store["Player_42"].coins)
In the Run cell above, suppose Server B's lease was 60 seconds starting at t=125 (so expiresAt = 185). Server B hangs and misses its heartbeat. At t=190, Server C calls acquire("Player_42", "srvC", 190, 60), then Server B wakes up at t=191 and calls writeCoins("Player_42", "srvB", 191, 25). What happens?

Press 1 to 4 to choose, Enter to check.

Link to this step · This confused me

Step 5 of 10

Multiplayer bots, StudioTestService and where automation stops

Unit tests and mocks verify rules in milliseconds, yet some bugs only appear with multiple live clients: a player leaving mid-round while holding the beacon prompt, or eight players triggering coin pads simultaneously.

Roblox's StudioTestService lets a Studio plugin drive real automated sessions6:

  • StudioTestService:ExecutePlayModeAsync(args) starts a solo Play test and returns whatever the server passes to StudioTestService:EndTest(result).
  • StudioTestService:ExecuteMultiplayerTestAsync(numPlayers, args) launches one server and 1 to 8 simulated client DataModels, with StudioTestService:LeaveTest() on a client to test disconnect and cleanup paths automatically.

For higher concurrency (like 50 simulated players), complement StudioTestService with a server-side bot harness that feeds synthetic join, move, swing and leave events into your services directly.

Both sidesRemember: Automated cloud CI, bots and soak tests is a wind tunnel and crash-test sled run before every flight.

The eight clients are the crash-test sled: few, but real, with real replication and real disconnects. The bot harness is a rack of dummies: many more of them, but each one only does what its script says.

Where does it break?“A wind tunnel and crash-test sled run before every flight” is a good picture of automated cloud ci, bots and soak tests. Where does it stop being true?

It breaks here. A crash dummy never gets bored, never misreads a confusing shop label, and never invents a creative social exploit that real players will find in ten minutes.

The true model. Automated cloud tests, bots and soak runs prove that builds load, data survives migrations and servers hold steady under load, freeing human playtesters to judge fun, clarity and edge-case behaviour.

A crash dummy proves the frame holds under fifty simulated joins and that no table leaks on leave. It cannot tell you whether the shop prices feel stingy, whether a newcomer notices the beacon beam, or whether two players will invent a hilarious way to block a doorway. Automated testing protects reliability so human playtesters can focus on fun.

Choose one

Your 50-bot soak test and 8-client StudioTestService storm both pass with zero errors and flat memory. Which problem can STILL ship to players?

Your 50-bot soak test and 8-client StudioTestService storm both pass with zero errors and flat memory. Which problem can STILL ship to players?

Press 1 to 4 to choose, Enter to check.

Link to this step · This confused me

Step 6 of 10

Soak tests, performance gates and flaky quarantine

A server in a hit game can stay live for 12 hours or longer. A tiny 8 KB leak per player leave is invisible in a two-minute playtest, yet it grows the server's memory by tens of megabytes a day and never comes back down.

A soak testSoak testA long-running automated test that repeats joins, leaves and game loops to catch memory leaks and frame-time drift.Think of it as running a new engine on a test stand for hours to see if the oil pressure slowly drops. runs an accelerated storm (say 200 simulated join/leave cycles and 20 short rounds, or a nightly 30-minute staging run) and records { heapKb, tickMs } samples after every cycle7. Two rules keep the gate trustworthy:

  1. Skip warm-up samples. The first few cycles allocate caches, pools and lazy module state. Measure memory growth from the post-warm-up baseline to the final sample (for example, fail above 5% growth).
  2. Gate on p95 tick time, not average. Averages hide periodic spikes caused by garbage collection or unbatched pathfinding; gating on the 95th percentile (p95Ms) catches regressions early.
GitHub Actions workflow showing passing static jobs and an expanded unit specs (roblox) smoke log with TEST PASS lines and SMOKE DONE.

When a test flakes in CI (passes 9 runs, fails 1), never train the team to click Re-run blindly. Move the flaky spec into an explicit quarantine list with an owner and a linked issue, keep running it non-blocking so you still collect failure traces, and fix or delete it within a week.

Choose one

Why does evaluateSoak skip the first warmupCount samples before measuring heap growth percentage?

Why does evaluateSoak skip the first warmupCount samples before measuring heap growth percentage?

Press 1 to 4 to choose, Enter to check.

Link to this step · This confused me

Step 7 of 10

Choosing your test runners and frameworks

Where and how studios run Roblox tests

OptionWhat it isWhen pros pick itTrade-offs
Open Cloud Luau ExecutionRuns a Luau task against a published place version on Roblox's cloud servers.PR and staging CI smoke/contract suites on GitHub Actions.Does not start game scripts or physics; needs a dedicated CI place and API key.
StudioTestServiceBuilt-in Studio plugin API driving solo Play, Run and 1-to-8 client multiplayer tests.Full engine integration tests, disconnect cleanup and physics/remote verification.Requires Roblox Studio; not natively available on Linux CI runners.
Lune (pure Luau)Standalone Luau runtime (lune-org/lune, MPL-2.0, active) running pure logic locally or in CI in under a second.Fast feedback on pure modules (migrations, token buckets, economy math) without Roblox instances.No Roblox engine APIs unless stubbed.
Roblox/jest-roblox vs jsdotlua/jest-luaRoblox/jest-roblox (MIT, active, Wally roblox/jest@3.21.0) vs jsdotlua/jest-lua (MIT, quiet since Dec 2024, Wally jsdotlua/jest@3.10.0 in Beacon Yard). TestEZ (Apache-2.0) is archived: do not use.Unit and contract test suites inside Studio or a Luau harness; prefer roblox/jest for new projects.Jest.runCLI relies on Edit-mode module loading; run-in-roblox (MIT, stale since Mar 2024) should be avoided in favour of Open Cloud.
Match the pairs

Match each Beacon Yard bug to the cheapest test layer that catches it reliably.

Link to this step · This confused me

Step 8 of 10

Build along: wire cloud CI, corpus checks and a soak gate

Extend your copy of Beacon Yard from m14-ship on a branch. Start with the pure-logic harness in challenges/work/test_harness.luau, then add the migration corpus and CI job in your local copy.

Build along

m14-ship to m15-scale

  • unit/specs/DataMigration.spec.luau
  • src/server/DataMigration.luau
  • tasks/run-specs.luau
  • tasks/smoke.luau
  • scripts/lune/smoke.luau
  • scripts/run-luau-tests.mjs
  • .github/workflows/ci.yml
  1. Use v1_record, m10_profile, m12_profile and m14_profile in unit/specs/DataMigration.spec.luau. Copy each fixture before invoking DataMigration.reconcile and compare once and twice reconciled copies. Separately check that DataMigration.apply imports the v1 record only once.

    You should see Four historical record shapes reconcile into complete profiles and pass the idempotence test.

  2. Validate the content with ContentSchema and round-trip a DronePacket. Use Scope to register cleanup across 200 simulated cycles, then check the cleanup count and remaining entries. Run lune run scripts/lune/smoke locally. The soak checks leftover entries, while the challenge below practises a heap growth budget.

    You should see The smoke script checks content, a packet round trip and 200 join and leave cycles.

  3. Use the luau-execution job in .github/workflows/ci.yml. It builds test.project.json, publishes build/beacon-yard-tests.rbxl, and passes the published version to scripts/run-luau-tests.mjs. The runner checks for task completion and the task's pass or fail marker. The job skips the cloud steps unless all three test secrets are configured, and its result stays advisory until it has passed once; the Lune specs job is the merge gate.

    You should see The trusted CI job publishes the test place and runs the spec and smoke tasks separately.

Link to this step · This confused me

Step 9 of 10

Challenges

Level 2, Builder

Challenge

Write a one-page Testing & Quarantine Policy (docs/testing-policy.md in your copy of Beacon Yard). This is a self-check; no automated test grades it.

Start from
The game at milestone m14 (download)

Done means

  • A three-tier test matrix (every PR, merge to main, nightly/pre-release) naming exact tools, budgets and target places
  • A secret-safety rule explaining why fork PRs never read TEST_ROBLOX_API_KEY
  • A flaky-test quarantine rule with owner assignment, tracking issue and maximum days before fix or removal
  • At least four concrete soak thresholds (heap growth %, p95 server tick ms, cycle count, zero unexpected Output errors)

Meet the criteria above, then record your own result. No test grades this check.

Level 3, Professional

Challenge

Complete challenges/work/test_harness.luau so the migration corpus runner, two-server session lock simulator, soak gate and cloud log parser pass every check. Run game.ServerScriptService.RunGameTests:Invoke("testing-at-scale", "testing-at-scale-suite") in Studio (or test in the pure Luau runner). Written solution: challenges/solutions/testing-at-scale.md.

Start from
The game at milestone m14 (download)
Grade it
In Studio, press Play, then run game.ServerScriptService.RunGameTests:Invoke("testing-at-scale", "testing-at-scale-suite") in the server command bar. Copy the pass code from Output.

Done means

  • verifyCorpus checks expected coins and speedOwned, non-negative integer coins, and idempotence (second migrate matches first)
  • acquire, write and release enforce single-server lease ownership, expiry takeover and stale-server write rejection
  • evaluateSoak skips warmupCount samples, requires at least 2 post-warmup samples, and checks both heap growth percentage and p95 tick time
  • parseCloudLog returns ok = true only when TEST SUITE DONE is present, failed == 0, and passed > 0
  • challenges/testing-at-scale.luau prints TEST PASS for all 13 checks

The Course Runner prints this code when the test passes.

Link to this step · This confused me

Step 10 of 10

Recap

Retiring the analogy

You no longer need “a wind tunnel and crash-test sled run before every flight”. Automated cloud tests, bots and soak runs prove that builds load, data survives migrations and servers hold steady under load, freeing human playtesters to judge fun, clarity and edge-case behaviour.

Recap

  1. Run Lune checks without cloud credentials. The cloud runner uses a dedicated test place and checks the task state plus the unit or smoke completion marker. The challenge's parser also requires a positive pass count.
  2. Freeze every shipped save shape in a migration fixture corpus and assert both data preservation and idempotence (migrate twice equals migrate once).
  3. Simulate two-server session lock handoffs and DataStore failure injection in pure Luau, and use StudioTestService (up to 8 clients) for live multiplayer disconnect and concurrency checks.
  4. Run soak tests that skip warm-up allocations and gate on steady-state heap growth and p95 tick time, and quarantine flaky tests with an owner and expiry instead of blindly clicking re-run.

Automated cloud CI, bots and soak tests is a wind tunnel and crash-test sled run before every flight, until a crash dummy never gets bored, never misreads a confusing shop label, and never invents a creative social exploit that real players will find in ten minutes.

Next Tools for your team: plugins, CLIs and code generation

Link to this step · This confused me