From 3d616eea5ce7a353df70d81dcbf65b09f8a182fd Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 14 May 2025 20:50:32 -0400 Subject: [PATCH 1/9] cmds --- .../__snapshots__/extensions.test.ts.snap | 16 +++++++------- .../__tests__/__snapshots__/init.test.ts.snap | 22 +++++++++---------- ...lans.test.ts.snap => package.test.ts.snap} | 10 ++++----- packages/cli/__tests__/extensions.test.ts | 2 +- packages/cli/__tests__/init.test.ts | 2 +- .../{plans.test.ts => package.test.ts} | 2 +- 6 files changed, 27 insertions(+), 27 deletions(-) rename packages/cli/__tests__/__snapshots__/{plans.test.ts.snap => package.test.ts.snap} (54%) rename packages/cli/__tests__/{plans.test.ts => package.test.ts} (98%) diff --git a/packages/cli/__tests__/__snapshots__/extensions.test.ts.snap b/packages/cli/__tests__/__snapshots__/extensions.test.ts.snap index e185844bea..b24b4686f8 100644 --- a/packages/cli/__tests__/__snapshots__/extensions.test.ts.snap +++ b/packages/cli/__tests__/__snapshots__/extensions.test.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`extension runs \`extension\` command after workspace and module setup: extension-update - files 1`] = ` +exports[`cmds:extension runs \`extension\` command after workspace and module setup: extension-update - files 1`] = ` [ "__tests__/first.test.ts", ".questions.json", @@ -17,7 +17,7 @@ exports[`extension runs \`extension\` command after workspace and module setup: ] `; -exports[`extension runs \`extension\` command after workspace and module setup: extension-update - result 1`] = ` +exports[`cmds:extension runs \`extension\` command after workspace and module setup: extension-update - result 1`] = ` { "_": [ "extension", @@ -30,7 +30,7 @@ exports[`extension runs \`extension\` command after workspace and module setup: } `; -exports[`extension runs \`extension\` command after workspace and module setup: initial - control file 1`] = ` +exports[`cmds:extension runs \`extension\` command after workspace and module setup: initial - control file 1`] = ` "# my-module extension comment = 'my-module extension' default_version = '0.0.1' @@ -41,7 +41,7 @@ superuser = false " `; -exports[`extension runs \`extension\` command after workspace and module setup: initial - module dependencies 1`] = ` +exports[`cmds:extension runs \`extension\` command after workspace and module setup: initial - module dependencies 1`] = ` { "modules": [], "native": [ @@ -51,14 +51,14 @@ exports[`extension runs \`extension\` command after workspace and module setup: } `; -exports[`extension runs \`extension\` command after workspace and module setup: initial - required modules 1`] = ` +exports[`cmds:extension runs \`extension\` command after workspace and module setup: initial - required modules 1`] = ` [ "mod-1", "mod2", ] `; -exports[`extension runs \`extension\` command after workspace and module setup: updated - control file 1`] = ` +exports[`cmds:extension runs \`extension\` command after workspace and module setup: updated - control file 1`] = ` "# my-module extension comment = 'my-module extension' default_version = '0.0.1' @@ -69,7 +69,7 @@ superuser = false " `; -exports[`extension runs \`extension\` command after workspace and module setup: updated - module dependencies 1`] = ` +exports[`cmds:extension runs \`extension\` command after workspace and module setup: updated - module dependencies 1`] = ` { "modules": [], "native": [ @@ -79,7 +79,7 @@ exports[`extension runs \`extension\` command after workspace and module setup: } `; -exports[`extension runs \`extension\` command after workspace and module setup: updated - required modules 1`] = ` +exports[`cmds:extension runs \`extension\` command after workspace and module setup: updated - required modules 1`] = ` [ "plpgsql", "module-c", diff --git a/packages/cli/__tests__/__snapshots__/init.test.ts.snap b/packages/cli/__tests__/__snapshots__/init.test.ts.snap index adfcad8f86..13c3c3699b 100644 --- a/packages/cli/__tests__/__snapshots__/init.test.ts.snap +++ b/packages/cli/__tests__/__snapshots__/init.test.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`init initialize module 1`] = ` +exports[`cmds:init initialize module 1`] = ` "# my-module extension comment = 'my-module extension' default_version = '0.0.1' @@ -11,7 +11,7 @@ superuser = false " `; -exports[`init initialize module: module-only - argv 1`] = ` +exports[`cmds:init initialize module: module-only - argv 1`] = ` { "MODULENAME": "my-module", "_": [ @@ -26,7 +26,7 @@ exports[`init initialize module: module-only - argv 1`] = ` } `; -exports[`init initialize module: module-only - files 1`] = ` +exports[`cmds:init initialize module: module-only - files 1`] = ` [ ".eslintrc.json", ".gitignore", @@ -57,7 +57,7 @@ exports[`init initialize module: module-only - files 1`] = ` ] `; -exports[`init initialize module: module-only - result 1`] = ` +exports[`cmds:init initialize module: module-only - result 1`] = ` { "MODULENAME": "my-module", "_": [ @@ -72,11 +72,11 @@ exports[`init initialize module: module-only - result 1`] = ` } `; -exports[`init initialize module: module-only - transformResults 1`] = `[]`; +exports[`cmds:init initialize module: module-only - transformResults 1`] = `[]`; -exports[`init initialize module: module-only - writeResults 1`] = `[]`; +exports[`cmds:init initialize module: module-only - writeResults 1`] = `[]`; -exports[`init initializes workspace: workspace - argv 1`] = ` +exports[`cmds:init initializes workspace: workspace - argv 1`] = ` { "_": [ "init", @@ -87,7 +87,7 @@ exports[`init initializes workspace: workspace - argv 1`] = ` } `; -exports[`init initializes workspace: workspace - files 1`] = ` +exports[`cmds:init initializes workspace: workspace - files 1`] = ` [ "my-workspace/.eslintrc.json", "my-workspace/.gitignore", @@ -106,7 +106,7 @@ exports[`init initializes workspace: workspace - files 1`] = ` ] `; -exports[`init initializes workspace: workspace - result 1`] = ` +exports[`cmds:init initializes workspace: workspace - result 1`] = ` { "_": [ "init", @@ -117,6 +117,6 @@ exports[`init initializes workspace: workspace - result 1`] = ` } `; -exports[`init initializes workspace: workspace - transformResults 1`] = `[]`; +exports[`cmds:init initializes workspace: workspace - transformResults 1`] = `[]`; -exports[`init initializes workspace: workspace - writeResults 1`] = `[]`; +exports[`cmds:init initializes workspace: workspace - writeResults 1`] = `[]`; diff --git a/packages/cli/__tests__/__snapshots__/plans.test.ts.snap b/packages/cli/__tests__/__snapshots__/package.test.ts.snap similarity index 54% rename from packages/cli/__tests__/__snapshots__/plans.test.ts.snap rename to packages/cli/__tests__/__snapshots__/package.test.ts.snap index a2d1358f26..5b9f84999c 100644 --- a/packages/cli/__tests__/__snapshots__/plans.test.ts.snap +++ b/packages/cli/__tests__/__snapshots__/package.test.ts.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`extension updates module with \`extension\` and \`package\` commands in copied fixture workspace: extension-update - files 1`] = ` +exports[`cmds:package updates module with \`extension\` and \`package\` commands in copied fixture workspace: extension-update - files 1`] = ` [ "deploy/procedures/secretfunction.sql", "Makefile", @@ -14,14 +14,14 @@ exports[`extension updates module with \`extension\` and \`package\` commands in ] `; -exports[`extension updates module with \`extension\` and \`package\` commands in copied fixture workspace: extension-update - sql 1`] = ` +exports[`cmds:package updates module with \`extension\` and \`package\` commands in copied fixture workspace: extension-update - sql 1`] = ` "\\echo Use "CREATE EXTENSION secrets" to load this file. \\quit CREATE FUNCTION secretfunction ( ) RETURNS text AS $EOFCODE$ select * from generate_secret(); $EOFCODE$ LANGUAGE sql STABLE;" `; -exports[`extension updates module with \`extension\` and \`package\` commands in copied fixture workspace: initial - control file 1`] = ` +exports[`cmds:package updates module with \`extension\` and \`package\` commands in copied fixture workspace: initial - control file 1`] = ` "# secrets extension comment = 'skitch project' default_version = '0.0.1' @@ -32,7 +32,7 @@ superuser = false " `; -exports[`extension updates module with \`extension\` and \`package\` commands in copied fixture workspace: initial - module dependencies 1`] = ` +exports[`cmds:package updates module with \`extension\` and \`package\` commands in copied fixture workspace: initial - module dependencies 1`] = ` { "modules": [ "totp", @@ -45,7 +45,7 @@ exports[`extension updates module with \`extension\` and \`package\` commands in } `; -exports[`extension updates module with \`extension\` and \`package\` commands in copied fixture workspace: initial - required modules 1`] = ` +exports[`cmds:package updates module with \`extension\` and \`package\` commands in copied fixture workspace: initial - required modules 1`] = ` [ "plpgsql", "uuid-ossp", diff --git a/packages/cli/__tests__/extensions.test.ts b/packages/cli/__tests__/extensions.test.ts index ce9d13bc29..0243bebbbd 100644 --- a/packages/cli/__tests__/extensions.test.ts +++ b/packages/cli/__tests__/extensions.test.ts @@ -10,7 +10,7 @@ import { LaunchQLProject } from '@launchql/migrate'; const beforeEachSetup = setupTests(); -describe('extension', () => { +describe('cmds:extension', () => { let environment: TestEnvironment; let tempDir: string; diff --git a/packages/cli/__tests__/init.test.ts b/packages/cli/__tests__/init.test.ts index 27fe40f222..2f9326b562 100644 --- a/packages/cli/__tests__/init.test.ts +++ b/packages/cli/__tests__/init.test.ts @@ -10,7 +10,7 @@ import { LaunchQLProject } from '@launchql/migrate'; const beforeEachSetup = setupTests(); -describe('init', () => { +describe('cmds:init', () => { let environment: TestEnvironment; let tempDir: string; diff --git a/packages/cli/__tests__/plans.test.ts b/packages/cli/__tests__/package.test.ts similarity index 98% rename from packages/cli/__tests__/plans.test.ts rename to packages/cli/__tests__/package.test.ts index e44e223fa2..4824a579ec 100644 --- a/packages/cli/__tests__/plans.test.ts +++ b/packages/cli/__tests__/package.test.ts @@ -13,7 +13,7 @@ const fixture = (name: string) => const beforeEachSetup = setupTests(); -describe('extension', () => { +describe('cmds:package', () => { let environment: TestEnvironment; let tempDir: string; From 0be7ea927e1207eb24aae7d3aa37d7ce4d6d1e6f Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 14 May 2025 20:54:03 -0400 Subject: [PATCH 2/9] workflows --- .github/workflows/run-tests.yaml | 6 ++++++ TODO | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml index edae916de4..7bf241ef8b 100644 --- a/.github/workflows/run-tests.yaml +++ b/.github/workflows/run-tests.yaml @@ -49,6 +49,12 @@ jobs: - name: build run: yarn build + - name: launchql/migrate + run: cd ./packages/migrate && yarn test + + - name: launchql/cli + run: cd ./packages/cli && yarn test + - name: launchql/client run: cd ./packages/client && yarn test env: diff --git a/TODO b/TODO index 2c85dcc49d..2205997072 100644 --- a/TODO +++ b/TODO @@ -12,8 +12,8 @@ Good next steps: 1. Get a demo script of creating some tables w the meta api -2. Get export working -3. Get boilerplate (lql init) working +X 2. Get export working +X 3. Get boilerplate (lql init) working 4. Get testing framework working (this will be HUGE) ** remove shelljs From 4418316160aefee040b357fa64d9c35067d4081d Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 14 May 2025 21:03:41 -0400 Subject: [PATCH 3/9] workflows --- .github/workflows/run-tests.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml index 7bf241ef8b..fb6485b881 100644 --- a/.github/workflows/run-tests.yaml +++ b/.github/workflows/run-tests.yaml @@ -37,6 +37,21 @@ jobs: --health-retries 5 steps: + + - name: Configure Git (for tests) + run: | + git config --global user.name "CI Test User" + git config --global user.email "ci@example.com" + + # - name: Install Sqitch on Alpine + # run: | + # apk add --no-cache curl make perl perl-utils perl-dev build-base \ + # libpq libpq-dev postgresql-dev \ + # perl-dbd-pg perl-dbi perl-dbd-sqlite \ + # cpanminus + + # cpanm --notest --quiet App::Sqitch + - name: checkout uses: actions/checkout@v4 From abe88404e3a55deb26c0fcacf8d4ceab5b4545c9 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 14 May 2025 21:06:11 -0400 Subject: [PATCH 4/9] workflow --- .github/workflows/run-tests.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml index fb6485b881..6a6e7eb192 100644 --- a/.github/workflows/run-tests.yaml +++ b/.github/workflows/run-tests.yaml @@ -39,9 +39,9 @@ jobs: steps: - name: Configure Git (for tests) - run: | - git config --global user.name "CI Test User" - git config --global user.email "ci@example.com" + run: | + git config --global user.name "CI Test User" + git config --global user.email "ci@example.com" # - name: Install Sqitch on Alpine # run: | From 60ccc6ca32abae632edb19ed249fa2bdfae9cae3 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 14 May 2025 21:10:46 -0400 Subject: [PATCH 5/9] git --- .github/workflows/run-tests.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml index 6a6e7eb192..bdf7939363 100644 --- a/.github/workflows/run-tests.yaml +++ b/.github/workflows/run-tests.yaml @@ -37,6 +37,8 @@ jobs: --health-retries 5 steps: + - name: Install Git + run: apk add --no-cache git - name: Configure Git (for tests) run: | From 9eed5200196d0875b5f72552969442c2817a487b Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 14 May 2025 22:08:05 -0400 Subject: [PATCH 6/9] sqitch --- .github/workflows/run-tests.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml index bdf7939363..1cdc0977ec 100644 --- a/.github/workflows/run-tests.yaml +++ b/.github/workflows/run-tests.yaml @@ -45,14 +45,14 @@ jobs: git config --global user.name "CI Test User" git config --global user.email "ci@example.com" - # - name: Install Sqitch on Alpine - # run: | - # apk add --no-cache curl make perl perl-utils perl-dev build-base \ - # libpq libpq-dev postgresql-dev \ - # perl-dbd-pg perl-dbi perl-dbd-sqlite \ - # cpanminus - - # cpanm --notest --quiet App::Sqitch + - name: Install Sqitch on Alpine + run: | + apk add --no-cache curl make perl perl-utils perl-dev build-base \ + libpq libpq-dev postgresql-dev \ + perl-dbd-pg perl-dbi perl-dbd-sqlite \ + cpanminus + + cpanm --notest --quiet App::Sqitch - name: checkout uses: actions/checkout@v4 From 8b23d4bad4179deea8fce4679379edff293aa6f0 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 14 May 2025 22:29:13 -0400 Subject: [PATCH 7/9] image --- .github/workflows/run-tests.yaml | 34 ++++++++++++++++---------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml index 1cdc0977ec..9b6aea7d2b 100644 --- a/.github/workflows/run-tests.yaml +++ b/.github/workflows/run-tests.yaml @@ -6,7 +6,7 @@ on: jobs: container-job: runs-on: ubuntu-latest - container: node:20.12.0-alpine + container: pyramation/node-sqitch:20.12.0 services: pg_db: @@ -37,22 +37,22 @@ jobs: --health-retries 5 steps: - - name: Install Git - run: apk add --no-cache git - - - name: Configure Git (for tests) - run: | - git config --global user.name "CI Test User" - git config --global user.email "ci@example.com" - - - name: Install Sqitch on Alpine - run: | - apk add --no-cache curl make perl perl-utils perl-dev build-base \ - libpq libpq-dev postgresql-dev \ - perl-dbd-pg perl-dbi perl-dbd-sqlite \ - cpanminus - - cpanm --notest --quiet App::Sqitch + # - name: Install Git + # run: apk add --no-cache git + + # - name: Configure Git (for tests) + # run: | + # git config --global user.name "CI Test User" + # git config --global user.email "ci@example.com" + + # - name: Install Sqitch on Alpine + # run: | + # apk add --no-cache curl make perl perl-utils perl-dev build-base \ + # libpq libpq-dev postgresql-dev \ + # perl-dbd-pg perl-dbi perl-dbd-sqlite \ + # cpanminus + + # cpanm --notest --quiet App::Sqitch - name: checkout uses: actions/checkout@v4 From 18adf3ea3d425cd2d5c7ce660b4b1bcf4ac957f1 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 14 May 2025 23:22:01 -0400 Subject: [PATCH 8/9] workflow --- .github/workflows/run-tests.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml index 9b6aea7d2b..54595ab9b5 100644 --- a/.github/workflows/run-tests.yaml +++ b/.github/workflows/run-tests.yaml @@ -57,8 +57,8 @@ jobs: - name: checkout uses: actions/checkout@v4 - - name: deps - run: apk update && apk add bash git python3-dev make g++ + # - name: deps + # run: apk update && apk add bash git python3-dev make g++ - name: deps run: yarn From e3d703b709e3c7be01f92c43c89892763fa3596a Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 14 May 2025 23:35:15 -0400 Subject: [PATCH 9/9] config --- .github/workflows/run-tests.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml index 54595ab9b5..c22d087b08 100644 --- a/.github/workflows/run-tests.yaml +++ b/.github/workflows/run-tests.yaml @@ -40,10 +40,10 @@ jobs: # - name: Install Git # run: apk add --no-cache git - # - name: Configure Git (for tests) - # run: | - # git config --global user.name "CI Test User" - # git config --global user.email "ci@example.com" + - name: Configure Git (for tests) + run: | + git config --global user.name "CI Test User" + git config --global user.email "ci@example.com" # - name: Install Sqitch on Alpine # run: |