Skip to content

Commit

Permalink
Merge pull request #3803 from harehare/revert-3802-revert-3801-suppor…
Browse files Browse the repository at this point in the history
…t_sqlite

Update e2e test
  • Loading branch information
harehare authored Oct 31, 2024
2 parents 2853fa9 + d23ee7b commit cb2cef9
Show file tree
Hide file tree
Showing 46 changed files with 3,376 additions and 562 deletions.
36 changes: 28 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version-file: ".tool-versions"
- uses: extractions/setup-just@v2
- uses: actions/setup-go@v5
with:
go-version-file: "backend/go.mod"
- uses: actions/labeler@v5
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
Expand Down Expand Up @@ -79,22 +83,33 @@ jobs:
- name: Run Tests
working-directory: frontend
run: npm run test
- name: Migrate database
run: |
go install github.com/amacneil/dbmate@latest
just migrate
working-directory: backend
env:
DB_TYPE: sqlite
DATABASE_URL: sqlite3:textusm.db
- name: Setup E2E
run: npm run test:e2e:init
working-directory: frontend
- name: Run E2E Tests
run: npm run test:e2e
working-directory: frontend
env:
API_ROOT: ${{ secrets.API_ROOT }}
WEB_ROOT: ${{ secrets.WEB_ROOT }}
API_ROOT: http://localhost:8081
WEB_ROOT: http://localhost:3000
APP_VERSION: ""
FIREBASE_API_KEY: ${{ secrets.FIREBASE_API_KEY }}
FIREBASE_AUTH_DOMAIN: ${{ secrets.FIREBASE_AUTH_DOMAIN }}
FIREBASE_PROJECT_ID: ${{ secrets.FIREBASE_PROJECT_ID }}
FIREBASE_STORAGE_BUCKET: ${{ secrets.FIREBASE_STORAGE_BUCKET }}
FIREBASE_APP_ID: ${{ secrets.FIREBASE_APP_ID }}
FIREBASE_AUTH_EMULATOR_HOST: ""
FIREBASE_API_KEY: textusm
FIREBASE_AUTH_DOMAIN: textusm
FIRESTORE_EMULATOR_HOST: "localhost:8082"
FIREBASE_PROJECT_ID: textusm
FIREBASE_STORAGE_BUKET: textusm.appspot.com
FIREBASE_STORAGE_EMULATOR_HOST: "localhost:9199"
FIREBASE_AUTH_EMULATOR_HOST: "localhost:9099"
FIREBASE_APP_ID: dev
STORAGE_BUCKET_NAME: textusm.appspot.com
SENTRY_ENABLE: "0"
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
SENTRY_RELEASE: ${{ steps.package-version.outputs.current-version}}
Expand All @@ -104,6 +119,11 @@ jobs:
MONITOR_ENABLE: "0"
USE_HTTPS: "0"
REPO_BUTTON_URL: ""
API_VERSION: v0.14.8
PORT: 8081
GO_ENV: development
DATABASE_URL: textusm.db
DB_TYPE: sqlite

backend-test:
name: backend_test
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,6 @@ certs/*
backend/tmp/
data
firebase-export-*

*.sqlite3
*.db
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
nodejs 22.2.0
nodejs 20.18.0
golang 1.23.0
elm 0.19.1
just 1.36.0
28 changes: 14 additions & 14 deletions backend/db/postgresql/migrations/20241012091142_create_tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -59,27 +59,27 @@ CREATE TABLE
settings (
id bigserial PRIMARY KEY,
uid varchar NOT NULL,
activity_color varchar,
activity_background_color varchar,
background_color varchar,
activity_color varchar NOT NULL,
activity_background_color varchar NOT NULL,
background_color varchar NOT NULL,
diagram diagram NOT NULL,
height int,
font varchar,
line_color varchar,
label_color varchar,
height int NOT NULL,
font varchar NOT NULL,
line_color varchar NOT NULL,
label_color varchar NOT NULL,
lock_editing boolean,
text_color varchar,
toolbar boolean,
scale real,
show_grid boolean,
story_color varchar,
story_background_color varchar,
task_color varchar,
task_background_color varchar,
width int,
story_color varchar NOT NULL,
story_background_color varchar NOT NULL,
task_color varchar NOT NULL,
task_background_color varchar NOT NULL,
width int NOT NULL,
zoom_control boolean,
created_at timestamp DEFAULT NOW(),
updated_at timestamp DEFAULT NOW()
created_at timestamp DEFAULT NOW() NOT NULL,
updated_at timestamp DEFAULT NOW() NOT NULL
);

CREATE UNIQUE INDEX items_uid_location_diagram_id_idx ON items (uid, location, diagram_id);
Expand Down
2 changes: 1 addition & 1 deletion backend/db/postgresql/query.sql
Original file line number Diff line number Diff line change
Expand Up @@ -175,4 +175,4 @@ SET
width = $16,
zoom_control = $17
WHERE
diagram = $2;
diagram = $18;
Loading

0 comments on commit cb2cef9

Please sign in to comment.