restructuring
|
@ -23,11 +23,11 @@ jobs:
|
|||
- name: Prepare
|
||||
run: |
|
||||
pnpm install
|
||||
pnpm run ci:prepare
|
||||
pnpm run test:prepare
|
||||
- name: Install Playwright
|
||||
run: npx playwright install --with-deps
|
||||
- name: Run your tests
|
||||
run: pnpm run test
|
||||
run: pnpm run test:run
|
||||
- name: Upload test results
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v2
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
FROM node:16-alpine as client
|
||||
WORKDIR /tmp
|
||||
RUN npm install -g pnpm@7
|
||||
COPY ./frontend ./
|
||||
COPY ./packages/frontend ./
|
||||
RUN pnpm install
|
||||
RUN pnpm exec svelte-kit sync
|
||||
RUN pnpm run build
|
||||
|
@ -12,9 +12,9 @@ RUN pnpm run build
|
|||
FROM rust:1.61-alpine as backend
|
||||
WORKDIR /tmp
|
||||
RUN apk add libc-dev openssl-dev alpine-sdk
|
||||
COPY ./backend/Cargo.* ./
|
||||
COPY ./packages/backend/Cargo.* ./
|
||||
RUN cargo fetch
|
||||
COPY ./backend ./
|
||||
COPY ./packages/backend ./
|
||||
RUN cargo build --release
|
||||
|
||||
|
||||
|
|
|
@ -146,9 +146,9 @@ You can see the app under [localhost:1234](http://localhost:1234).
|
|||
Tests are end to end tests written with Playwright.
|
||||
|
||||
```sh
|
||||
pnpm run ci:prepare
|
||||
pnpm run test:prepare
|
||||
docker compose up redis -d
|
||||
pnpm run ci:server
|
||||
pnpm run test:server
|
||||
|
||||
# In another terminal.
|
||||
# Use the test or test:local script. The local version only runs in one browser for quicker development.
|
||||
|
|
|
@ -168,9 +168,9 @@ pnpm run dev
|
|||
这些测试是用 Playwright 实现的一些端到端测试用例。
|
||||
|
||||
```sh
|
||||
pnpm run ci:prepare
|
||||
pnpm run test:prepare
|
||||
docker compose up redis -d
|
||||
pnpm run ci:server
|
||||
pnpm run test:server
|
||||
|
||||
# 在另一个终端中:
|
||||
# 使用test或者test:local script。为了更快的开发,本地版本只会在一个浏览器中运行。
|
||||
|
|
|
@ -10,10 +10,11 @@ services:
|
|||
- 6379:6379
|
||||
|
||||
app:
|
||||
build: .
|
||||
# build: .
|
||||
image: cupcakearmy/cryptgeon
|
||||
depends_on:
|
||||
- redis
|
||||
environment:
|
||||
SIZE_LIMIT: 128 MiB
|
||||
SIZE_LIMIT: 10 MiB
|
||||
ports:
|
||||
- 1234:5000
|
||||
|
|
15
package.json
|
@ -1,20 +1,17 @@
|
|||
{
|
||||
"scripts": {
|
||||
"dev:docker": "docker-compose up redis",
|
||||
"dev:backend": "cd backend && cargo watch -x 'run --bin cryptgeon'",
|
||||
"dev:front": "pnpm --prefix frontend run dev",
|
||||
"dev:packages": "pnpm -r run dev",
|
||||
"dev:proxy": "node proxy.mjs",
|
||||
"dev": "run-p dev:*",
|
||||
"test": "playwright test --project chrome firefox safari",
|
||||
"test:run": "playwright test --project chrome firefox safari",
|
||||
"test:local": "playwright test --project local",
|
||||
"ci:server": "cd backend && SIZE_LIMIT=10MiB LISTEN_ADDR=0.0.0.0:1234 cargo run",
|
||||
"ci:prepare": "run-p ci:prepare:*",
|
||||
"ci:prepare:backend": "cd backend && cargo build",
|
||||
"ci:prepare:front": "pnpm --prefix frontend install && pnpm --prefix frontend run build"
|
||||
"test:server": "pnpm -r run test:server",
|
||||
"test:prepare": "pnpm -r run test:prepare"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@playwright/test": "^1.23.4",
|
||||
"@types/node": "16",
|
||||
"@playwright/test": "^1.25.1",
|
||||
"@types/node": "^16.11.57",
|
||||
"http-proxy": "^1.18.1",
|
||||
"npm-run-all": "^4.1.5"
|
||||
}
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"name": "backend",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "cargo watch -x 'run --bin cryptgeon'",
|
||||
"build": "cargo build --release",
|
||||
"test:server": "SIZE_LIMIT=10MiB LISTEN_ADDR=0.0.0.0:1234 cargo run",
|
||||
"test:prepare": "cargo build"
|
||||
}
|
||||
}
|
|
@ -7,5 +7,6 @@ pub fn init(cfg: &mut web::ServiceConfig) {
|
|||
let plain = web::PayloadConfig::default()
|
||||
.limit(*config::LIMIT)
|
||||
.mimetype(mime::STAR_STAR);
|
||||
// cfg.app_data(plain);
|
||||
cfg.app_data(json).app_data(plain);
|
||||
}
|
|
@ -1,8 +1,8 @@
|
|||
├─ MIT: 12
|
||||
├─ MIT: 13
|
||||
├─ ISC: 2
|
||||
├─ BSD-3-Clause: 1
|
||||
├─ (MPL-2.0 OR Apache-2.0): 1
|
||||
├─ BSD-2-Clause: 1
|
||||
├─ ISC: 1
|
||||
├─ 0BSD: 1
|
||||
└─ Apache-2.0: 1
|
||||
|
|
|
@ -6,7 +6,8 @@
|
|||
"preview": "vite preview --port 3000",
|
||||
"check": "svelte-check --tsconfig tsconfig.json",
|
||||
"licenses": "license-checker --summary > licenses.csv",
|
||||
"locale:download": "node scripts/locale.js"
|
||||
"locale:download": "node scripts/locale.js",
|
||||
"test:prepare": "pnpm run build"
|
||||
},
|
||||
"type": "module",
|
||||
"devDependencies": {
|
Before Width: | Height: | Size: 287 B After Width: | Height: | Size: 287 B |
Before Width: | Height: | Size: 325 B After Width: | Height: | Size: 325 B |
Before Width: | Height: | Size: 736 B After Width: | Height: | Size: 736 B |
Before Width: | Height: | Size: 483 B After Width: | Height: | Size: 483 B |
Before Width: | Height: | Size: 732 B After Width: | Height: | Size: 732 B |
Before Width: | Height: | Size: 784 B After Width: | Height: | Size: 784 B |
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |
|
@ -3,6 +3,7 @@ import precompileIntl from 'svelte-intl-precompile/sveltekit-plugin'
|
|||
|
||||
/** @type {import('vite').UserConfig} */
|
||||
const config = {
|
||||
clearScreen: false,
|
||||
server: {
|
||||
port: 3000,
|
||||
},
|
|
@ -11,7 +11,7 @@ const config: PlaywrightTestConfig = {
|
|||
testDir: './test',
|
||||
|
||||
webServer: {
|
||||
command: 'pnpm run ci:server',
|
||||
command: 'pnpm run test:server',
|
||||
port: 1234,
|
||||
reuseExistingServer: true,
|
||||
},
|
||||
|
|
1632
pnpm-lock.yaml
|
@ -0,0 +1,2 @@
|
|||
packages:
|
||||
- "packages/**"
|
|
@ -0,0 +1,8 @@
|
|||
import { test } from '@playwright/test'
|
||||
import { createNote } from '../utils'
|
||||
import Files from './files'
|
||||
|
||||
test('to big zip', async ({ page }) => {
|
||||
const files = [Files.Zip]
|
||||
const link = await createNote(page, { files, error: 'note is to big' })
|
||||
})
|