{"meta":{"title":"test accept","intro":"Accept results of failing unit tests.","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/test-accept","title":"test accept"}],"documentType":"article"},"body":"# test accept\n\nAccept results of failing unit tests.\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 test accept <options>... -- <test|dir>...\n```\n\n## Description\n\nAccept results of failing unit tests.\n\nThis is a convenience command that renames the `.actual` files left by\n[codeql test run](/en/code-security/reference/code-scanning/codeql/codeql-cli-manual/test-run) for failing tests into `.expected`, such that future runs on the tests that give the\nsame output will be considered to pass. What it does can also be\nachieved by ordinary file manipulation, but you may find its syntax more\nuseful for this special case.\n\nThe command-line arguments specify one or more *tests* -- that is,\n`.ql(ref)` files -- and the command automatically derives the names of\nthe `.actual` files from them. Any test that doesn't have an `.actual`\nfile will be silently ignored, which makes it easy to accept just the\nresults of *failing* tests from a previous run.\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 *N*th 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### 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`."}