ref:bdb8027089877e708142eb75cfc90ccb9976fba9

test: stop hiding the S3 backend behind exclude/skip

Previously the S3 backend was invisible to the default `mix test`: - test/test_helper.exs had `ExUnit.start(exclude: [:s3])` — unconditional blanket exclusion of every `:s3`-tagged test. - 4 module-level conditionals like: if !@minio_available do @moduletag :skip end auto-skipped the file when MinIO wasn't reachable on localhost:9000. - Same shape for git-lfs CLI availability in 2 LFS interop tests. Net effect: the S3 backend has been continuously test-passing AND continuously not-deployed for ~2 months. Nobody noticed it wasn't in production because the tests never ran where someone might have asked "why isn't this enabled?" Drops every conditional skip: - `ExUnit.start(exclude: [:s3])` → `ExUnit.start()`. - `@minio_available`/`@git_lfs_available` compile-time probes + the `if !available do @moduletag :skip end` blocks: removed. Tests now run unconditionally; they fail loudly if the infrastructure isn't there. That's the correct UX for a precondition the dev environment is supposed to provide. Anvil's `docker-compose.yml` includes a MinIO service. The "right" way to run this suite locally has always been `docker compose up -d` first; the silent skip was excusing forgetting that step. Verified: 954 tests, 0 failures with MinIO running locally on :9000 and `git-lfs` on PATH (was 903 before with 51 hidden behind skips). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
SHA: bdb8027089877e708142eb75cfc90ccb9976fba9
Author: Cole Christensen <cole.christensen@macmillan.com>
Date: 2026-04-29 17:03
Parents: dca2cb6
5 files changed +4 -64
Type
test/ex_git_objectstore/lfs/interop_s3_test.exs +1 −19
@@ -51,25 +51,7 @@
multipart_part_size: 5 * 1024 * 1024
}
@minio_available (case :gen_tcp.connect(~c"localhost", 9000, [], 1_000) do
{:ok, socket} ->
:gen_tcp.close(socket)
true
{:error, _} ->
false
end)
@git_lfs_available (case System.cmd("git", ["lfs", "version"], stderr_to_stdout: true) do
{_out, 0} -> true
_ -> false
end)
if !@minio_available or !@git_lfs_available do
@moduletag :skip
end
setup_all do
if @minio_available, do: ensure_bucket()
ensure_bucket()
:ok
end
test/ex_git_objectstore/lfs/interop_test.exs +0 −9
@@ -37,15 +37,6 @@
alias ExGitObjectstore.Storage.Filesystem, as: GitFilesystem
alias ExGitObjectstore.Test.LfsHttpAdapter
@git_lfs_available (case System.cmd("git", ["lfs", "version"], stderr_to_stdout: true) do
{_out, 0} -> true
_ -> false
end)
if !@git_lfs_available do
@moduletag :skip
end
setup do
root = tmp!("lfs-interop-root")
port = random_port()
test/ex_git_objectstore/lfs/store/s3_test.exs +0 −13
@@ -40,19 +40,6 @@
multipart_part_size: 5 * 1024 * 1024
}
@minio_available (case :gen_tcp.connect(~c"localhost", 9000, [], 1_000) do
{:ok, socket} ->
:gen_tcp.close(socket)
true
{:error, _} ->
false
end)
if !@minio_available do
@moduletag :skip
end
setup do
prefix = "lfs-test/#{:erlang.unique_integer([:positive])}/lfs"
%{mod: S3, cfg: @minio_config, prefix: prefix}
test/ex_git_objectstore/storage/s3_test.exs +2 −22
@@ -36,23 +36,7 @@
]
}
@minio_available (case :gen_tcp.connect(~c"localhost", 9000, [], 1_000) do
{:ok, socket} ->
:gen_tcp.close(socket)
true
{:error, _} ->
false
end)
if !@minio_available do
@moduletag :skip
end
setup_all do
if @minio_available do
ensure_bucket()
end
ensure_bucket()
:ok
end
@@ -62,11 +46,7 @@
config = @minio_config
repo = Repo.new(unique_id, storage: {S3, config})
on_exit(fn ->
if @minio_available do
cleanup_prefix(config, "repos/#{unique_id}")
end
end)
on_exit(fn -> cleanup_prefix(config, "repos/#{unique_id}") end)
%{repo: repo, config: config, unique_id: unique_id}
end
test/test_helper.exs +1 −1
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
ExUnit.start(exclude: [:s3])
ExUnit.start()