{"meta":{"title":"resolve tests","intro":"[Deep plumbing] Find QL unit tests in given directories.","product":"Security and code quality","breadcrumbs":[{"href":"/en/code-security","title":"Security and code quality"},{"href":"/en/code-security/reference","title":"Reference"},{"href":"/en/code-security/reference/code-scanning","title":"Code scanning"},{"href":"/en/code-security/reference/code-scanning/codeql","title":"CodeQL"},{"href":"/en/code-security/reference/code-scanning/codeql/codeql-cli-manual","title":"CodeQL CLI manual"},{"href":"/en/code-security/reference/code-scanning/codeql/codeql-cli-manual/resolve-tests","title":"resolve tests"}],"documentType":"article"},"body":"# resolve tests\n\n[Deep plumbing] Find QL unit tests in given directories.\n\n> [!NOTE]\n> This content describes the most recent release of the CodeQL CLI. For more information about this release, see https://github.com/github/codeql-cli-binaries/releases.\n>\n> To see details of the options available for this command in an earlier release, run the command with the <span style=\"white-space: nowrap;\">`--help`</span> option in your terminal.\n\n## Synopsis\n\n```shell copy\ncodeql resolve tests <options>... -- <test|dir>...\n```\n\n## Description\n\n\\[Deep plumbing] Find QL unit tests in given directories.\n\nThis plumbing command is responsible for expanding the command-line\nparameters of subcommands that run QL unit tests, to an actual list of\nindividual .ql and .qlref files to execute.\n\n## Options\n\n### Primary Options\n\n#### `<test|dir>...`\n\nEach argument is one of:\n\n* A `.ql` or `.qlref` file that defines a test to run.\n* A directory which will be searched recursively for tests to run.\n\n#### `--slice=<N/M>`\n\n\\[Advanced] Divide the test cases into _M_ roughly equal-sized slices\nand process only the _&#x4E;_&#x74;h of them. This can be used for manual\nparallelization of the testing process.\n\n#### `--[no-]strict-test-discovery`\n\n\\[Advanced] Only use queries that can be strongly identified as tests.\nThis mode tries to distinguish between `.ql` files that define unit\ntests and `.ql` files that are meant to be useful queries. This option\nis used by tools, such as IDEs, that need to identify all unit tests in\na directory tree without depending on previous knowledge of how the\nfiles in it are arranged.\n\nWithin a QL pack whose `qlpack.yml` declares a `tests` directory, all\n`.ql` files in that directory are considered tests, and `.ql` files\noutside it are ignored. In a QL pack that doesn't declare a `tests`\ndirectory, a `.ql` file is identified as a test only if it has a\ncorresponding `.expected` file.\n\nFor consistency, `.qlref` files are limited by the same rules as `.ql`\nfiles even though a `.qlref` file cannot really be a non-test.\n\n#### `--format=<fmt>`\n\nSelect output format, either `text` _(default)_ or `json`.\n\n### Common options\n\n#### `-h, --help`\n\nShow this help text.\n\n#### `-J=<opt>`\n\n\\[Advanced] Give option to the JVM running the command.\n\n(Beware that options containing spaces will not be handled correctly.)\n\n#### `-v, --verbose`\n\nIncrementally increase the number of progress messages printed.\n\n#### `-q, --quiet`\n\nIncrementally decrease the number of progress messages printed.\n\n#### `--verbosity=<level>`\n\n\\[Advanced] Explicitly set the verbosity level to one of errors,\nwarnings, progress, progress+, progress++, progress+++. Overrides `-v`\nand `-q`.\n\n#### `--logdir=<dir>`\n\n\\[Advanced] Write detailed logs to one or more files in the given\ndirectory, with generated names that include timestamps and the name of\nthe running subcommand.\n\n(To write a log file with a name you have full control over, instead\ngive `--log-to-stderr` and redirect stderr as desired.)\n\n#### `--common-caches=<dir>`\n\n\\[Advanced] Controls the location of cached data on disk that will\npersist between several runs of the CLI, such as downloaded QL packs and\ncompiled query plans. If not set explicitly, this defaults to a\ndirectory named `.codeql` in the user's home directory; it will be\ncreated if it doesn't already exist.\n\nAvailable since `v2.15.2`."}