diff --git a/tools/postgres/BUILD b/tools/postgres/BUILD index e57ec0f9..6cfe239f 100644 --- a/tools/postgres/BUILD +++ b/tools/postgres/BUILD @@ -1,13 +1,5 @@ package(default_visibility = ["//visibility:public"]) -load("@io_bazel_rules_docker//container:image.bzl", "container_image") - -# Exists purely to give a clean name to the postgres Docker image. -container_image( - name = "postgres_image", - base = "@postgres//image", -) - load("//tools:ts_library.bzl", "ts_library") ts_library( @@ -15,9 +7,6 @@ ts_library( srcs = glob( ["*.ts"], ), - data = [ - ":postgres_image", - ], deps = [ "//common/promises", "//testing", diff --git a/tools/postgres/postgres_fixture.ts b/tools/postgres/postgres_fixture.ts index ca0da071..db2c87f6 100644 --- a/tools/postgres/postgres_fixture.ts +++ b/tools/postgres/postgres_fixture.ts @@ -5,22 +5,15 @@ import { sleepUntil } from "sa/common/promises"; import { IHookHandler } from "sa/testing"; const USE_CLOUD_BUILD_NETWORK = !!process.env.USE_CLOUD_BUILD_NETWORK; -const DOCKER_CONTAINER_NAME = "postgres-df-integration-testing"; +const DOCKER_CONTAINER_NAME = "postgres-sa-integration-testing"; +const POSTGRES_IMAGE = "postgres:15-alpine"; const POSTGRES_SERVE_PORT = 5432; export class PostgresFixture { public static readonly host = USE_CLOUD_BUILD_NETWORK ? DOCKER_CONTAINER_NAME : "localhost"; - private static imageLoaded = false; - constructor(port: number, setUp: IHookHandler, tearDown: IHookHandler) { setUp("starting postgres", async () => { - if (!PostgresFixture.imageLoaded) { - // Load the postgres image into the local Docker daemon. - execSync("tools/postgres/postgres_image.executable"); - PostgresFixture.imageLoaded = true; - } - // Run the postgres Docker image. execSync( [ "docker run", @@ -30,7 +23,7 @@ export class PostgresFixture { "-d", `-p ${port}:${POSTGRES_SERVE_PORT}`, USE_CLOUD_BUILD_NETWORK ? "--network cloudbuild" : "", - "bazel/tools/postgres:postgres_image" + POSTGRES_IMAGE ].join(" ") );