Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 26 additions & 3 deletions .github/workflows/run-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -37,18 +37,41 @@ 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: 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

- 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:
Expand Down
4 changes: 2 additions & 2 deletions TODO
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 8 additions & 8 deletions packages/cli/__tests__/__snapshots__/extensions.test.ts.snap
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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",
Expand All @@ -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'
Expand All @@ -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": [
Expand All @@ -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'
Expand All @@ -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": [
Expand All @@ -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",
Expand Down
22 changes: 11 additions & 11 deletions packages/cli/__tests__/__snapshots__/init.test.ts.snap
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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",
"_": [
Expand All @@ -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",
Expand Down Expand Up @@ -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",
"_": [
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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`] = `[]`;
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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'
Expand All @@ -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",
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/__tests__/extensions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { LaunchQLProject } from '@launchql/migrate';

const beforeEachSetup = setupTests();

describe('extension', () => {
describe('cmds:extension', () => {
let environment: TestEnvironment;
let tempDir: string;

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/__tests__/init.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { LaunchQLProject } from '@launchql/migrate';

const beforeEachSetup = setupTests();

describe('init', () => {
describe('cmds:init', () => {
let environment: TestEnvironment;
let tempDir: string;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const fixture = (name: string) =>

const beforeEachSetup = setupTests();

describe('extension', () => {
describe('cmds:package', () => {
let environment: TestEnvironment;
let tempDir: string;

Expand Down