Skip to content

Commit

Permalink
(fix): improve fdr test setup (#682)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsinghvi authored Apr 21, 2024
1 parent f6959f5 commit fa731e8
Show file tree
Hide file tree
Showing 22 changed files with 1,225 additions and 1,042 deletions.
25 changes: 21 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ jobs:
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
workingDir: packages/ui/app

test:
fern-generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -92,13 +92,30 @@ jobs:
pnpm fern generate --local --api fdr
pnpm turbo --filter=@fern-platform/fdr codegen
- name: Ensure no changes to git-tracked files
run: git --no-pager diff --exit-code

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2 # This helps turbo resolve changes faster

- name: Install
uses: ./.github/actions/install

- name: Run tests
run: pnpm test
env:
CI: true

- name: Ensure no changes to git-tracked files
run: git --no-pager diff --exit-code
- name: Run tests against local FDR
run: |
cd servers/fdr
pnpm test:local
env:
CI: true

check-docs-release-is-allowed:
runs-on: ubuntu-latest
Expand Down
25 changes: 12 additions & 13 deletions .github/workflows/fdr-ete.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,35 @@ name: Test FDR ETE
on:
push:
paths:
- 'fern/apis/fdr/**'
- 'fern/fern.config.json'
- 'servers/fdr-deploy/**'
- 'servers/fdr/**'
- '.github/workflows/deploy-fdr.yml'
- 'packages/fdr-sdk/**'
- 'pnpm-lock.yaml'
- "fern/apis/fdr/**"
- "fern/fern.config.json"
- "servers/fdr-deploy/**"
- "servers/fdr/**"
- ".github/workflows/deploy-fdr.yml"
- "packages/fdr-sdk/**"
- "pnpm-lock.yaml"

env:
PACKAGE_NAME: "@fern-platform/fdr"
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: "buildwithfern"
FERN_TOKEN: ${{ secrets.FERN_TOKEN }}

jobs:
run:
runs-on: ubuntu-latest
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2 # This helps turbo resolve changes faster

- name: Install
uses: ./.github/actions/install

- name: Setup database
# TODO: re-enable when moving to turbo
# pnpm turbo --filter= docker:local
run: |
cd servers/fdr
pnpm run docker:local
pnpm run test:ete
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"vitest.commandLine": "pnpm test"
"vitest.commandLine": "pnpm test",
"vitest.disableWorkspaceWarning": true
}
13 changes: 13 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions servers/fdr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"@fern-platform/configs": "workspace:*",
"@types/compression": "^1.7.5",
"@types/cors": "^2.8.13",
"@types/execa": "^2.0.0",
"@types/express": "^4.17.13",
"@types/html-to-text": "^9.0.1",
"@types/httpsnippet": "^1.23.1",
Expand All @@ -59,6 +60,7 @@
"dotenv-cli": "^6.0.0",
"eslint": "^8.56.0",
"eslint-config-custom": "*",
"execa": "^5.1.1",
"nodemon": "^3.0.0",
"prettier": "^3.2.4",
"prisma": "5.11.0",
Expand All @@ -85,10 +87,9 @@
"docker:dev": "dotenv -e .env.dev -- ./create_docker.sh",
"docker:prod": "dotenv -e .env.prod -- ./create_docker.sh",
"test": "vitest src/__test__/unit-tests --globals",
"test:ete": "dotenv -e .env.ete -- ./scripts/ete-tests.sh",
"lint:eslint": "eslint --max-warnings 0 . --ignore-path=../../.eslintignore",
"lint:eslint:fix": "pnpm lint:eslint --fix",
"test-db": "dotenv -e .env.test -- ./scripts/db-tests.sh",
"test-ete": "dotenv -e .env.ete -- ./scripts/ete-tests.sh"
"test:local": "dotenv -e .env.test -- vitest src/__test__/local --globals --config src/__test__/local/vitest.config.ts",
"test:ete": "dotenv -e .env.ete -- vitest src/__test__/ete --globals --config src/__test__/ete/vitest.config.ts"
}
}
16 changes: 0 additions & 16 deletions servers/fdr/scripts/db-tests.sh

This file was deleted.

18 changes: 0 additions & 18 deletions servers/fdr/scripts/ete-tests.sh

This file was deleted.

Loading

0 comments on commit fa731e8

Please sign in to comment.