I’m trying to run integration tests for my Go runtime code and need access to the real Nakama runtime context — specifically nk, logger, db, and initializer — the same way Nakama provides them to InitModule.
Mocking these interfaces works fine for unit tests, but for integration tests I want to run against an actual Nakama runtime so that all calls (StorageWrite, WalletUpdate, etc.) go through the real system.
Is there a supported or recommended way to bootstrap Nakama directly inside go test so I can get these real runtime components?
Ideally I’d like to be able to run go test ./… (or “Run All” in my IDE) and have it:
-
start a real Nakama runtime programmatically,
-
load my Go module,
-
and let me call my functions directly (not necessarily through RPC).
In short, I’m looking for a way to initialize Nakama from within tests and obtain the same runtime context objects that Nakama passes to modules.
Has anyone done this, or is there an official approach for setting up integration tests like this?