PostgresTestInstallation
Namespace: Ankus.Testing
Assembly: Ankus.Testing.dll
Owns a relocatable copy of a PostgreSQL installation for isolated extension tests.
public sealed class PostgresTestInstallation : IAsyncDisposableInheritance: object
Implements: IAsyncDisposable
Methods
Section titled “Methods”DisposeAsync()
Section titled “DisposeAsync()”Deletes the staged installation after the servers using it have stopped.
public ValueTask DisposeAsync()Returns: ValueTask
A completed task after synchronous file cleanup.
On Windows, a stopped server’s exiting processes can briefly keep the staged executables and libraries open; deletion retries as Delete(string) describes.
InstallExtensionFiles(string)
Section titled “InstallExtensionFiles(string)”Copies the publication manifest’s declared control and SQL files into this isolated installation.
Native libraries can remain in the publish directory and be selected with dynamic_library_path.
Custom SQL directories are remapped inside this installation without changing the publication.
public void InstallExtensionFiles(string publishDirectory)Parameters:
publishDirectory — string
The Ankus publish directory.
StageAsync(PostgresInstallation, string, CancellationToken)
Section titled “StageAsync(PostgresInstallation, string, CancellationToken)”Copies PostgreSQL into a relocatable staging root without changing the source installation.
public static Task<PostgresTestInstallation> StageAsync(PostgresInstallation installation, string rootDirectory, CancellationToken cancellationToken = default)Parameters:
installation — PostgresInstallation
The source PostgreSQL installation.
rootDirectory — string
An empty directory to own as the staging root.
cancellationToken — CancellationToken
Cancels file staging and PostgreSQL inspection.
Returns: Task<PostgresTestInstallation>
The staged installation owner.
Properties
Section titled “Properties”Installation
Section titled “Installation”Gets the relocated PostgreSQL installation.
public PostgresInstallation Installation { get; }Value: PostgresInstallation
RootDirectory
Section titled “RootDirectory”Gets the staging root owned by this instance.
public string RootDirectory { get; }Value: string