skipcheck

TM1 Testcontainers · Docs · Containers

Tm1WebContainer

from skipcheck_tm1_testcontainers import Tm1WebContainer

TM1 Web (IBM Planning Analytics Spreadsheet Services) in Docker, for tests, built on the tm1-web image.

TM1 Web lists and logs on to the TM1 servers registered with an Admin Server, so it's started against a Tm1ServerContainer with with_tm1_server. That container's embedded Admin Server is the one TM1 Web uses. Most tests use RequiresTm1Web, which starts one shared TM1 Web against the shared TM1 server.

# Entering the blocks starts TM1, then TM1 Web; leaving them stops both
with Tm1ServerContainer(tm1_source).with_seed(Tm1Seed.SDATA) as tm1, Tm1WebContainer(web_source).with_tm1_server(tm1) as web:
    return web.url  # http://localhost:54321/tm1web/

The image contains no IBM software, so every container needs a Tm1WebSource. TM1 Web's default heap here is 1 GB; set the image's TM1_WEB_HEAP with with_env to change it.

Members

DEFAULT_IMAGEThe tm1-web image, without a tag.
WEB_IMAGEOverrides the tm1-web image (not used with PrivateImage), e.g.
HTTP_PORTTM1 Web's HTTP port inside the container.
__init__ constructorA container on the default tm1-web image (or TM1_WEB_IMAGE), getting TM1 Web from source.
shared staticOne TM1 Web for every test in this process, listing Tm1ServerContainer.shared.
with_tm1_serverLists the servers of this TM1 server's Admin Server, started first.
with_admin_serverLists the servers of a shared Admin Server instead.
admin_server propertyThe Admin Server set with with_admin_server, or None if none was set.
source propertyWhere TM1 Web comes from.
tm1_server propertyThe TM1 server set with with_tm1_server, or None if none was set.
url propertyTM1 Web's address as seen from the host, such as http://localhost:54321/tm1web/, ending in /.
admin_host propertyThe Admin Server's host, as TM1 Web's logon takes it.
configureCalled by testcontainers before the container is created.
container_is_startedCalled once the container is up.

DEFAULT_IMAGE

DEFAULT_IMAGE: ClassVar[str]

The tm1-web image, without a tag.

WEB_IMAGE

WEB_IMAGE: ClassVar[str]

Overrides the tm1-web image (not used with PrivateImage), e.g. tm1-web:local for a local build. Read as a system property, then an environment variable.

HTTP_PORT

HTTP_PORT: ClassVar[int]

TM1 Web's HTTP port inside the container.

__init__

constructor
__init__(source: Tm1WebSource, image: str | None = None) -> None

A container on the default tm1-web image (or TM1_WEB_IMAGE), getting TM1 Web from source.

shared

static
shared() -> Tm1WebContainer

One TM1 Web for every test in this process, listing Tm1ServerContainer.shared.

with_tm1_server

with_tm1_server(tm1: Tm1ServerContainer) -> Self

Lists the servers of this TM1 server's Admin Server, started first.

with_admin_server

with_admin_server(admin: Tm1AdminServerContainer) -> Self

Lists the servers of a shared Admin Server instead.

admin_server

property
admin_server: Tm1AdminServerContainer | None

The Admin Server set with with_admin_server, or None if none was set.

source

property
source: Tm1WebSource

Where TM1 Web comes from.

tm1_server

property
tm1_server: Tm1ServerContainer | None

The TM1 server set with with_tm1_server, or None if none was set.

url

property
url: str

TM1 Web's address as seen from the host, such as http://localhost:54321/tm1web/, ending in /.

admin_host

property
admin_host: str

The Admin Server's host, as TM1 Web's logon takes it.

configure

configure() -> None

Called by testcontainers before the container is created: points TM1 Web at the Admin Server it lists servers from.

container_is_started

container_is_started() -> None

Called once the container is up: logs where it is and what it came from.