-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #230 from lidofinance/develop
dev to goerli
- Loading branch information
Showing
83 changed files
with
2,028 additions
and
418 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,9 +2,6 @@ | |
/dist | ||
/node_modules | ||
|
||
# Env | ||
.env | ||
|
||
# Logs | ||
logs | ||
*.log | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,22 @@ on: pull_request | |
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
services: | ||
postgres: | ||
image: postgres:16-alpine | ||
env: | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_USER: postgres | ||
POSTGRES_DB: node_operator_keys_service_db | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
ports: | ||
- 5432:5432 | ||
|
||
steps: | ||
- name: Checkout repo | ||
uses: actions/[email protected] | ||
|
@@ -19,9 +35,15 @@ jobs: | |
run: yarn lint | ||
- name: Run tests | ||
run: yarn test | ||
- name: Run tests | ||
run: yarn test:e2e | ||
- name: Run E2E tests | ||
run: yarn test:e2e:docker | ||
env: | ||
PROVIDERS_URLS: ${{ secrets.PROVIDERS_URLS }} | ||
CL_API_URLS: "https://e2e-test.lido.fi," | ||
CHAIN_ID: ${{ secrets.CHAIN_ID }} | ||
CHRONIX_PROVIDER_MAINNET_URL: ${{ secrets.CHRONIX_PROVIDER_MAINNET_URL }} | ||
DB_NAME: node_operator_keys_service_db | ||
DB_PORT: 5432 | ||
DB_HOST: localhost | ||
DB_USER: postgres | ||
DB_PASSWORD: postgres |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"type": "node", | ||
"request": "launch", | ||
"name": "Debug Nest Framework", | ||
"runtimeExecutable": "yarn", | ||
"runtimeArgs": [ | ||
"start:debug", | ||
], | ||
"cwd": "${workspaceFolder}/src", | ||
"autoAttachChildProcesses": true, | ||
"restart": true, | ||
"sourceMaps": true, | ||
"stopOnEntry": false, | ||
"console": "integratedTerminal", | ||
}, | ||
{ | ||
"type": "node", | ||
"request": "launch", | ||
"name": "Debug Jest e2e", | ||
"runtimeExecutable": "yarn", | ||
"runtimeArgs": [ | ||
"test:e2e:docker:debug", | ||
], | ||
"cwd": "${workspaceFolder}/src", | ||
"autoAttachChildProcesses": true, | ||
"restart": true, | ||
"sourceMaps": true, | ||
"stopOnEntry": false, | ||
"console": "integratedTerminal", | ||
}, | ||
{ | ||
"name": "Jest file", | ||
"type": "node", | ||
"request": "launch", | ||
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/jest", | ||
"args": [ | ||
"${fileBasenameNoExtension}", | ||
"--runInBand", | ||
"--watch", | ||
"--coverage=false", | ||
"--no-cache" | ||
], | ||
"cwd": "${workspaceRoot}", | ||
"console": "integratedTerminal", | ||
"internalConsoleOptions": "neverOpen", | ||
"sourceMaps": true, | ||
"windows": { | ||
"program": "${workspaceFolder}/node_modules/jest/bin/jest" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM node:18.14.2-alpine3.16 as building | ||
|
||
RUN apk add --no-cache git=2.36.6-r0 | ||
|
||
WORKDIR /app | ||
|
||
COPY package.json yarn.lock chronix.config.ts .env ./ | ||
COPY jest* ./ | ||
COPY ./tsconfig*.json ./ | ||
|
||
RUN yarn install --frozen-lockfile --non-interactive && yarn cache clean | ||
COPY ./src ./src | ||
RUN yarn typechain | ||
|
||
CMD ["yarn", "test:e2e:docker"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
version: '3.7' | ||
|
||
services: | ||
e2e_pgdb: | ||
container_name: e2e_pgdb | ||
image: postgres:14-alpine | ||
restart: unless-stopped | ||
environment: | ||
- POSTGRES_DB=${DB_NAME} | ||
- POSTGRES_USER=${DB_USER} | ||
- POSTGRES_PASSWORD=${DB_PASSWORD} | ||
expose: | ||
- 5432:5432 | ||
volumes: | ||
- ./.volumes/pgdata-${CHAIN_ID}/:/var/lib/postgresql/data | ||
|
||
e2e_keys_api: | ||
container_name: e2e_keys_api | ||
build: | ||
context: ./ | ||
dockerfile: Dockerfile.e2e | ||
environment: | ||
- NODE_ENV=production | ||
- DB_PORT=5432 | ||
- DB_HOST=e2e_pgdb | ||
depends_on: | ||
- e2e_pgdb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
{ | ||
"collection": "@nestjs/schematics", | ||
"sourceRoot": "src" | ||
"sourceRoot": "src", | ||
"compilerOptions": { | ||
"tsConfigPath": "./tsconfig.build.json" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { Module } from '@nestjs/common'; | ||
import { MikroOrmModule } from '@mikro-orm/nestjs'; | ||
import config from 'mikro-orm.config'; | ||
import { ConfigModule, ConfigService } from 'common/config'; | ||
|
||
@Module({ | ||
imports: [ | ||
ConfigModule, | ||
MikroOrmModule.forRootAsync({ | ||
async useFactory(configService: ConfigService) { | ||
return { | ||
...config, | ||
dbName: configService.get('DB_NAME'), | ||
host: configService.get('DB_HOST'), | ||
port: configService.get('DB_PORT'), | ||
user: configService.get('DB_USER'), | ||
password: configService.get('DB_PASSWORD'), | ||
autoLoadEntities: false, | ||
cache: { enabled: false }, | ||
debug: false, | ||
registerRequestContext: true, | ||
allowGlobalContext: true, | ||
}; | ||
}, | ||
inject: [ConfigService], | ||
}), | ||
], | ||
}) | ||
export class DatabaseTestingModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from './app.constants'; | ||
export * from './app.module'; | ||
export * from './app.service'; | ||
export * from './database-testing.module'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.