Files
firehose/blogex/mix.exs
T
Willem van den Ende 754c8fa1b9 blogex: coverage floor (74) + test-scaffolding exclusions
`test_coverage` sets the floor the Lens pass enforces, measured first: 74.53%
with test/support excluded (`mix test --cover` and the exported sample give the
same number). The rule — a FLOOR, ratcheted up as behavior yaks land, never
lowered — is written next to the config, along with why each module is excluded
(test scaffolding only: fixtures measure the tests, not the library).

Wiring, per the fast/push split: `test.coverage` runs the suite once with
`--cover --export-coverage default`; the `coverage` sensor then enforces the
floor from that export via `mix test.coverage` (no second suite run). So
`verify` runs the suite first and the sensors after it. The sensor guards on the
export existing: `mix test.coverage` exits 0 when it finds no .coverdata, and a
floor check that did not run must not report success.

blogex/.gitignore: cover/ (generated).
2026-10-26 18:38:35 +00:00

101 lines
2.7 KiB
Elixir

defmodule Blogex.MixProject do
use Mix.Project
@version "0.1.0"
@source_url "https://github.com/yourorg/blogex"
def project do
[
app: :blogex,
version: @version,
elixir: "~> 1.15",
elixirc_paths: elixirc_paths(Mix.env()),
start_permanent: Mix.env() == :prod,
aliases: aliases(),
deps: deps(),
test_coverage: test_coverage(),
docs: docs(),
package: package(),
description: "A multi-blog engine powered by NimblePublisher for Phoenix apps"
]
end
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]
def application do
[
extra_applications: [:logger]
]
end
def cli do
[
preferred_envs: [precommit: :test]
]
end
defp deps do
[
{:nimble_publisher, "~> 2.0"},
{:makeup_elixir, ">= 0.0.0"},
{:makeup_erlang, ">= 0.0.0"},
{:phoenix, "~> 1.7"},
{:phoenix_html, "~> 4.0"},
{:phoenix_live_view, "~> 1.0"},
{:jason, "~> 1.4"},
{:plug, "~> 1.15"},
{:ex_doc, "~> 0.34", only: :dev, runtime: false},
{:rustler, "~> 0.38.0", optional: true}
]
end
# The coverage floor the Lens pass enforces (`make verify` -> `make coverage`
# in blogex/). Rule: the threshold is a FLOOR. Raise it as behavior-test yaks
# land; never lower it. A drop means the change (or an exclusion) is wrong.
#
# Measured 2026-10-26, with the test scaffolding below excluded: 74.53% — the
# same via `mix test --cover` and via `mix test --cover --export-coverage
# default` + `mix test.coverage`. Floor is the integer below that.
#
# Excluded: the test scaffolding (Blogex.Test.*) only. Fixtures measure the
# tests, not the library. Everything in lib/blogex counts, and today's gaps
# are real: Blogex (the delegating facade), Blogex.Components and
# Blogex.Layout are at 0% because the router tests only exercise the JSON
# responses — moving this floor up is the behavior-test work.
defp test_coverage do
[
summary: [threshold: 74],
ignore_modules: [
Blogex.Test.FakeBlog,
Blogex.Test.PostBuilder,
Blogex.Test.Setup
]
]
end
defp docs do
[
main: "readme",
source_url: @source_url,
extras: ["README.md"]
]
end
# Same `precommit` alias name and shape as app/mix.exs, so both apps share
# one loop: compile (warnings fatal), format, test. Heavy sensors belong in
# the Lens pass (`make verify`), not here.
defp aliases do
[
precommit: ["compile --warning-as-errors", "format", "test"]
]
end
defp package do
[
licenses: ["MIT"],
links: %{"GitHub" => @source_url}
]
end
end