KogenCredo.Check.Warning.SerialReason (KogenCredo v0.1.0)

View Source

Basics

This check is disabled by default.

Learn how to enable it via .credo.exs.

This check has a base priority of low and works with any version of Elixir.

Explanation

A serial test module adds its whole run time to the suite's serial phase. Declare why it must be serial with @moduletag serial: :reason, using the project's vocabulary, so the reason can be reviewed and later removed.

Bad:

use ExUnit.Case, async: false

Good:

use ExUnit.Case, async: false
@moduletag serial: :env

Prefer async: true, group: :resource when only tests touch the resource.

Check-Specific Parameters

Use the following parameters to configure this check:

:serial_vocabulary

Allowed serial: reason atoms; [] accepts any atom.

This parameter defaults to [:env, :ets, :file, :cwd, :mock_global, :logger, :persistent_term, :pubsub, :named_process, :sandbox_shared, :external].

:case_templates

Map of case template module name => :inherit | :async | :serial.

This parameter defaults to %{}.

:allowed_modules

Module names exempt from the check.

This parameter defaults to [].

:included_files

Path globs of files to check.

This parameter defaults to ["test/**/*_test.exs"].

General Parameters

Like with all checks, general params can be applied.

Parameters can be configured via the .credo.exs config file.