From a5ae0e5a3fde5cb06f68edf36b8f50db7384b031 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 22 Jun 2023 11:13:20 +0100 Subject: [PATCH] Add pg_dump to server dockerfile --- packages/server/Dockerfile | 12 +++++++++++- .../external-schema/postgres.integration.spec.ts | 9 ++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/packages/server/Dockerfile b/packages/server/Dockerfile index 77aaf87c13..a125974e62 100644 --- a/packages/server/Dockerfile +++ b/packages/server/Dockerfile @@ -18,7 +18,7 @@ ENV TOP_LEVEL_PATH=/ # handle node-gyp RUN apt-get update \ - && apt-get install -y --no-install-recommends g++ make python postgresql-client + && apt-get install -y --no-install-recommends g++ make python RUN yarn global add pm2 # Install client for oracle datasource @@ -26,6 +26,16 @@ RUN apt-get install unzip libaio1 COPY scripts/integrations/oracle/ scripts/integrations/oracle/ RUN /bin/bash -e scripts/integrations/oracle/instantclient/linux/x86-64/install.sh +# Add the PostgreSQL repository +RUN apt update && apt upgrade -y \ + && apt install software-properties-common apt-transport-https curl gpg -y \ + && curl -fsSl https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | tee /usr/share/keyrings/postgresql.gpg > /dev/null \ + && echo deb [arch=amd64,arm64,ppc64el signed-by=/usr/share/keyrings/postgresql.gpg] http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main | tee /etc/apt/sources.list.d/postgresql.list \ + && apt update -y \ + && apt install postgresql-client-15 -y \ + && apt remove software-properties-common apt-transport-https curl gpg -y + + COPY package.json . COPY dist/yarn.lock . RUN yarn install --production=true diff --git a/qa-core/src/integrations/external-schema/postgres.integration.spec.ts b/qa-core/src/integrations/external-schema/postgres.integration.spec.ts index 5bfac734c9..065f922792 100644 --- a/qa-core/src/integrations/external-schema/postgres.integration.spec.ts +++ b/qa-core/src/integrations/external-schema/postgres.integration.spec.ts @@ -229,10 +229,13 @@ describe("getExternalSchema", () => { it("does not export a data", async () => { const integration = new postgres.integration(config) - await integration.internalQuery({ - sql: `INSERT INTO "users" ("name", "role") VALUES ('John Doe', 'Administrator'); + await integration.internalQuery( + { + sql: `INSERT INTO "users" ("name", "role") VALUES ('John Doe', 'Administrator'); INSERT INTO "products" ("name", "price") VALUES ('Book', 7.68);`, - }) + }, + false + ) const result = await integration.getExternalSchema() expect(result).toMatchInlineSnapshot(`