CodeFactory.EphemeralS3 0.1.0

dotnet add package CodeFactory.EphemeralS3 --version 0.1.0
                    
NuGet\Install-Package CodeFactory.EphemeralS3 -Version 0.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CodeFactory.EphemeralS3" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CodeFactory.EphemeralS3" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="CodeFactory.EphemeralS3" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add CodeFactory.EphemeralS3 --version 0.1.0
                    
#r "nuget: CodeFactory.EphemeralS3, 0.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package CodeFactory.EphemeralS3@0.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CodeFactory.EphemeralS3&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=CodeFactory.EphemeralS3&version=0.1.0
                    
Install as a Cake Tool

CodeFactory.EphemeralS3

A throwaway S3 server for .NET tests. EphemeralS3Server starts a MinIO process on a free loopback port and hands you a preconfigured AmazonS3Client. No Docker, no shared test infrastructure, no cleanup — disposing the server kills the process and deletes its data directory.

The package itself is a few kilobytes of code. The MinIO server is downloaded into a per-user cache the first time you construct an EphemeralS3Server, verified against a pinned SHA-256, and reused from then on.

Install

dotnet add package CodeFactory.EphemeralS3

Usage

using CodeFactory.EphemeralS3;

using var server = new EphemeralS3Server();
using var s3 = server.CreateS3Client();

await s3.PutBucketAsync(new PutBucketRequest { BucketName = "my-bucket" });

Each instance is isolated, so tests can run in parallel. Constructor options:

Parameter Default Description
dataDir temp directory Where MinIO stores objects.
port 0 0 picks a free port.
accessKey "test" Root user.
secretKey "test1234" Root password (MinIO requires 8+ characters).
startupTimeout 10 seconds How long to wait for the port to accept connections.

server.Endpoint exposes the base URL (http://127.0.0.1:<port>) if you need to configure a client yourself. Note that clients must use path-style addressing.

The MinIO download

On first use the pinned MinIO release (RELEASE.2025-09-07T16-13-09Z, ~110 MiB) is downloaded from MinIO's official host, checked against a known SHA-256, and cached at:

OS Location
Linux $XDG_CACHE_HOME/CodeFactory.EphemeralS3 (or ~/.cache/...)
macOS ~/Library/Caches/CodeFactory.EphemeralS3
Windows %LOCALAPPDATA%\CodeFactory.EphemeralS3

Later runs reuse the cached file. Concurrent processes are safe: downloads are serialised with a lock file and published by atomic rename, so a parallel test suite downloads once.

Two environment variables control this:

Variable Effect
EPHEMERAL_S3_MINIO_PATH Use this existing minio executable and skip the download entirely — for offline or air-gapped builds.
EPHEMERAL_S3_CACHE_DIR Override the cache location, e.g. to a CI cache path.

To download ahead of time rather than inside your first test, call await MinioBinary.EnsureAsync() from an async fixture (or MinioBinary.Ensure()).

In CI, cache the directory so you download once rather than per run:

env:
  EPHEMERAL_S3_CACHE_DIR: ${{ github.workspace }}/.minio-cache

- uses: actions/cache@v4
  with:
    path: ${{ env.EPHEMERAL_S3_CACHE_DIR }}
    key: minio-${{ runner.os }}-${{ runner.arch }}-<pinned release>

Supported platforms

linux-x64, linux-arm64, osx-x64, osx-arm64 and win-x64 — every platform MinIO publishes a server build for. Anything else (notably Windows on arm64) throws PlatformNotSupportedException naming the platform.

Releasing

Tag a commit to publish to NuGet — the tag drives the package version:

git tag v1.2.3
git push origin v1.2.3

Publishing uses NuGet Trusted Publishing via GitHub OIDC, so no API key is stored anywhere. The policy on nuget.org is bound to this repository and to .github/workflows/release.yml; renaming that file breaks publishing until the policy is updated.

License

This library is MIT licensed. See LICENSE.

Third-party notice

This package contains no MinIO code. The MinIO server is downloaded at runtime from MinIO's official host and is licensed separately under the GNU AGPL v3 — Copyright 2015-2025 MinIO, Inc. Source: https://github.com/minio/minio. Using this library therefore means running AGPL-licensed software locally during your tests; review those terms if your organization restricts AGPL dependencies.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0 123 7/31/2026