Elastic.TUnit.Elasticsearch.Core
0.13.0
Prefix Reserved
dotnet add package Elastic.TUnit.Elasticsearch.Core --version 0.13.0
NuGet\Install-Package Elastic.TUnit.Elasticsearch.Core -Version 0.13.0
<PackageReference Include="Elastic.TUnit.Elasticsearch.Core" Version="0.13.0" />
<PackageVersion Include="Elastic.TUnit.Elasticsearch.Core" Version="0.13.0" />
<PackageReference Include="Elastic.TUnit.Elasticsearch.Core" />
paket add Elastic.TUnit.Elasticsearch.Core --version 0.13.0
#r "nuget: Elastic.TUnit.Elasticsearch.Core, 0.13.0"
#:package Elastic.TUnit.Elasticsearch.Core@0.13.0
#addin nuget:?package=Elastic.TUnit.Elasticsearch.Core&version=0.13.0
#tool nuget:?package=Elastic.TUnit.Elasticsearch.Core&version=0.13.0
Elastic.TUnit.Elasticsearch.Core
Most users should depend on
Elastic.TUnit.Elasticsearchinstead.
This is the barebones core package. It provides cluster lifecycle, skip attributes, test hooks,
and bootstrap diagnostics for TUnit — but does not include Elastic.Clients.Elasticsearch.
You should only depend on this package directly if you are sure you will not use
Elastic.Clients.Elasticsearch. For example:
- You are using a different Elasticsearch client (e.g. the low-level
Elastic.Transportclient, a custom HTTP client, or a third-party library) - You are testing cluster infrastructure itself and never need a typed client
- You are building your own convenience layer on top of this package
For everyone else — which is the vast majority of users — use
Elastic.TUnit.Elasticsearch.
It depends on this package transitively and adds:
- A non-generic
ElasticsearchClusterbase class with a defaultElasticsearchClient - The
.WireTUnitOutput()extension forElasticsearchClientSettings - One-liner cluster definitions like
public class MyCluster() : ElasticsearchCluster("latest-9");
What's in this package
ElasticsearchCluster<TConfiguration>— generic cluster base with TUnit lifecycle integrationElasticsearchConfiguration— cluster configuration with bootstrap diagnostics settingsExternalClusterConfiguration— connection details for remote Elasticsearch clustersElasticsearchClusterExtensions—GetOrAddClienthelpers for caching any client typeElasticsearchTestHooks— global[BeforeEvery(Test)]hook for skip evaluationElasticsearchTestBase<TCluster>— optional convenience base classElasticsearchParallelLimit— default parallel limiterSkipVersionAttribute/SkipTestAttribute— version-based and custom skip conditions- Bootstrap diagnostics writers (ANSI console, progress heartbeat)
External cluster support
ElasticsearchCluster<TConfiguration> supports skipping ephemeral cluster startup when a
remote Elasticsearch instance is already available. This significantly speeds up development
feedback loops since you don't need to wait for Elasticsearch to bootstrap on every test run.
The resolution order during InitializeAsync() is:
- Programmatic hook — override
TryUseExternalCluster()to return anExternalClusterConfiguration, ornullto fall through - Environment variables — set
TEST_ELASTICSEARCH_URL(and optionallyTEST_ELASTICSEARCH_API_KEY) - Ephemeral startup — download, install, and start Elasticsearch locally
When using an external cluster:
NodesUris()returns the external URIIsExternalistrueExternalApiKeycontains the API key (if provided)Dispose()is a no-op (the remote cluster is not managed)- Connectivity is validated with a GET
/before tests run
Dependencies
TUnit.CoreElastic.Elasticsearch.Ephemeral
No dependency on Elastic.Clients.Elasticsearch.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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 is compatible. 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. |
-
net10.0
- Elastic.Elasticsearch.Ephemeral (>= 0.13.0)
- TUnit.Core (>= 1.15.0)
-
net8.0
- Elastic.Elasticsearch.Ephemeral (>= 0.13.0)
- TUnit.Core (>= 1.15.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Elastic.TUnit.Elasticsearch.Core:
| Package | Downloads |
|---|---|
|
Elastic.TUnit.Elasticsearch
TUnit integration for Elasticsearch — ephemeral clusters with a pre-configured ElasticsearchClient. This is the recommended package for most users. |
GitHub repositories
This package is not used by any popular GitHub repositories.