0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-27 23:27:11 +01:00
mongodb/docs/test_commands.md
Gregory Noma 5339a049c1 SERVER-92770 Remove emptycapped (#25439)
GitOrigin-RevId: 4498272aa5000aff8fc8effec2b3c8e96ba98ea6
2024-07-31 15:44:28 +00:00

1.3 KiB

Test Commands

All test commands are denoted with the .testOnly() modifier to the MONGO_REGISTER_COMMAND invocation. For example:

MONGO_REGISTER_COMMAND(EchoCommand).testOnly();

How to enable

To be able to run these commands, the server must be started with the enableTestCommands=1 server parameter (e.g. --setParameter enableTestCommands=1). Resmoke.py often sets this server parameter for testing.

Examples

Some often-used commands that are test-only:

As a very rough estimate, about 10% of all server commands are test-only. These additional commands will appear in db.runCommand({listCommands: 1}) when the server has test commands enabled.

Test Command Infrastructure

A few pointers to relevant code that sets this up: