skipcheck

TM1 Testcontainers · Docs · Where TM1 comes from

Tm1EngineSource

using Skipcheck.Tm1.Testcontainers;

Where a Tm1EngineContainer gets TM1 v12 from.

The tm1-engine image contains no IBM software, so every container needs one of these. They mirror the image's own sources (see the image's README), and Tm1Source, which does the same for TM1 11.

Discover finds one from the environment, so tests don't hard-code paths. Each setting is read first as a system property and then as an environment variable, under the same name. The first source found wins, in this order:

  1. TM1_ENGINE_PRIVATE_IMAGE: an image with TM1 built in (Tm1EngineSource.PrivateImage)
  2. TM1_ENGINE_HOME_DIR: an install the image made, as a folder (Tm1EngineSource.InstallDir)
  3. TM1_ENGINE_INSTALL_VOLUME: a Docker volume holding such an install (Tm1EngineSource.InstallVolume)
  4. TM1_ENGINE_BUNDLE_DIR, optionally with TM1_ENGINE_BUNDLE: a folder holding IBM's package, and the file name to use from it (Tm1EngineSource.Bundle)
  5. TM1_ENGINE_BUNDLE_URL, optionally with TM1_ENGINE_BUNDLE_SHA256: a download link for the package (Tm1EngineSource.BundleUrl)
  6. TM1_BUNDLE_DIR, TM1 11's downloads folder, when it holds a TM1 v12 package too: one folder then serves both versions

Members

PrivateImageSetting staticThe setting naming an image with TM1 v12 built in.
HomeDir staticThe setting naming an install the image made, as a folder.
InstallVolumeSetting staticThe setting naming a Docker volume holding an install.
BundleDir staticThe setting naming the folder holding IBM's package.
BundleSetting staticThe setting naming the package's file in BundleDir (the newest otherwise).
BundleUrlSetting staticThe setting holding a download link for IBM's package.
BundleSha256 staticThe setting holding the package's SHA-256, checked after the download.
DescribeWhere TM1 comes from, for logs.
Discover staticThe first source set, from AppContext switches or environment variables; null when none is.
Discover staticThe first source set, looking settings up with lookup, in this order.

PrivateImageSetting

static
const string PrivateImageSetting

The setting naming an image with TM1 v12 built in.

HomeDir

static
const string HomeDir

The setting naming an install the image made, as a folder.

InstallVolumeSetting

static
const string InstallVolumeSetting

The setting naming a Docker volume holding an install.

BundleDir

static
const string BundleDir

The setting naming the folder holding IBM's package.

BundleSetting

static
const string BundleSetting

The setting naming the package's file in BundleDir (the newest otherwise).

BundleUrlSetting

static
const string BundleUrlSetting

The setting holding a download link for IBM's package.

BundleSha256

static
const string BundleSha256

The setting holding the package's SHA-256, checked after the download.

Describe

string Describe()

Where TM1 comes from, for logs: never a URL's credentials or query string.

Discover

static
Tm1EngineSource? Discover()

The first source set, from AppContext switches or environment variables; null when none is.

Throws

ArgumentException
A source is set but wrong (a folder that isn't there, say): a test should fail on that, not skip.

Discover

static
Tm1EngineSource? Discover(Func<string, string?> lookup)

The first source set, looking settings up with lookup, in this order: TM1_ENGINE_PRIVATE_IMAGE, TM1_ENGINE_HOME_DIR, TM1_ENGINE_INSTALL_VOLUME, TM1_ENGINE_BUNDLE_DIR (with TM1_ENGINE_BUNDLE), TM1_ENGINE_BUNDLE_URL (with TM1_ENGINE_BUNDLE_SHA256), then TM1_BUNDLE_DIR, TM1 11's downloads folder, if it holds a tm1-v*-standalone-linux.tgz (or TM1_ENGINE_BUNDLE is set): one folder then serves both versions. Blank settings count as unset.

Throws

ArgumentException
A setting is present but wrong.